Hyperledger Fabric:如何使用Fabric NodeSDK查询块 [英] Hyperledger Fabric : How to Query blocks using fabric NodeSDK

查看:102
本文介绍了Hyperledger Fabric:如何使用Fabric NodeSDK查询块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在浏览Hyperledger官方网站上的FabCar示例,以下是我的问题.

I have been going through FabCar sample from hyperledger official site below are my questions.

  1. 成功完成交易后作为响应获得的交易ID的目的是什么?

  1. What is the purpose of transaction ID that were generated which we get as a response after successfully making a transaction?

transactionID 在查询特定块时是否有帮助?

Does that transactionID be helpful in querying particular block?

查询CouchDB 并获得结果的正确方法吗?还是需要探索/查询(如果这样)?

Is it the right way to query CouchDB and get results? or do the blocks needs to be explored/queried, if so how?

推荐答案

您可以使用事务ID来使用

You can use transaction ID to retrieve that specific processed transaction, using

channel.queryTransaction(tx_id,target,useAdmin,skipDecode) 返回对完全解码的 ProcessedTransaction 对象的承诺.

已处理的交易将包含您需要的有关交易的所有信息,包括区块号,然后您可以使用

The processed transaction will contain all the information you need about the transaction including the block number, which you can then use to fetch the appropriate block using

channel.queryBlock(blockNumber,target,useAdmin,skipDecode)

这篇关于Hyperledger Fabric:如何使用Fabric NodeSDK查询块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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