“Error: could not find chaincode” occurs when execute composer runtime install

“Error: could not find chaincode” occurs when execute composer runtime install

我们正在考虑从 Hyperledger Composer v0.13.0 迁移到最新版本 (v0.16.5),因此我尝试根据下面的教程创建和部署业务网络。 https://hyperledger.github.io/composer/latest/tutorials/developer-tutorial
但是在第 4 步,composer runtime install 命令不起作用。

这是发生的错误。

✖ Installing runtime for business network <<MY_BUSINESS_NETWORK>>. This may take a minute...
Error: Error trying to ping. Error: Error trying to query business network. Error: could not find chaincode with name '<<MY_BUSINESS_NETWORK>>' - make sure the chaincode <<MY_BUSINESS_NETWORK>> has been successfully instantiated and try again
Command failed

但我不确定应该在哪里进行实例化。 我猜 composer runtime installcomposer network start 是 v0.13.0 中 composer network deploy 的对应物,但这是错误的吗?在 v0.13.0 中,我不需要显式执行 "instantiate" 命令。

如有任何建议或信息,我将不胜感激。

我的程序

 1. prepare credentials,channenl-artifacts and connection profile then start dockers.
 2. create channel and make peers joined.
 3. create BNA & card Files.
 4. import the card of PeerAdmin then confirm with composer card list command.
 5. execute composer install runtime command.

环境

Ubuntu : 16.04
hyperledger composer : 0.16.5
ibmblockchain/fabric-tools     1.0.5   
ibmblockchain/fabric-ca        1.0.5
ibmblockchain/fabric-peer      1.0.5
ibmblockchain/fabric-orderer   1.0.5
ibmblockchain/fabric-couchdb   1.0.5

运行时间安装和网络启动(正如您正确理解的那样)是两个独立的任务,可能由对等管理员和网络管理员(两个独立的角色)执行,因此它们是突围 - 职责分界。过去不推荐使用网络部署。

关于教程 - 我建议从 fabric-tools 目录执行 'teardown' 并清除 $HOME/.composer 卡片目录。我假设你重新下载了一个新的 fabric 工具?您是否还确保根据文档 https://hyperledger.github.io/composer/latest/installing/installing-prereqs.html

更新您的 pre-requisites if/as

您发布的与 << MY_BUSINESS NETWORK >> 相关的错误我假设是因为您混淆了真实的网络名称 - 可以理解)否则是一个不寻常的错误,而不是教程中给出的名称- 如果您按照教程进行操作,它应该按如下方式部署(即从教程中剪切和粘贴):

运行安装时间:

composer runtime install --card PeerAdmin@hlfv1 --businessNetworkName tutorial-network

网络开始:

composer network start --card PeerAdmin@hlfv1 --networkAdmin admin --networkAdminEnrollSecret adminpw --archiveFile tutorial-network@0.0.1.bna --file networkadmin.card

https://hyperledger.github.io/composer/latest/tutorials/developer-tutorial.html 多年来一直运行良好。

您是否正在尝试在同一虚拟主机或不同的 physical/virtual 机器上构建自己的 Fabric 网络 single-org 或 multi-org?因为 Composer 提供的 Fabric Dev 服务器设置会为您完成 1 和 2。您还可以按照我们的文档(运行 脚本)中的说明为此创建 PeerAdmin 卡。

根据你的程序我先补充一下:

  1. 拆解并移除旧卡(如上所述)
  2. 执行第 1 步和第 2 步(然后创建 Fabric 网络,如果这是您想要做的)

在您的 [custom] Fabric 启动并 运行ning 之后: 第 3 步。使用 Fabric marbles 示例链代码测试您的自定义 Fabric 网络以验证配置。如果可行,请继续构建您自己的 PeerAdmin 卡 步骤 4. 首先在所有对等点上安装 Composer 运行time 部署业务网络,然后在您配置的通道上启动 bna 网络 步骤 5. 创建 Composer BN 卡、连接配置文件、身份和参与者等