Hyperledger Fabric Network with UI


Check the Git installation:

git  --version
git version 2.7.4


Download and install the latest go

wget https://dl.google.com/go/go1.10.2.linux-amd64.tar.gz
sudo tar -xvf go1.10.2.linux-amd64.tar.gz
sudo mv go /usr/local

Here we’ll set some paths that Go needs. The paths in this step are all given are relative to the location of your Go installation in /usr/local. If you chose a new directory, or left the file in download location, modify the commands to match your new location. Open the ~/.profile:

vim ~/.profile

And add this line at the end of the file:

echo "export PATH=\$PATH:/usr/local/go/bin" >> ~/.profile

Restart the shell and check whether it works

go version
go version go1.10.2 linux/amd64

Setup the GOPATH

mkdir $HOME/work
echo "export GOPATH=\$HOME/work" >> ~/.profile



Install the latest docker-composehttps://github.com/docker/compose/releases

sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Verification of installation

docker-compose -v


curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

After restart the shell

nvm install 8.0.0


node -v
npm -v


git clone https://github.com/IBM-Blockchain/marbles.git --depth 1
cd marbles

Create a locally hosted Hyperledger Fabric Network

Download Fabric Samples

git clone https://github.com/hyperledger/fabric-samples.git
cd fabric-samples
url -sSL https://raw.githubusercontent.com/hyperledger/fabric/release-1.1/scripts/bootstrap-1.1.0-preview.sh -o setup_script.sh
sudo bash setup_script.sh

Be sure to add these binaries to your PATH variable by running the following command.

echo "export PATH=\$PWD/bin:\$PATH" >> ~/.profile

Start your network

Next we need to start up the Fabric. Run the script below to get everything going.

cd ./fabcar
sudo ./startFabric.sh

After a minute or two the command prompt will return. Now run the command sudo docker ps to view your currently running docker containers. You should see something similar to the following:

CONTAINER ID        IMAGE                                                                                                    COMMAND                  CREATED              STATUS              PORTS                                            NAMES
7990b48c29ba        dev-peer0.org1.example.com-fabcar-1.0-5c906e402ed29f20260ae42283216aa75549c571e2e380f3615826365d8269ba   "chaincode -peer.add…"   About a minute ago   Up About a minute                                                    dev-peer0.org1.example.com-fabcar-1.0
7e73a148dc82        hyperledger/fabric-tools                                                                                 "/bin/bash"              About a minute ago   Up About a minute                                                    cli
dff96212a78e        hyperledger/fabric-peer                                                                                  "peer node start"        About a minute ago   Up About a minute>7051/tcp,>7053/tcp   peer0.org1.example.com
698b31dc13a2        hyperledger/fabric-ca                                                                                    "sh -c 'fabric-ca-se…"   About a minute ago   Up About a minute>7054/tcp                           ca.example.com
d43ca794fd78        hyperledger/fabric-orderer                                                                               "orderer"                About a minute ago   Up About a minute>7050/tcp                           orderer.example.com
c3ac8464fae4        hyperledger/fabric-couchdb                                                                               "tini -- /docker-ent…"   About a minute ago   Up About a minute   4369/tcp, 9100/tcp,>5984/tcp       couchdb

Install Dependencies for a Test

Next we are going to install node.js dependencies for the fabcar sample. It’s not critical to do this step, but it is useful to test if the network is working before moving on. Before we run fabcar we need to install its npm dependencies:

sudo npm install