How can I get blockInfo by txId #504
-
I can't find a similar way like fabric-gateway-java : Channel channel = network.getChannel(); |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can evaluate the GetBlockByTxID transaction function on the qscc system chaincode. The qscc system chaincode is not well documented but the implementation is here: https://github.com/hyperledger/fabric/blob/main/core/scc/qscc/query.go GetBlockByTxID takes two arguments: channel name and transaction ID. It returns a serialized Block protocol buffer message. You can deserialize this using the fabric-protos language bindings for the Fabric protocol buffer messages: var block = org.hyperledger.fabric.protos.common.Block.parseFrom(responseBytes); The off_chain_data sample demonstrates how to navigate the block structure and retrieve information. You might want to reuse some or all of the parser code from there. |
Beta Was this translation helpful? Give feedback.
You can evaluate the GetBlockByTxID transaction function on the qscc system chaincode. The qscc system chaincode is not well documented but the implementation is here:
https://github.com/hyperledger/fabric/blob/main/core/scc/qscc/query.go
GetBlockByTxID takes two arguments: channel name and transaction ID. It returns a serialized Block protocol buffer message. You can deserialize this using the fabric-protos language bindings for the Fabric protocol buffer messages:
The off_chain_data sample demonstrates how to navigate the block structure and retrieve information. You might want to reuse some or all of the p…