hyperledger-fabric - 关于 Hyperledger Fabric Python SDK 的问题
问题描述
在运行Hyperledger Fabric Python SDK中提供的Jupyter Notebook 教程文件时,我遇到了一个问题。当我尝试运行可以安装示例链代码的代码时发生错误,该示例链代码可以在.test/fixtures/chaincode
peers
org1
它显示错误:未定义循环。但是当我添加之前的代码时loop = asyncio.get_event_loop()
。它还显示错误:RuntimeError:此事件循环已在运行。
我怎么解决这个问题?
解决方案
看起来您所指的python sdk教程是:https ://github.com/hyperledger/fabric-sdk-py/blob/master/Tutorial.ipynb
第一个循环是这个:
运行以下代码片段以安装示例链代码,该示例链代码可以在 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'
))
如果您可以通过评论回复确认其中的一些内容或将其包含在您上面的帖子中,它可能有助于获得答案。我刚刚阅读了这个问题,并尝试搜索您所指的信息……如果没有您所谈论内容的明确示例,您会发现很难得到回应。
推荐阅读
- django - Django - PUT 端点验证器错误“wrapped_view() 缺少 1 个必需的位置参数:'request'”
- php - 尝试使用 PHP 脚本将值从 HTML 表单发送到电子邮件,使用代码时收到错误 405
- laravel - 如何修改关系?
- java - 使用 Blogger API 添加帖子不起作用
- terraform - Terraform - 向 ignore_changes 添加例外
- java - 为什么下面代码中java中的浮点默认值不是0.0f
- ros - 为 gmapping 包订阅新主题时出错
- excel - Excel VBA:复制公式
- grails - Grails No thread-bound request found 错误?
- python - 在 python tkinter 的 GUI 中完成视频后,如何打开另一个 GUI 窗口?