I am using Docker Toolbox on Windows to run Hyperledger Fabric v0.6. Peer and CA has started successfully. When I run the following command :
CORE_CHAINCODE_ID_NAME=mycc CORE_PEER_ADDRESS=0.0.0.0:7051 ./chaincode_example02.
End up with the error :
"Error trying to connect to local peer : grpc : timed out when dialing"
I changed 0.0.0.0:7051
to the internal IP of the dockerfile_vp0_1, 172.17.0.3 :7051
but I end up with the same error.
I am following the instructions from https://github.com/hyperledger/fabric/blob/v0.6.1-preview/docs/Setup/Chaincode-setup.md and also I am behind a corporate firewall.
Can you please help.
I understand that CORE_PEER_ADDRESS is the IP address of the peer, then what is CORE_VM_ENDPOINT?
The location where the
CORE_CHAINCODE_ID_NAME=mycc CORE_PEER_ADDRESS=0.0.0.0:7051 ./chaincode_example02
command is run appears to be the key factor.I can replicate the same results that were experienced by running docker-compose up, obtaining the chaincode_example02 code on the Windows host, building the chaincode on Windows, and then opening a new Docker Quickstart window. I changed directory to the $GOPATH/src/github.com/chaincode_example02 directory and then ran the above command. The results match the results noted in the question.
Running the command from within the Docker container for the peer image should produce different results.
docker-compose up
based on the docker-compose.yml file, open another Docker Quickstart window.docker exec -it <substitute container name>_vp0_1 bash
. To find the container name, you can first rundocker ps
.netstat -an
command can be used to check that port 7051 is in listening state.peer node start --peer-chaincodedev
command has run. This should have happened as a result of the docker-compose.yml file since it is the last statement in that file.go build
.CORE_CHAINCODE_ID_NAME=mycc CORE_PEER_ADDRESS:0.0.0.0.7051 ./chaincode_example02
command