Friday, May 19, 2017

how to build hyperledger fabric on Ubuntu

Here is the process to setup environment on ubuntu 16.04 to build Hyperledger fabric:

Highlight of the process
  • Install tools and dependencies such as git, pip, docker-composer, dev libraries etc.
  • Go - 1.7 or later (for releases before v1.0, 1.6 or later)
  • Docker - 1.12 or later
  • Docker Compose - 1.8.1 or later
  • Setup environment and extract hyperledger fabric code
  • Run the build
1.Install some dependencies first:
sudo apt-get update
sudo apt-get -y install python-dev python-pip libtool libltdl-dev
sudo pip install --upgrade pip
sudo pip install behave nose docker-compose protobuf couchdb==1.0
2.Install golang 1.7 or later from https://golang.org/doc/install by first download a version matching your environment, then run the command below:
tar -C /usr/local -xzf go1.8.1.linux-amd64.tar.gz

Do not forget adding the path to your PATH env.

PATH="/usr/local/go/bin:$PATH"
3.Install docker engine:
sudo apt-get install docker.io
4.Create a working directory and setup GOPATH:
mkdir -p ~/gopath/src/github.com/hyperledger
export GOPATH=~/gopath
5.Extract the source code to direct created in step 4:
git clone http://gerrit.hyperledger.org/r/fabric 
6.Build fabric binaries:
cd $GOPATH/src/github.com/hyperledger

make dist-clean all

or make individual target like this:

make peer

No comments:

Post a Comment