Step by Step Towards Hyperledger Fabric (Adding an Organization with two Peers to an existing channel)— Part 2

Adding an Organization with two Peers to an existing channel

In this article we are going to learn the process to add an Organisation to an existing channel. I will be covering the in-depth process of Part 1 and Part 2 in the next coming articles. If you have not explored the Part 1 yet, i will suggest you to cover that part first before starting this one. I am sharing the Part 1 link below, it will help you to install the prerequisite required by Hyperledger Fabric.

Lets get started with our this step by step tutorial for adding an Org into existing channel.

Note: Install the prerequisite for Hyperledger Fabric by following the Part 1.

Step 1: Clone the Hyperledger Fabric Samples applications repository using the below command:

$ git clone -b master

Enter into the fabric-samples directory

$ cd fabric-samples

$ git checkout v1.1.0

Step 2: Download Platform-specific binaries

$ curl -sSL | bash -s 1.1.0

Note: The above command downloads and execute a bash script that will download and extract all of the platform-specific binaries.

You can see the downloaded the binaries inside the bin sub-directory inside fabric-samples directory as shown above.

Step 3: Add the binaries to your PATH environment variable so that these can be picked up without fully qualifying the path to each binary.

$ export PATH = <path to download location>/bin:$PATH

e.g. In my case $export PATH=/home/ashish/Desktop/fabric-samples/bin:$PATH

Step 4: Setup the Environment

$ cd fabric-samples/first-network

Let’s run the following command to clean up any previous environments

$ ./ -m down

It will clean the previous containers and artifacts.

Now generate the default artifacts:

$ ./ -m generate

Now launch the network making use of scripted execution within the CLI container.

$ ./ -m up

You can use docker ps command to see the created containers running peers for Org1 and Org2.

Step 5: Bring org3 into the channel with the script

$ ./ up

Note: It will create the org3 crypto material and added it, the config update being created and signed, and then chaincode being installed to allow Org3 to execute ledger queries.

Crypto-Certs are generated for Org3
Org 3 joining the earlier created Fabric Network with Org 1 and Org 2 each one having 2 peers.
You can again use the docker ps command to see new container with Org 3 peers have been generated within the previous running configuration.

Congrats you have successfully added Org 3 having 2 peers with an existing and running Hyperledger Fabric network of Org 1 and Org 2. In the next part i will be covering technical details of Part 1 and Part 2.

I hope you are also interested in these two articles related to blockchain:

If you have interest in blockchain technology than you will surely love to explore these articles too: