I am working on Fabric version 1.2. Running a network with one orderer and one peer, both in same organisation, ORG1MSP. I followed this blog, but I am trying to run orderer and peer on different VMs.
Orderer IP: 192.168.1.5
Peer0 IP: 192.168.1.22
Orderer and CA containers were up on the first VM, and peer0, couchdb, cli on second VM. Peer0 was able to create channel, fetch channel configurations and join channel.
Now, I am trying to deploy the chaincode available in fabric/examples/chaincode/go/example02 path. I mounted the volume in all the containers as follows:
- /root/gopath/src/github.com/hyperledger/fabric/examples:/opt/gopath/src/github.com/hyperledger/fabric/examples
I run the commands from the CLI container. Install command:
CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode install -n example02 -p github.com/hyperledger/fabric/examples/chaincode/go/example02 -v v0
It shows the following log:
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" >
Then, I try to instantiate the chaincode as follows:
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
Please provide the appropriate solution.