Hyperledger Fabric: How to get transaction history using key?

0 votes
I have a key and now I want to extract all the transactions made that includes this particular key. I am not able to implement a method that could do this? Can someone tell me how to do this? Or rather share the code. Thanks
Nov 20, 2018 in Blockchain by digger
• 27,620 points
325 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
history, err := stub.GetHistoryForKey(key_value)
for history.HasNext() {
    modification, err := history.Next()
    if err != nil {
        fmt.Println(err.Error())
        return shim.Error(err.Error())
    }
    fmt.Println("Returning information about", string(modification.Value))
}
answered Nov 20, 2018 by Omkar
• 65,850 points

Related Questions In Blockchain

+1 vote
2 answers
0 votes
1 answer
0 votes
1 answer

Hyperledger Fabric: How to retrieve result from Fabric Transaction?

invokeChainCode(securityContext, functionName, args, options) { ...READ MORE

answered Nov 8, 2018 in Blockchain by Omkar
• 65,850 points
189 views
0 votes
1 answer

Hyperledger Fabric: How to ping network using program?

// http://nodejs.org/api.html#_child_processes var sys = require('sys') var exec = ...READ MORE

answered Nov 9, 2018 in Blockchain by Omkar
• 65,850 points
70 views
0 votes
1 answer
0 votes
1 answer

Hyperledger Fabric: How to create wallet using program?

You can do this by passing some ...READ MORE

answered Oct 31, 2018 in Blockchain by Omkar
• 65,850 points
271 views
0 votes
1 answer

Hyperledger Fabric: How to access transaction ID in invoke function?

You can access transaction ID in Invoke ...READ MORE

answered Nov 5, 2018 in Blockchain by Omkar
• 65,850 points
188 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.