Techiio-author
Started by Natasha JonesSep 30, 2021

Open
Retrieve transaction details in Hyperledger Fabric (java chaincode)

2 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 2 VIEWES SHARE

I would like to search for a transaction in hyperledger fabric, filtering against the person who launched it and the id it refers to. For example, let's say we have a generic car asset with the number plate as a parameter. I would like to be able to search for all the transactions made by a user, filtering them by that number plate, and then retrieve the timestamp of the last one made. Can anyone help me with this?

1 Replies

Techiio-commentatorNilima Paul replied 5 months ago0 likes0 dislikes

You can develop the proper indexing and query function in your chain code.

Meaning for each transaction you store its details in the internal key/value store (stub.PutState) with the user as key and return all the transactions associated with a user in your query (stub.GetState).

You must be Logged in to reply
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance