0

I am trying to demonstrate the usage of Private Data in Hyperlderger Fabric as part of a PoC. I have been following the steps given in: https://hyperledger-fabric.readthedocs.io/en/release-1.4/private_data_tutorial.html

I have been able to start the byfn.sh network and I am now trying to instantiate the chaincode on each and every peer which is a part of the network.

I have first switched to peer 0 of organisation 1 to instantiate the code in it:
export CORE_PEER_ADDRESS=peer0.org1.example.com:7051
peer chaincode install -n marblesp -v 1.0 -p github.com/chaincode/marbles02_private/go/

I get the desired output saying: install -> INFO 003 Installed remotely response:<status:200 payload:"OK" >

When I switch to the peer 1 of organisation 1 and try the same steps, I am getting an error: export CORE_PEER_ADDRESS=peer1.org1.example.com:8051 . peer chaincode install -n marblesp -v 1.0 -p github.com/chaincode/marbles02_private/go/

The error is: Error: error getting endorser client for install: endorser client failed to connect to peer1.org1.example.com:8051: failed to create new connection: context deadline exceeded

Please help me resolve the issue.

This is for a Mac system. The docker is up and running.

Akhil Kintali
  • 496
  • 2
  • 11
  • 27
  • I dont really understand the error. And you are exactly following the steps provided in the tutorial? Can you clear the network (remove containers and old images), start it over again and try again? Refering to [here](https://blog.chapagain.com.np/hyperledger-fabric-error-error-getting-endorser-client-for-channel-endorser-client-failed-to-connect-to-peer0-org1-example-com7051-failed-to-create-new-connection-context-deadline-exceeded/) – kajuken Apr 11 '19 at 11:17
  • The second command you are hitting `peer1.org1.example.com:8051` . but the error you are showing has `peer0.org2.example.com:9051` - maybe you pasted something wrong in your post? You are setting CORE_PEER_ADDRESS before the install, I think you should also set CORE_PEER_LOCALMSPID and CORE_PEER_MSPCONFIGPATH – R Thatcher Apr 11 '19 at 11:36
  • @RThatcher that's what i thought in the beginning as well. But look at the code he is not switching to org2 in the 2nd export he stays with org1 and switches only the peer. So that should be ok but i dont understand the error then. – kajuken Apr 11 '19 at 12:19
  • @RThatcher: I'm sorry, I pasted the wrong error. I have corrected it now. I have set both CORE_PEER_LOCALMSPID and CORE_PEER_MSPCONFIGPATH. I'm still getting the same error. – Akhil Kintali Apr 11 '19 at 13:13
  • @kajuken: I have edited to paste the correct error. I am following the steps exactly as given in the tutorial. I have also cleared the network and started it again as you've suggested, but it is not helping me. – Akhil Kintali Apr 11 '19 at 13:15
  • @AkhilKintali it's a port issue? Change to export CORE_PEER_ADDRESS=peer1.org1.example.com:7051 and try again – kajuken Apr 11 '19 at 13:20
  • check if the peer1 is up and running using docker ps command. – efex09 Apr 11 '19 at 14:03
  • can you add the docker-compose.yaml in question? – efex09 Apr 11 '19 at 14:05
  • you could try `docker network list` and `docker inspect ` to check that the containers are all on the network you expect. – R Thatcher Apr 11 '19 at 16:22
  • @RThatcher I inspected the containers on the network as you suggested. Turns out that only peer0.org1 was there on the network. So I downloaded everything from the start in another directory. This time it worked. Thanks for the help! – Akhil Kintali Apr 12 '19 at 04:36

0 Answers0