Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in Blockchain by (4.1k points)

I installed the Fabric codebase from the Hyperledger project https://github.com/hyperledger/fabric by following the instructions and was able to run the peer by using the ./peer peer command.

Peer supports finding out other peers running on the network. Right now Fabric supports running Peers on the same machine using Docker and running them - https://github.com/hyperledger/fabric/blob/master/docs/dev-setup/devnet-setup.md

Instead of running on same machine - I setup a Peer on another machine (a Mac Mini) and ran the command ./peer network from one of the machines - it did not discover anything.

My question is how to configure to discover Fabric Peers on the local network?

There is configuration on discovery in the core.yaml file but not clear how to enable it.

1 Answer

0 votes
by (14.4k points)

When the second peer is set up, the correct address of the first peer should be put in the CORE_PEER_DISCOVER_ROOTNODE parameter. 

docker run --rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:4243 -e CORE_PEER_ID=vp1 -e CORE_PEER_ADDRESSAUTODETECT=true -e CORE_PEER_DISCOVERY_ROOTNODE=172.17.0.2:30303 hyperledger-peer peer peer

If the code is being run in different machines, there lies a possibility that you'll have to forward ports. And if you are running the peer inside Vagrant you'll need to forward Vagrant ports too.  

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.1k users

Browse Categories

...