Deploying Multiple Organizations in Hyperledger Fabric Version 2.0 , and Monitoring containers via Cadvisor

Deploying Multiple Organizations in Hyperledger Fabric Version 2.0 , and Monitoring containers via Cadvisor

Deploying Multiple Organizations in Hyperledger Fabric Version 2.0 , and Monitoring containers via Cadvisor

We have seen till now the Hyperledger Architecture, we will go into depth of working in the consequent blogs.This blog helps you get started with Hyperledger Fabric Version 2.0 along with container monitoring via Googles Cadvisor , I will also discuss the differences in Flow as compared to Version 1.0 . Lets get started !!

I have referred the Standard Hyperledger Fabric Documentation , and followed the relevant and optimized steps.

The prerequisites for executing this will be installing :docker ,curl ,wget,npm,Go and Python,I will give give you commands for Ubuntu Systems to install Prerequisites.

Commands to install Docker and Docker-Compose

~$ sudo apt update

~$ sudo apt install docker-compose

Commands to install curl,python and wget

~$ sudo apt install curl python wget

Command to install go and npm

To install the GO Language:

~$ wget https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz

Set the environment variable in the .bashrc file in Home directory

export GOPATH=$HOME/go

export PATH=$PATH:$GOPATH/bin

One done : You just have to source the file : source .bashrc

$ vi .bashrc ###do the necessary changes and edits

$ source .bashrc

Install the npm and nvm by the following commands

1)curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -

2)sudo apt-get install nodejs

3)wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.35.2/install.sh | bash

4)npm install npm@5.6.0 -g

Install Hyperledger Fabric Version 2.0

We will go for a stable release in Hyperledger with components mentioned with versions of (Certificate Authority)

curl -sSL https://bit.ly/2ysbOFE | bash -s — <fabric_version> <fabric-ca_version> <thirdparty_version>

curl -sSL https://bit.ly/2ysbOFE | bash -s -- 2.0.1 1.4.6 0.4.18

Installing Hyperledger Fabric

Downloading the docker images

Once the Download is over you can do “docker ps”

To see the containers running

You can navigate to to the network directory and make the network

Once inside the test network directory

Make the network down by(if running) : “./network.sh down”

You will see all the peers,orderers and nodes coming down if running.

As compared to Fabric 1.0 latest releases they have reduced the complications by making only 1 file for certificate generations and Deployment which is “network.sh”, instead of multiple files like “cryptogen and byfn” in the previous one.

Make it up again: “./network.sh up”

YAML files bringing up container

Containers and Network Coming up

docker ps results

Lets now create one channel and run the chaincode

./network.sh createChannel -c mychannel

Mychannel deployed

Lets run the Fabcar smart contract: “./network.sh deployCC”

Lets run the Fabcar Chain code

Chaincode deployed in Peers

Finally running the “QueryAllCars”

Lets monitor the deployed node via Goolgle’s container monitoring tool Cadvisor.Install it using:

anubhav@anubhav-VirtualBox:~/fabric-samples/test-network$ VERSION=v0.35.0 # use the latest release version from

anubhav@anubhav-VirtualBox:~/fabric-samples/test-network$ sudo docker run — volume=/:/rootfs:ro — volume=/var/run:/var/run:ro — volume=/sys:/sys:ro — volume=/var/lib/docker/:/var/lib/docker:ro — volume=/dev/disk/:/dev/disk:ro — publish=8080:8080 — detach=true — name=cadvisor gcr.io/google-containers/cadvisor:$VERSION

You will see after some time Cadvisor coming up on port 8080 (ss -tln)

ss -tln port

You can open localhost:8080 , to see all the listed containers and Monitor its metrics and usages:

In the next post we will see how to increase the network traffic and test the limits of Hyperledger Fabric, also to monitor the network traffic

For any further Queries or anything related to Blockchain or Devops you can DM me on Linkedin.

https://in.linkedin.com/in/anubhav-chaturvedi-a7465a72

We have seen till now the Hyperledger Architecture, we will go into depth of working in the consequent blogs.This blog helps you get started with Hyperledger Fabric Version 2.0 along with container monitoring via Googles Cadvisor , I will also discuss the differences in Flow as compared to Version 1.0 . Lets get started !!

I have referred the Standard Hyperledger Fabric Documentation , and followed the relevant and optimized steps.

The prerequisites for executing this will be installing :docker ,curl ,wget,npm,Go and Python,I will give give you commands for Ubuntu Systems to install Prerequisites.

Commands to install Docker and Docker-Compose

~$ sudo apt update

~$ sudo apt install docker-compose

Commands to install curl,python and wget

~$ sudo apt install curl python wget

Command to install go and npm

To install the GO Language:

~$ wget https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz

Set the environment variable in the .bashrc file in Home directory

export GOPATH=$HOME/go

export PATH=$PATH:$GOPATH/bin

One done : You just have to source the file : source .bashrc

$ vi .bashrc ###do the necessary changes and edits

$ source .bashrc

Install the npm and nvm by the following commands

1)curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -

2)sudo apt-get install nodejs

3)wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.35.2/install.sh | bash

4)npm install npm@5.6.0 -g

Install Hyperledger Fabric Version 2.0

We will go for a stable release in Hyperledger with components mentioned with versions of (Certificate Authority)

curl -sSL https://bit.ly/2ysbOFE | bash -s — <fabric_version> <fabric-ca_version> <thirdparty_version>

curl -sSL https://bit.ly/2ysbOFE | bash -s -- 2.0.1 1.4.6 0.4.18

