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>
We will need ‘Composer Rest Server’ in order to expose our business network as RESTful APIs.
npm i -g composer-rest-server</span>
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>
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>
Create a folder called ‘fabric-dev-servers’ and navigate to the folder.
mkdir ~/fabric-dev-servers cd ~/fabric-dev-servers</span>
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>
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>
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.
That’s 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 don’t 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 don’t have the right to perform or run docker commands, use ‘sudo’ and execute it.