Home > front end >  How to decode the result after using qscc GetBlockByTxID in hyperledger fabric
How to decode the result after using qscc GetBlockByTxID in hyperledger fabric

Time:11-29

My operation system is ubuntu 20.04.My Hyperledger fabric' s version is 2.4.4. I want to get the block number by txid.But after using the function GetBlockByTxID in system chaincode qscc,i found that part of the result was in the form of numbers.I can't get the block number.I used peer chaincode query and peer chaincode invoke to try.If i use peer chaincode query to use GetblockByTxID, the results will be all presented in numerical form.If i use peer chaincode invoke, part of the results will be presented in numerical form.How can i decode these numbers?Thank you. use peer chaincode invoke to use GetBlockByTxID user peer chaincode query to use GetBlockByTxID

I tried to convert the result directly to string format.But it was wrong.

CodePudding user response:

This discussion thread explains the method to retrieve the block details. https://github.com/hyperledger/fabric-gateway/discussions/504#discussioncomment-4075717. Please check.

  • Related