Deploying a Multi-Node Hyperledger Fabric Network in 5 Steps
As blockchain networks become more sophisticated and heterogeneous, you will probably need more than one node in your deployment. At a Hyperledger meetup in Amsterdam, Vitaliy Chernov of Altoros provided attendees with a 5-step process for deploying a multi-node Hyperledger Fabric network. Vitaliy’s presentation involved an Orderer and three organizations, featuring a demonstration on invoking transactions.
Before getting started on deployment, anyone following Vitaliy’s guide will need four work stations or cloud instances with:
- Linux Ubuntu 16.04 (or Cent OS 7)
- Docker-CE (v17.12.1-ce) and Docker-Compose (v1.8.0)
In his presentation, Vitaliy set up his environment on Amazon Web Services (AWS). In case updates are needed, the following console commands can be run:
$ sudo apt-get update && sudo apt-get -y install docker-compose git jq $ sudo usermod -aG docker $USER $ exit
Once the prerequisites are met, simply follow the process step by step.
Step 1: Get Fabric Starter
First, get Fabric Starter from GitHub.
$ git clone https://github.com/Altoros/fabric-starter.git $ cd fabric-starter
This tool—created by Altoros—will help you to get started with Hyperledger Fabric.
Step 2: Network configuration—mapping nodes
Map the domain names of the nodes to real IP addresses.
$ export IP_ORDERER=184.108.40.206 IP1=220.127.116.11 IP2=18.104.22.168 IP3=22.214.171.124
Once a node is mapped, it becomes publicly accessible.
Step 3: Generating certificates
Generate the certificates of the organizations on their nodes. Enter the following line on organization A’s host:
$ ./network.sh -m generate-peer –o a
Enter this line on organization B’s host:
$ ./network.sh -m generate-peer –o b
And this line on organization C’s host:
$ ./network.sh -m generate-peer –o c
Once a certificate is generated, it can be viewed using the following console command:
$ ls -lha
Step 4: Generating the Orderer
Use this code to generate the Orderer:
$ ./network.sh -m generate-orderer
Start the Orderer:
Step 5: Connecting orgs and peers
Finally, connect the organizations to their peers. Run the following line on organization A’s host:
$ ./network.sh -m up-1
This line is for organization B’s host:
$ ./network.sh -m up-2
And this line for organization C’s host:
$ ./network.sh -m up-3
Launch the Fabric API
Once the five steps are accomplished, the Hyperledger Fabric network is now ready to be tested and used. Each organization’s node can be accessed by entering its IP address on a web browser. The port 4000 should be opened. After that, go to the admin section.
Using this process, one can easily deploy a multi-node blockchain network. More importantly, we hope it helps with providing valuable hands-on experience using blockchain. If you want to learn more about Fabric Starter, download this cheat sheet.
Want details? Watch the video!
- Hyperledger Fabric v1.2: What’s New and the Roadmap for 2018
- Brian Behlendorf of Hyperledger: Do POCs, Billions Are Already on Blockchain