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

in #blockchain7 years ago (edited)

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.

download.jpeg

https://steemit.com/blockchain/@geek4geek/step-by-step-towards-hyperledger-fabric-part-1

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 https://github.com/hyperledger/fabric-samples.git
1.png

Enter into the fabric-samples directory

$ cd fabric-samples
2.png

$ git checkout v1.1.0
3.png

Step 2: Download Platform-specific binaries

$ curl -sSL https://goo.gl/6wtTN5 | 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.
4.png

5.png

6.png

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

Step 4: Setup the Environment

$ cd fabric-samples/first-network

Let’s run the following command to clean up any previous environments
$ ./byfn.sh -m down

It will clean the previous containers and artifacts.
7.png

Now generate the default artifacts:

$ ./byfn.sh -m generate
8.png

9.png

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

$ ./byfn.sh -m up
10.png

11.png

12.png

13.png

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

$ ./eyfn.sh 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.

15.png

16.png

17.png
Crypto-Certs are generated for Org3

18.png
Org 3 joining the earlier created Fabric Network with Org 1 and Org 2 each one having 2 peers.

19.png

20.png
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:

https://steemit.com/blockchain/@geek4geek/know-which-blockchain-or-dlt-platform-works-well-within-your-usecase-comparison-of-different-blockchain

https://steemit.com/blockchain/@geek4geek/coco-framework-a-game-changer-in-blockchain-technology-throughput-of-around-1600-transactions-per-second

Stay tuned for the next part!

Coin Marketplace

STEEM 0.15
TRX 0.17
JST 0.028
BTC 69106.80
ETH 2468.44
USDT 1.00
SBD 2.43