问题chaincode实例化与分布式设置

问题描述 投票:2回答:2

我工作的面料版本1.2。运行一个命令者和一个对等网络,无论是在同一个组织,ORG1MSP。我跟着this的博客,但我想在不同的虚拟机上运行命令者和同行。

Orderer IP: 192.168.1.5
Peer0 IP: 192.168.1.22

订货人和CA容器分别上涨对第一虚拟机和peer0,CouchDB的,CLI在第二VM。 Peer0能够创造渠道,获取通道配置和加盟渠道。

现在,我尝试部署的chaincode织物/例子/ chaincode /可去/ example02路径。我安装在所有容器体积如下:

- /root/gopath/src/github.com/hyperledger/fabric/examples:/opt/gopath/src/github.com/hyperledger/fabric/examples

我要从CLI运行容器的命令。安装命令:CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode install -n example02 -p github.com/hyperledger/fabric/examples/chaincode/go/example02 -v v0

它显示以下日志:

2018-11-13 11:13:34.112 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-11-13 11:13:34.112 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2018-11-13 11:13:34.336 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:<status:200 payload:"OK" >

于是,我尝试实例化chaincode如下:

root@fa36d48915d7:/opt/gopath/src/github.com/hyperledger/fabric# CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode instantiate -o 192.168.1.5:7050 -C mychannel -n example02 -v v0 -c '{"Args":["init","a","100","b","200"]}' -P "OR ('Org1MSP.member','Org2MSP.member')"
2018-11-13 11:21:46.383 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-11-13 11:21:46.383 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: could not assemble transaction, err Proposal response was not successful, error code 500, msg failed to execute transaction 81b57fb4635092074d3585cec328e4c54f8f1d45028664795a56cfbc7f5a4c80: error starting container: error starting container: API error (400): OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"chaincode\": executable file not found in $PATH": unknown

请提供相应的解决方案。

hyperledger-fabric hyperledger-fabric-ca
2个回答
3
投票

我有一个类似的问题。我发现,如果包的名称不是主要的,在这种情况下,产生这个错误。

检查example02.go文件,第一行是软件包的名称。替换包名主,如果是别的东西,然后尝试重新安装。

安装和使用-v V1启动

CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode install -n example02 -p github.com/hyperledger/fabric/examples/chaincode/go/example02 -v v1

CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode instantiate -o 192.168.1.5:7050 -C mychannel -n example02 -v v1 -c '{"Args":["init","a","100","b","200"]}' -P "OR ('Org1MSP.member','Org2MSP.member')"


2
投票

最近面临这个问题,花了很多时间在Google上搜寻。余由CC_SRC_PATH路径变量设置为其中chaincode被安装在码头工人容器中的目录,然后引用它在安装和实例chaincode固定它。参考链接:

  1. https://jira.hyperledger.org/browse/FAB-10019
  2. https://www.edureka.co/community/23994/how-to-define-the-path-to-hyperledger-fabric-chaincode

看起来这可能是由于多种原因按有关人们如何得到这个固定的多个论坛的讨论。这里是一个快速参考,所有这些链接的列表:

  1. OCI runtime error when sending Hyperledger Fabric's chaincode instantiation request to peers
  2. https://github.com/davidkhala/fabric-common#notes
  3. https://github.com/cloudhuang/fabric-vagrant-env#troubleshooting
© www.soinside.com 2019 - 2024. All rights reserved.