Hyperledger fabric Hyperledger fabric 1.4实例化链码时出错

Hyperledger fabric Hyperledger fabric 1.4实例化链码时出错,hyperledger-fabric,hyperledger-chaincode,Hyperledger Fabric,Hyperledger Chaincode,在创建和加入通道后,设置构建的第一个网络(BYFN),使用以下cli命令在两个组织对等方上安装chaincode- peer chaincode install -n mycc -v 1.0 -p github.com/chaincode/chaincode_example02/go/ 链码安装成功 当我尝试使用以下命令从CLI实例化chaincode时 在Hyperledger fabric v 1.4中实例化链码时发生以下错误 root@8804d95b7083:/opt/gopath/s

在创建和加入通道后,设置构建的第一个网络(BYFN),使用以下cli命令在两个组织对等方上安装chaincode-

peer chaincode install -n mycc -v 1.0 -p github.com/chaincode/chaincode_example02/go/
链码安装成功

当我尝试使用以下命令从CLI实例化chaincode时

在Hyperledger fabric v 1.4中实例化链码时发生以下错误

root@8804d95b7083:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode instantiate -o orderer.example.com:7050 --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C $CHANNEL_NAME -n mycc -v 1.0 -c '{"Args":["init","a", "100", "b","200"]}' -P "AND ('Org1MSP.peer','Org2MSP.peer')"
Error: must supply value for chaincode name parameter
Usage:
  peer chaincode instantiate [flags]

Flags:
  -C, --channelID string               The channel on which this command should be executed
      --collections-config string      The fully qualified path to the collection JSON file including the file name

除了重新设置网络之外,还有其他方法解决此错误吗?

与CLI命令存在冲突。您使用go cli命令安装链码,使用NodeJS cli命令实例化链码。

同样的错误也发生在go中。我又编辑了这个问题。请看。命令现在看起来很好。它不应该像以前那样出现同样的错误。您已经在那里传递了名为parameter的chaincode,其中包含-n mycc和其他以前没有的参数。可能是在CLI上执行命令时写得不正确?否则,我看不到您的命令有任何问题。我通过在环境变量中设置#CHANNEL_NAME解决了这个问题。因此,在Hyperledger结构网络设置中运行对等commad之前,必须检查所需的环境变量。