Hyperledger-fabric chaincode deploy connection error addrConn resetTransport failed to create client

0 votes

docker-compose.yml :

membersrvc:
  image: hyperledger/fabric-membersrvc
  command: membersrvc

vp0:
  image: hyperledger/fabric-peer
  environment:
    - CORE_PER_ID=vp0
    - CORE_PEER_ADDRESSAUTODETECT=true
    - CORE_VM_ENDPOINT=http://0.0.0.0:2375
    - CORE_LOGGING_LEVEL=DEBUG
  command: sh -c "sleep 5; peer node start --peer-chaincodedev"

vp1:
  extends:
    service: vp0
  environment:
    - CORE_PEER_ID=vp1
    - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051
  links:
    - vp0

vp2:
  extends:
    service: vp0
  environment:
    - CORE_PEER_ID=vp2
    - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051
  links:
    - vp0

and I run (I refered to Fabric chaincode setup page):

Terminal 1 :

$ docker-compose up

Terminal 2 :

$ cd /hyperledger/examples/chaincode/go/chaincode_example02

$ CORE_CHAINCODE_ID_NAME=mycc CORE_PEER_ADDRESS=0.0.0.0:7051 ./chaincode_example02

Terminal 3 :

$ peer chaincode deploy -n mycc -c '{"Args": ["init", "a","100", "b", "200"]}'

Only terminal 3 shows connection error.

2016/10/21 04:39:15 grpc: addrConn.resetTransport failed to create client
transport: connection error: desc = "transport: dial tcp 0.0.0.0:7051:
getsockopt: connection refused"; Reconnecting to {"0.0.0.0:7051" <nil>}
Error: Error building chaincode: Error trying to connect to local peer: 
grpc: timed out when dialing

Please help

Nov 2, 2018 in Blockchain by slayer
• 29,370 points
• 4,001 views

2 answers to this question.

0 votes

By default, the peer process is listening on port 7051 but peer process in terminal 3 is using a different port. Mention the port:

membersrvc:
  image: hyperledger/fabric-membersrvc
  ports:
    - "7054:7054"
  command: membersrvc

vp0:
  image: hyperledger/fabric-peer
  ports:
    - "7050:7050"
    - "7051:7051"
    - "7053:7053"
  environment:
    - CORE_PER_ID=vp0
    - CORE_PEER_ADDRESSAUTODETECT=true
    - CORE_VM_ENDPOINT=http://0.0.0.0:2375
    - CORE_LOGGING_LEVEL=DEBUG
  command: sh -c "sleep 5; peer node start --peer-chaincodedev"

And then run 

peer chaincode deploy -n mycc -c '{"Args": ["init", "a","100", "b", "200"]}'

in terminal 3, it should work

answered Nov 2, 2018 by Omkar
• 69,180 points
0 votes
I have your problem too,  PLEASE HELP US
answered Feb 28, 2019 by Hyperledger hater
Did you check the port number as mentioned in the previous answer?

Related Questions In Blockchain

+2 votes
3 answers
+2 votes
3 answers

Hyperledger Fabric: Peer Connection error: Failed obtaining connection: Could not connect to any of the endpoints.

 You can extend your /etc/hosts file and make orderer.example.com domain name ...READ MORE

answered Nov 13, 2018 in Blockchain by Omkar
• 69,180 points
• 6,002 views
+1 vote
1 answer

Error: failed to create deliver client for orderer: orderer client failed to connect to orderer.example.com:7050: failed to create new connection: context deadline exceeded

It is caused because of firewall restriction, ...READ MORE

answered Nov 2, 2022 in Blockchain by Prudhvi Krishna Menavalli

edited Mar 5, 2025 • 5,877 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
• 4,404 views
0 votes
1 answer

Invalid Batch or signature in Savtooth

This will solve your problem import org.apache.commons.codec.binary.Hex; Transaction txn ...READ MORE

answered Aug 1, 2018 in Blockchain by digger
• 26,740 points
• 3,145 views
+1 vote
1 answer
+4 votes
2 answers

Hyperledger Fabric issue: orderer client failed to connect to orderer.xxx.net:7050: failed to create new connection

Hey @gujiwork, Try making the following changes: docker-compose-base.yaml and ...READ MORE

answered Nov 5, 2018 in Blockchain by Omkar
• 69,180 points
• 27,010 views
+2 votes
4 answers

"failed to create new connection context deadline exceeded." error in Hyperledger Fabric

Try remove previous docker containers(have mentioned the ...READ MORE

answered Apr 24, 2019 in Blockchain by Kiran
• 16,734 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP