Hyperledger Fabric v1.0 sample app fails to connect [Possible FIX]

Puneet Verma
Jul 29, 2017 · 2 min read

Getting started sample app from hyperledger fabric doesn't connect to the docker containers from client side.

Some find this a bug while connecting to the container by following command

node query.js

Unexpected output:

fails to connect

Possible Fix:

First we have to find the ip address and port to access the container
1. Go to Kitematic app to view your running docker containers.

2. Check the screenshot below, you’ll find the IP & PORT to access the containers.

Copy the access url and replace with the one present in the network url property of options object in query.js file of hyperledger fabric sample application.

var options = {

wallet_path: path.join(__dirname, ‘./creds’),

user_id: ‘PeerAdmin’,

channel_id: ‘mychannel’,

chaincode_id: ‘fabcar’,

network_url: ‘grpc://0.0.0.0:7051’,

};

to

network_url: ‘grpc://[ACCESS URL ]:7051’,

Expected output:

connection established

PS: I’m using fabcar sample application of hyperledger fabric v1.0 and found this error while Querying the Ledger.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade