Setting a Hyperledger Fabric 2.2 test-network

This medium article will help you create a hyperledger-fabric 2.2 version network in just ten minutes. We will install hyperledger fabric latest version and try the scripts in test-network. This tutorial is for beginners who want to see how fabric 2.2 network is run step by step.

To do this I’m using ubuntu 16.04 LTS version aws ec2 instance T2-medium free tier VM and it’s a fresh installation and i don’t have anything else installed on my server yet.

Install the Pre-requistes before downloading the hyperledger-fabric 2.2 binaries:

Install curl, docker, docker-compose, nodejs & npm.

install GOlang and set path by doing this :-

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

tar -xvf go1.14.2.linux-amd64.tar.gz

sudo chown -R root:root ./go
sudo mv go /usr/local

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

source ~/.bashrc

sudo systemctl enable docker

sudo usermod -a -G docker <username>

Check If your docker is running properly by running this command.

docker run hello-world

It should give you this response

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

You can check if you have pulled the fabric2.2.0 fabric binaries by typing

docker images

It should show you this.

cd fabric-samples/test-network/

To create the network and setup peers and orderers. Run this command

./network.sh up

create the channel

./network.sh createChannel

deploy the chaincode

./network.sh deployCC

Check now your chaincode containers are up and running by typing

You will see response like this.

 

Your network is up , your peers and orderer containers are up and your chaincode is installed and ready to use.

This article has been published from the source link without modifications to the text. Only the headline has been changed.

Source link