HyperLedger Fabric获取块信息-使用node.js [英] HyperLedger Fabric Get Block Info - using node.js

查看:92
本文介绍了HyperLedger Fabric获取块信息-使用node.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我曾经建立一个Fabric网络,并使用Fabric和Fabric节点SDK部署了Fabric网络和基本应用程序.我能够进行查询并写入链中.有什么方法可以检索阻止信息?像区块高度和transactionID一样?

I used to set up a Fabric network and deployed a fabric network and basic application using a Fabric and Fabric node SDK. 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?

推荐答案

在具有节点sdk的Hyperledger Fabric中,您可以使用queryBlock方法

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

您可以将其用作 let response_payload =等待channel.queryBlock(parseInt(blockNumber,peer)); 这将返回块的详细信息.

you can use it as let response_payload = await channel.queryBlock(parseInt(blockNumber, peer)); this will return the block details.

这篇关于HyperLedger Fabric获取块信息-使用node.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