我正在研究 Fabric 1.2 版。在同一个组织 ORG1MSP 中运行一个包含一个 orderer 和一个 peer 的网络。我关注了这个博客,但我试图在不同的虚拟机上运行排序器和对等点。
Orderer IP: 192.168.1.5
Peer0 IP: 192.168.1.22
Orderer 和 CA 容器在第一个 VM 上运行,peer0、couchdb、cli 在第二个 VM 上运行。Peer0 能够创建频道、获取频道配置和加入频道。
现在,我正在尝试部署 fabric/examples/chaincode/go/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" >
然后,我尝试按如下方式实例化链码:
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
请提供适当的解决方案。