How to get all transaction history against a chaincode in Hyperledger fabric

Ahmed Shareef picture Ahmed Shareef · Nov 7, 2016 · Viewed 8.6k times · Source

I am able to do transactions in Hyperledger (fabric implementation). I want to see all the transactions and its payload details initiated by a user by passing the user's key.

for example:

A transfers 10 units to B
A transfers 5 units to C
D transfers 8 units to A

When I pass A's key then fabric must provide me all the transactions of A. Is there any way? Or which fabric API function call should I use?

Answer

Sufiyan Ghori picture Sufiyan Ghori · Nov 9, 2016

/chain/blocks/{Block} endpoint carries ordered list of transactions in a specified block.

Use /chain endpoint to get the height (number of blocks) of your chain, and then retrieve transactions from each block using /chain/blocks/{Block} REST endpoint.