How To Install Hyperledger Fabric v2.4 on Ubuntu 20.04

deadwin19

Mrityunjaya Prajapati

Posted on June 19, 2022

How To Install Hyperledger Fabric v2.4 on Ubuntu 20.04

Hyperledger Fabric is one of the leading enterprise grade blockchain platforms. In this article we will cover Prerequisites and Hyperledger Fabric v2.4 installation on Linux Ubuntu 20.04 LTS.

Step 1: Install curl, git

Install the latest version of git and curl if it is not already installed.

sudo apt update
sudo apt-get install git
sudo apt-get install curl

Step 2: Install Docker

Install the latest version of Docker if it is not already installed.

sudo apt-get -y install docker-compose

Once installed, confirm that the latest versions of both Docker and Docker Compose executables were installed.

docker --version
Docker version 20.10.12, build 20.10.12-0ubuntu2~20.04.1

docker-compose --version
docker-compose version 1.25.0, build

Make sure the Docker daemon is running.

sudo systemctl start docker

Optional: If you want the Docker daemon to start when the system starts, use the following:

sudo systemctl enable docker

Add your user to the Docker group.

sudo usermod -a -G docker <username>

Step 3: Install Golang

curl -O https://dl.google.com/go/go1.18.3.linux-amd64.tar.gz
tar xvf go1.18.3.linux-amd64.tar.gz
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin

Now, you have to open and edit you **bashrc **file. In most cases, the bashrc is a hidden file that lives in your home directory.

nano ~/.bashrc

Add following two lines, at the end of the file:

export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin

Create new directory where you will install Hyperledger Fabric

mkdir fabric-network

Step 4: Install Hyperledger Fabric

To download a specific release, pass a version identifier for Fabric and Fabric CA Docker images. The command below demonstrates how to download the latest production releases - Fabric v2.4.4 and Fabric CA v1.5.3

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

curl -sSL https://bit.ly/2ysbOFE | bash -s -- 2.4.4 1.5.3

Download the latest release of Fabric samples, docker images, and binaries.

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

Congrats, you have installed Hyperledger Fabric with all dependencies.

To test the our installation, we will run test network that comes with fabric-samples

cd fabric-samples/test-network
./network.sh up createChannel -ca -c mychannel -s couchdb

The above command will create a channel(mychannel) with certificate Authorities and bring up couch-db as state database.

Using following Docker command we can check all running containers

docker ps -a

You should be able to see the containers up and running.

Hyperledger Fabric Test Network Containers

Congratulations, you have installed and setup Hyperledger Fabric.

If this tutorial helps you, please hit the Clap button or comment if you have any suggestion or feedback.

💖 💪 🙅 🚩
deadwin19
Mrityunjaya Prajapati

Posted on June 19, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related