简体   繁体   中英

How to get transaction history in hyperledger

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM