Script to set up Hyperledger Fabric composer multi-organization network !!

Himanshu Chawla
Jul 5, 2018 · 3 min read

This article series consists of two parts:

In part 1: I will provide you a shell script to automate the task of connecting up multi-org network on hyperledger fabric with hyperledger composer.

In part 2 : I will provide you a shell script to deploy and update composer network on a fabric multi organization network.

Prerequisites:- You should be familiar with the basic concepts of Hyperledger composer.You have tried this official tutorial by hyperledger composer to setup a multi org network.

Setting up the multi org network while following the documentation is a good idea, If you are setting it up for first time.But it is more time consuming at the same time.Once you get a good understanding of the concepts ,you should try to automate the process for the next time, for now I’ve already done it for you.

Steps to set up the multi org network for hyperledger fabric composer:-

Ignore Step 1 to 6 if you have already downloaded the fabric samples and are successfully running the first-network sample on your machine.

Step 1:- Clear the existing fabric network

cd ~/fabric-dev-servers

git clone -b issue-6978

cd fabric-samples

curl -sSL | bash -s 1.1.0 1.1.0 0.4.6

cd first-network

./ -m generate

./ -m up -s couchdb -a

If you have read the official hyperledger composer tutorial for connecting the multi org network with composer ,you must be aware that to connect hyper ledger composer admins and participants with hyperledger fabric ,we need to create temporary directories for every organization in our fabric network and configure the connection profile in those directories which is quite time consuming if you plan to start up your network every time.Also we need to customize the connection profiles and paste the crypto certificates of both organizations in the connection profile. Long story short,this script will automate the stuff from step 2 to step 6 of the official hyperledger composer tutorial.

You should Create a connectionProfile.json file in your home directory and paste the following connection profile script in connectionProfile.json file:-

Now save the below script in a file and execute the script to automate the step 2 to step 6 of offical hyperledger composer tutorial.

This script only does automation for two orgs network .But you can enhance it according to your needs.

That’s it,In next part of this tutorial .I will give you another script to automate the process of installing and updating the composer business network on the underlying fabric network. Thanks for reading.Keep Exploring. :)

In case of doubts and suggestions the comments are open. See ya !


Delivering Enterprise-grade blockchain technology to leading companies worldwide.

Himanshu Chawla

Written by

Full stack developer (Ethereum, hyperledger, aws, react js, node js, golang)



Delivering Enterprise-grade blockchain technology to leading companies worldwide.

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