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,170 points
218 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
• 67,660 points
0 votes
I have your problem too,  PLEASE HELP US
answered Feb 28 by Hyperledger hater
Did you check the port number as mentioned in the previous answer?

Related Questions In Blockchain

+1 vote
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
• 67,660 points
989 views
0 votes
1 answer
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,550 points
83 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
• 67,660 points
4,279 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 23 in Blockchain by Kiran
3,462 views