gpt4 book ai didi

hyperledger-fabric - "channel [{channel-name}]: MSP error: channel doesn' t exist”警告无法在 Hyperledger Fabric 上实例化链代码

转载 作者:行者123 更新时间:2023-12-04 07:54:09 29 4
gpt4 key购买 nike

我正在尝试运行 Hyperledger Fabric 网络,它由单个订购者、单个对等节点和一个 cli 组成。为了学习启动 Hyperledger Fabric 网络的过程,从创建与加密相关的工件到将 cli 作为 docker 容器运行,我一一执行。

一切正常,但是当我尝试实例化已安装的链代码时,对等方生成 channel [reputationch]: MSP error: channel doesn't exist (reputationch is我的 channel 名称)并且实例化失败。

(查看下面的截图) enter image description here

我不确定对等节点上的这个警告会导致链码实例化失败,但我想这是原因。

我的 crypto-config.yamlconfigtx.yaml 如下所示。它们没什么特别的,因为我只是根据官方示例修改了一些名称。

crytp-config.yaml and configtx.yaml

基于上述yaml文件创建加密相关工件的脚本是:

script to create crypto-related artifacts

我启动排序器、节点和 cli 的运行脚本如下所示。它调用 docker 命令。

running scripts to launch an orderer, a peer, and a cli

启动 cli 后,我使用 docker exec -it cli bash 连接 cli。然后,我运行三个命令,它们运行良好,没有错误或警告:

peer channel create -o orderer.operator.com:7050 -c reputationch -f ./channel-artifacts/reputation-channel.tx
peer channel update -o orderer.operator.com:7050 -c reputationch -f ./channel-artifacts/Company1anchors.tx
peer chaincode install -n mycc -v 1.0 -p github.com/hyperledger/fabric/examples/chaincode/go/

那么,下面的命令就失败了。

peer chaincode instantiate -o orderer.operator.com:7050 -C reputationch -n mycc -v 1.0 -c '{"Args":["init","a", "100", "b","200"]}' -P "OR ('Company1MSP.peer')"

我的版本信息是:

  • macOS:macOS High Sierra 10.13.3
  • 进行:1.10
  • Docker:版本 18.03.0-ce-mac59 (23608)
  • super 账本结构:1.1
    • 密码原:1.1.0
    • configtxgen: 1.1.0

任何类型的评论或帮助对我来说都是非常好的。谢谢。

最佳答案

基本上您还需要您的同行加入您的 channel 。看起来你不在这里做。如果您的同伴没有加入任何 channel ,您将收到此错误。在安装链代码之前,请确保您的同行加入 channel 。peer channel join -b $CHANNEL_NAME.block

关于hyperledger-fabric - "channel [{channel-name}]: MSP error: channel doesn' t exist”警告无法在 Hyperledger Fabric 上实例化链代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49567892/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com