简体   繁体   English

HyperLedger Fabric 获取区块信息 - 使用 node.js

[英]HyperLedger Fabric Get Block Info - using node.js

I used to set up a Fabric network and deployed a fabric network and basic application using a Fabric and Fabric node SDK.我曾经建立一个 Fabric 网络,并使用 Fabric 和 Fabric 节点 SDK 部署了一个 Fabric 网络和基本应用程序。 I'm able to do the query and write to the chain.我能够进行查询并写入链。 Is there any way to retrieve the Block Info?有没有办法检索块信息? Like block height and transactionID?像块高度和事务ID?

In Hyperledger Fabric with node sdk you can retrieve the block info with the queryBlock method https://hyperledger.github.io/fabric-sdk-node/release-1.4/Channel.html#queryBlock在带有节点 sdk 的 Hyperledger Fabric 中,您可以使用 queryBlock 方法https://hyperledger.ZBF215181B5140522137B3D4F6B73544Block.io/fabric/Channel.html#query-release1检索块信息。

you can use it as let response_payload = await channel.queryBlock(parseInt(blockNumber, peer));您可以将其用作let response_payload = await channel.queryBlock(parseInt(blockNumber, peer)); this will return the block details.这将返回块详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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