DEV Community

Sainath Ramanathan
Sainath Ramanathan

Posted on • Originally published at sainath.tech on

Hyperledger Fabric (v1.1) Setup on Ubuntu 18.04 — Part III

In the previous section Part - I we saw about the necessary pre-requisites for running the Hyperledger Fabric and in this final section, we will finally install the essential command-line tools to run the fabric development environment.

Install Composer-CLI using npm which is the essential aspect of fabric development using composer.

npm i -g composer-cli</span>

Enter fullscreen mode Exit fullscreen mode

We will need Composer Rest Server in order to expose our business network as RESTful APIs.

npm i -g composer-rest-server</span>

Enter fullscreen mode Exit fullscreen mode

In the previous post, you would have seen about Yeoman which is a scaffolding tool that we will be using here in order to pack the application assets related to fabric.

npm i -g generator-hyperledger-composer</span>

Enter fullscreen mode Exit fullscreen mode

There is an online app called Playground for developing business network applications using hyperledger fabric. If you would like to have a local copy of it just install the package and use it from your local machine.

npm i -g composer-playground</span>

Enter fullscreen mode Exit fullscreen mode

Create a folder called fabric-dev-servers and navigate to the folder.

mkdir ~/fabric-dev-servers cd ~/fabric-dev-servers</span>

Enter fullscreen mode Exit fullscreen mode

Using CURL command fetch fabric-dev-servers tar file and unpack it using tar -xvf by passing the file to it.

curl -O https://raw.githubusercontent.com/hyperledger/composer-tools/master/packages/fabric-dev-servers/fabric-dev-servers.tar.gz tar -xvf fabric-dev-servers.tar.gz</span>

Enter fullscreen mode Exit fullscreen mode

Unzipping the folder will give you a list of files out of which you have to run downloadFabric.sh and prior to this kindly set the environment for the desired fabric version as mentioned in the code below.

cd ~/fabric-dev-servers export FABRIC_VERSION=hlfv12 ./downloadFabric.sh</span>

Enter fullscreen mode Exit fullscreen mode

The downloadFabric.sh would install a list of docker images required for running the fabric. You can check the list of images using the command docker images. Ensure that you have all the images in the list as mentioned below in the screenshot.

Thats it and you are done. Before finishing there are few things to be noted. If you are using Ubuntu as a cloud instance or connecting a remote Ubuntu server, ensure that you dont do the fabric installation as a root user. Kindly create a new user and change your profile to that new user that you have created. At times if you dont have the right to perform or run docker commands, use sudo and execute it.

Top comments (0)