Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hyperledger fabcar sample fabric showing connect failed ERROR

Tags:

I am trying to install hyperledger and run chain code. I followed all the steps as directed here. But getting error

error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: Connect Failed

while running the query.js. enter image description hereI have following active docker runningenter image description here Before running the node query.js, when i am running npm install its giving following warning : npm WARN [email protected] No repository field. Is this the problem. Can any one please help me out about where it is going wrong.

like image 661
Subhankar Avatar asked Jul 05 '17 05:07

Subhankar


2 Answers

I have met the same error during run sample, it failed to connect. I fixed it with following steps:

  1. get machine IP address with: ifconfig
  2. replace localhosts in query.js with IP in #1

Example:

@@ -12,7 +12,7 @@ var options = {
     user_id: 'PeerAdmin',
     channel_id: 'mychannel',
     chaincode_id: 'fabcar',
-    network_url: 'grpc://localhost:7051',
+    network_url: 'grpc://****:7051',
};
like image 173
Angela Avatar answered Oct 11 '22 12:10

Angela


Addition to Angela's answer:

To anyone having this issue and using Docker Toolbox, do docker-machine ls and copy the IP adress at the URL column of your ACTIVE machine and paste the IP adress to every localhost in both query.js and invoke.js files.

like image 31
thefrogking Avatar answered Oct 11 '22 13:10

thefrogking