如何在Hyperledger Fabric 2.0中按ID查询事务

Querying transaction content out from a blockchain network is a common practice used by common scenarios like exploring the blockchain history or verifying the blockchain transaction content from a known ID. In Hyperledger Fabric, the transaction can be queried using a special system chaincode QSCC (Query System Chaincode) which is for ledger and other Fabric-related queries. For querying transaction by its ID, we can query/invoke the GetTransactionByID function from QSCC.

区块链 网络中查询交易内容是常见场景使用的一种惯例,例如探索区块链历史或从已知ID验证区块链交易内容。 在Hyperledger Fabric中,可以使用特殊的系统链代码QSCC(查询系统链代码)查询交易,该系统链代码用于分类帐和其他与Fabric相关的查询。 为了通过其ID查询事务,我们可以从QSCC查询/调用GetTransactionByID函数

This tutorial assumes you have just finished installing Hyperledger Fabric 2.0 in Ubuntu 18.04 and we introduce the steps using the test-network.

教程假定您刚刚在Ubuntu 18.04中完成Hyperledger Fabric 2.0的安装,并且我们将介绍使用测试网络的步骤。

更改工作目录并设置环境 (Change the working directory and set up the environment)

First change the working directory to the test-network directory from the fabric-samples repository which was pulled by the installation script during installing Hyperledger Fabric 2.0 following the tutorial mentioned above.

首先,按照上述教程,在安装Hyperledger Fabric 2.0的过程中将工作目录从fabric-samples存储库更改为test-network目录,该存储库是由安装脚本提取的。

$ cd $GOPATH/src/github.com/hyperledger/fabric-samples/test-network

Set up the environment variables correctly so that the peer command can work correctly.

正确设置环境变量

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值