Rajesh Subhankar
Rajesh Subhankar

Reputation: 23

ERRO : Error trying to connect to local peer: grpc: timed out trying to connect

Unable to deploy chaincode example in my local hyperledger fabric.

system config: mac osx, Docker toolbox for mac

One validating peer is up and running using docker-compose.yaml

membersrvc:
  image: hyperledger/fabric-membersrvc
  command: membersrvc
vp0:
  image: hyperledger/fabric-peer
  environment:
    - CORE_PEER_ADDRESSAUTODETECT=false
    - CORE_VM_ENDPOINT=http://172.17.0.1:2375
    - CORE_LOGGING_LEVEL=DEBUG
    - CORE_PEER_ID=vp0
    - CORE_SECURITY_ENROLLID=test_vp0
    - CORE_SECURITY_ENROLLSECRET=MwYpmSRjupbT
  links:
    - membersrvc
  command: sh -c "sleep 5; peer node start --peer-chaincodedev"

While deploying chaincode by running

CORE_CHAINCODE_ID_NAME=mycc CORE_PEER_ADDRESS=0.0.0.0:30303 ./test

Its showing the error as [shim] ERRO : Error trying to connect to local peer: grpc: timed out trying to connect

I tried replacing CORE_PEER_ADDRESS as suggested by grep timeout solution but no change in error.

First Validating peer output

Chaincode deployment error window

Upvotes: 1

Views: 2543

Answers (1)

Sufiyan Ghori
Sufiyan Ghori

Reputation: 18753

You need to use the correct port number on which peer process is listening to.

instead of using the following command,

CORE_CHAINCODE_ID_NAME=mycc CORE_PEER_ADDRESS=0.0.0.0:30303 ./test

try this instead,

CORE_CHAINCODE_ID_NAME=mycc CORE_PEER_ADDRESS=0.0.0.0:7052 ./test

if it doesn't work then run the following command to check your listening port and use that instead,

netstat -atp tcp | grep -i "listen"

Upvotes: 0

Related Questions