1

I am currently developing programs using hyperledger. I want to get each tx (transaction) data from hyperledger like this.

A changed value "On"
A changed value "Off"
B changed value "On"
...

However, there seems to be no api that get the transaction history. This question is similar to the 40466580 question. Is it best to just fix the program in chaincode? Or is there a better way?

spritecodej
  • 459
  • 1
  • 4
  • 13

1 Answers1

1

You may use following method of Hyperledger shim interface to get history of a particular key:-

GetHistoryForKey(key string) (HistoryQueryIteratorInterface, error)

For more details, please check hyperledger shim interface documentation:-

Hyperledger Shim Interface

For usage, please check following link:-

GetHistoryForKey() usage

Ankit Kamra
  • 151
  • 4