how to get a BlockInfo by fabric-gateway? #583
Unanswered
diandiankou
asked this question in
Q&A
Replies: 1 comment
-
You can use the fabric-gateway API to evaluate the GetBlockByNumber transactions function on the qscc system chaincode. This returns a serialized Block protocol buffer message. See the answer to this question for more details on how to unpack the Block. An alternative is to use the fabric-gateway API to retrieve blocks from the desired block number, read the first block, and then close the block iterator (unless you want to read subsequent blocks). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i can get a BlockInfo through the fabric-gatway-Java repo, for example:
Channel channel = network.getChannel();
BlockInfo blockInfo = channel.queryBlockByNumber(Long.parseLong(txId));
But how can I get a BlockInfo through the fabric-gatway repo? I haven't seen any similar interfaces.
Beta Was this translation helpful? Give feedback.
All reactions