关于Hyperledger Fabric Python SDK的问题

问题描述

运行 Hyperledger Fabric Python SDK 中提供的 Jupyter Notebook教程文件时,我遇到一个问题。当我尝试运行可以安装示例链码的代码时,会发生错误,该链码可以在test/fixtures/chaincode的{​​{1}}上的peers上找到。

显示错误:未定义循环。但是,当我在org1之前添加代码时。它还显示错误:RuntimeError:此事件循环已在运行。

我该如何解决这个问题?

解决方法

您所指的python sdk教程看起来像是:https://github.com/hyperledger/fabric-sdk-py/blob/master/Tutorial.ipynb

此参考合同为:https://github.com/hyperledger/fabric-sdk-py/blob/master/test/fixtures/chaincode/src/github.com/example_cc/example_cc.go

第一个循环是这个循环:

运行以下代码片段以安装示例链码,该链码可在org1的对等方的test / fixtures / chaincode中找到。

In [ ]:
# This installs the example chaincode on the peers
# Make the client know there is a channel in the network
cli.new_channel('businesschannel')

#The GOPTAH settings is required for only running the example chaincode in the SDK
import os
gopath_bak = os.environ.get('GOPATH','')
gopath = os.path.normpath(os.path.join(
                      os.path.dirname(os.path.realpath('__file__')),'test/fixtures/chaincode'
                     ))

# The response should be true if succeed
responses = loop.run_until_complete(cli.chaincode_install(         <<<<<<<<< Here
               requestor=org1_admin,peers=['peer0.org1.example.com','peer1.org1.example.com'],cc_path='github.com/example_cc',cc_name='example_cc',cc_version='v1.0'
               ))

如果您可以通过评论回复确认其中的某些内容,或者将其包含在上方的帖子中,则可能会帮助您找到答案。我已经阅读了问题,并尝试搜索您所指的信息……而没有您正在谈论的明确示例,那么您将很难获得答复。