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

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://’,


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.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.