Installing Hyperledger Fabric

Downloading the docker images

Once the Download is over you can do “docker ps”

To see the containers running

You can navigate to to the network directory and make the network

Once inside the test network directory

Make the network down by(if running) : “./network.sh down”

You will see all the peers,orderers and nodes coming down if running.

As compared to Fabric 1.0 latest releases they have reduced the complications by making only 1 file for certificate generations and Deployment which is “network.sh”, instead of multiple files like “cryptogen and byfn” in the previous one.

Make it up again: “./network.sh up”

YAML files bringing up container

Containers and Network Coming up

docker ps results

Lets now create one channel and run the chaincode

./network.sh createChannel -c mychannel

Mychannel deployed

Lets run the Fabcar smart contract: “./network.sh deployCC”

Lets run the Fabcar Chain code

Chaincode deployed in Peers

Finally running the “QueryAllCars”

Lets monitor the deployed node via Goolgle’s container monitoring tool Cadvisor.Install it using:

anubhav@anubhav-VirtualBox:~/fabric-samples/test-network$ VERSION=v0.35.0 # use the latest release version from

anubhav@anubhav-VirtualBox:~/fabric-samples/test-network$ sudo docker run — volume=/:/rootfs:ro — volume=/var/run:/var/run:ro — volume=/sys:/sys:ro — volume=/var/lib/docker/:/var/lib/docker:ro — volume=/dev/disk/:/dev/disk:ro — publish=8080:8080 — detach=true — name=cadvisor gcr.io/google-containers/cadvisor:$VERSION

You will see after some time Cadvisor coming up on port 8080 (ss -tln)

ss -tln port

You can open localhost:8080 , to see all the listed containers and Monitor its metrics and usages:

In the next post we will see how to increase the network traffic and test the limits of Hyperledger Fabric, also to monitor the network traffic

For any further Queries or anything related to Blockchain or Devops you can DM me on Linkedin.

https://in.linkedin.com/in/anubhav-chaturvedi-a7465a72

We have seen till now the Hyperledger Architecture, we will go into depth of working in the consequent blogs.This blog helps you get started with Hyperledger Fabric Version 2.0 along with container monitoring via Googles Cadvisor , I will also discuss the differences in Flow as compared to Version 1.0 . Lets get started !!

I have referred the Standard Hyperledger Fabric Documentation , and followed the relevant and optimized steps.

The prerequisites for executing this will be installing :docker ,curl ,wget,npm,Go and Python,I will give give you commands for Ubuntu Systems to install Prerequisites.

Commands to install Docker and Docker-Compose

~$ sudo apt update

~$ sudo apt install docker-compose

Commands to install curl,python and wget

~$ sudo apt install curl python wget

Command to install go and npm

To install the GO Language:

~$ wget https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz

Set the environment variable in the .bashrc file in Home directory

export GOPATH=$HOME/go

export PATH=$PATH:$GOPATH/bin

One done : You just have to source the file : source .bashrc

$ vi .bashrc ###do the necessary changes and edits

$ source .bashrc

Install the npm and nvm by the following commands

1)curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -

2)sudo apt-get install nodejs

3)wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.35.2/install.sh | bash

4)npm install npm@5.6.0 -g

Install Hyperledger Fabric Version 2.0

We will go for a stable release in Hyperledger with components mentioned with versions of (Certificate Authority)

curl -sSL https://bit.ly/2ysbOFE | bash -s — <fabric_version> <fabric-ca_version> <thirdparty_version>

curl -sSL https://bit.ly/2ysbOFE | bash -s -- 2.0.1 1.4.6 0.4.18

Installing Hyperledger Fabric

Downloading the docker images

Once the Download is over you can do “docker ps”

To see the containers running

You can navigate to to the network directory and make the network

Once inside the test network directory

Make the network down by(if running) : “./network.sh down”

You will see all the peers,orderers and nodes coming down if running.

As compared to Fabric 1.0 latest releases they have reduced the complications by making only 1 file for certificate generations and Deployment which is “network.sh”, instead of multiple files like “cryptogen and byfn” in the previous one.

Make it up again: “./network.sh up”

YAML files bringing up container

Containers and Network Coming up

docker ps results

Lets now create one channel and run the chaincode

./network.sh createChannel -c mychannel

Mychannel deployed

Lets run the Fabcar smart contract: “./network.sh deployCC”

Lets run the Fabcar Chain code

Chaincode deployed in Peers

Finally running the “QueryAllCars”

Lets monitor the deployed node via Goolgle’s container monitoring tool Cadvisor.Install it using:

anubhav@anubhav-VirtualBox:~/fabric-samples/test-network$ VERSION=v0.35.0 # use the latest release version from

anubhav@anubhav-VirtualBox:~/fabric-samples/test-network$ sudo docker run — volume=/:/rootfs:ro — volume=/var/run:/var/run:ro — volume=/sys:/sys:ro — volume=/var/lib/docker/:/var/lib/docker:ro — volume=/dev/disk/:/dev/disk:ro — publish=8080:8080 — detach=true — name=cadvisor gcr.io/google-containers/cadvisor:$VERSION

You will see after some time Cadvisor coming up on port 8080 (ss -tln)

ss -tln port

You can open localhost:8080 , to see all the listed containers and Monitor its metrics and usages:

In the next post we will see how to increase the network traffic and test the limits of Hyperledger Fabric, also to monitor the network traffic

For any further Queries or anything related to Blockchain or Devops you can DM me on Linkedin.

https://in.linkedin.com/in/anubhav-chaturvedi-a7465a72