Вы находитесь на странице: 1из 11

12/9/2018 How to install Hyperledger Fabric on Ubuntu - TechRepublic

DATA CENTERS

How to install Hyperledger Fabric on Ubuntu


This how-to walks you through the process of installing the blockchain framework,
Hyperledger Fabric, on Ubuntu 16.04.
By Jack Wallen | May 8, 2018, 7:49 AM PST

Hyperledger Fabric is a blockchain framework implementation that you can use as a


foundation for developing applications or solutions with a modular architecture. It's quite a
challenge to install, but once you have it up and running (and have started developing
applications that make use of the blockchain framework) it will be well worth your time. The
good news is that it's all open source and runs on open source platforms, so there is no

https://www.techrepublic.com/article/how-to-install-hyperledger-fabric-on-ubuntu/ 1/11
12/9/2018 How to install Hyperledger Fabric on Ubuntu - TechRepublic

software cost investment. There is of course a time investment. But this will be time worth
spent.

I want to walk you through the process of installing Hyperledger Fabric v 1.0 on Ubuntu Server
16.04. This is handled completely through the command line. I will assume you already have
your Ubuntu Server 16.04 up and running. You will also need an account with sudo rights.

With that said, let's install.

Installing the Go language


Hyperledger Fabric depends upon the Go language. The minimum required version is 1.7.
Although version 1.10.2 is available, it will not compile and install with this method, so we'll be
going with 1.7. Here are the necessary steps:

1. Change into your home directory with the command cd ~/


2. Download the tar file with the command wget
https://storage.googleapis.com/golang/go1.7.1.lin...
(https://storage.googleapis.com/golang/go1.7.1.linux-amd64.tar.gz)
3. Unpack the file with the command tar xvzf go1*.tar.gz

Now we need to set GOPATH and GOROOT with the following commands:

mkdir $HOME/gopath
export GOPATH=$HOME/gopath
export GOROOT=$HOME/go
export PATH=$PATH:$GOROOT/bin

Richest Female Celebs Under 21

PAID CONTENT BY INSPIREDOT

Check to make sure golang is working by issuing the command go version. You should see
the version of go you just installed (in our case, 1.10.2).

Install dependencies

https://www.techrepublic.com/article/how-to-install-hyperledger-fabric-on-ubuntu/ 2/11
12/9/2018 How to install Hyperledger Fabric on Ubuntu - TechRepublic

Next we have a few dependencies to install. The first is libltdl-dev. This can be done with the
single command:

sudo apt install libltdl-dev

Docker is our next dependencies. We'll install Docker from a downloadable .deb file, with the
commands:

wget https://download.docker.com/linux/ubuntu/dists/xenial/pool/stable/amd64/docker-
ce_18.03.1~ce-0~ubuntu_amd64.deb
sudo dpkg -i docker*.deb
sudo apt install -f

Add our user to the docker group with the command:

sudo usermod -aG docker USERNAME

Where USERNAME is the actual name of the user.

Log out and log back in. Verify that Docker is working with the command:

docker run hello-world

If you see "Hello from Docker!" you're good to continue on.

Next we must install Pip. Do this with the following command:

sudo apt install python-pip

Verify pip has been installed with the command pip —version.

Now we need to add Docker Compose. We will install this, by way of Pip, with the command:

sudo pip install docker-compose

Verify Docker Compose was installed with the command docker-compose —version.

Now we install git and curl with the command:

sudo apt install git curl

Installing Hyperledger Fabric

https://www.techrepublic.com/article/how-to-install-hyperledger-fabric-on-ubuntu/ 3/11
12/9/2018 How to install Hyperledger Fabric on Ubuntu - TechRepublic

Now we install Hyperledger Fabric. Create a new directory with the command:

mkdir -p $GOPATH/src/github.com/hyperledger/

Change into that newly created directory with the command:

cd $GOPATH/src/github.com/hyperledger/

Download fabric with the command:

git clone https://github.com/hyperledger/fabric.git

Change into the fabric directory with the command cd fabric and reset the fabric commit level
with the command:

git reset --hard c257bb31867b14029c3a6afe1db35b131757d2bf

Make and install fabric with the command make. This will take some time to complete. When
the installation completes, issue the following commands (so our test network will succeed):

git checkout fa3d88cde177750804c7175ae000e0923199735c


sh examples/e2e_cli/download-dockerimages.sh

You can now run a fabric example by changing into the examples directory with the command
cd examples/e2e_cli/ and then first issuing the command to create a test channel:

./generateArtifacts.sh TESTCHANNEL

Where TESTCHANNEL is the name of a channel (such as testchannel). Next, issue the
command:

./network_setup.sh up TESTCHANNEL 10000 couchdb

Where TESTCHANNEL is the name of your test channel. Near the end of the above command,
you should see END-E2E drawn out in ascii (Figure A).

Figure A

https://www.techrepublic.com/article/how-to-install-hyperledger-fabric-on-ubuntu/ 4/11
12/9/2018 How to install Hyperledger Fabric on Ubuntu - TechRepublic

A successful run of an included example.

You might wind up with errors regarding docker images hyperledger/fabric-tools. To fix this,
you must pull down the latest images from Docker Hub and then retag them. This done with
the following commands:

docker pull hyperledger/fabric-tools:x86_64-1.1.0


docker tag hyperledger/fabric-tools:x86_64-1.1.0 hyperledger/fabric-tools:latest

Once you've issued the above commands, rerun the ./network_setup.sh up command.

Hyperledger Fabric is up and running


Congratulations! You now have Hyperledger Fabric up and running. You can now begin the
process of developing for this blockchain framework.

Data Center Trends


DevOps, virtualization, the hybrid cloud, storage, and operational efficiency are just some of the data
center topics we'll highlight. Delivered Mondays and Wednesdays
Sign up today ()

Also See
How to install Rancher Docker Container Manager on Ubuntu
(https://www.techrepublic.com/article/how-to-install-rancher-docker-container-manager-on-ubuntu/)
(TechRepublic)
How to fix the Docker and UFW security flaw (https://www.techrepublic.com/article/how-to-fix-the-
docker-and-ufw-security-flaw/) (TechRepublic)
How to monitor your Docker containers with ctop (https://www.techrepublic.com/article/how-to-
monitor-your-docker-containers-with-ctop/) (TechRepublic)
How to get quick stats on your Docker containers (https://www.techrepublic.com/article/how-to-get-
quick-stats-on-your-docker-containers/) (TechRepublic)

https://www.techrepublic.com/article/how-to-install-hyperledger-fabric-on-ubuntu/ 5/11
12/9/2018 How to install Hyperledger Fabric on Ubuntu - TechRepublic

The Hyperledger Project is growing like gangbusters (https://www.zdnet.com/article/the-


hyperledger-project-is-growing-like-gangbusters/) (ZDNet)

RELATED TOPICS: DATA CENTERS OPEN SOURCE HARDWARE VIRTUALIZATION NETWORKING

STORAGE CLOUD

About Jack Wallen


Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter
of open source and the voice of The Android Expert. For more news about Jack Wallen, visit
his website jackwallen.com.

Recommended Promoted Links by Taboola

Big Sale on Rolex Watches Up-to 70% off. Sale Ends Soon
Luxury Watch

Latest Collection of Rolex Watches Up-to 80% off


Wristro

15 Forbidden Destinations You Can Never Visit


Far & Wide

Forget the most popular programming languages, here's what developers actually use

Raspberry Pi-sized LattePanda Alpha runs Windows 10, offers MacBook-like specs

The 8 biggest open source milestones in 2018

ADD YOUR COMMENT

WHITE PAPERS, WEBCASTS, AND DOWNLOADS


https://www.techrepublic.com/article/how-to-install-hyperledger-fabric-on-ubuntu/ 6/11
12/9/2018 How to install Hyperledger Fabric on Ubuntu - TechRepublic

Special Report: A Guide to Data Center Automation (free PDF)


eBooks from TechRepublic

DOWNLOAD NOW

Network, PC, and server audit checklist


Downloads from Erik Eckel

DOWNLOAD NOW

Create your personalised cloud learning experience!


Resource Center from Google Cloud

DOWNLOAD NOW

Create your personalised cloud learning experience


Resource Center from Google Cloud

GET STARTED

Join the Google Cloud resource hub for technology leaders!


Resource Center from Google Cloud

DOWNLOAD NOW

EDITOR'S PICKS

https://www.techrepublic.com/article/how-to-install-hyperledger-fabric-on-ubuntu/ 7/11
12/9/2018 How to install Hyperledger Fabric on Ubuntu - TechRepublic

The Brexit dilemma: Will London's start-ups stay or go?

America's coolest company: How Big Ass Fans went from cooling cows to a multinational tech powerhouse

https://www.techrepublic.com/article/how-to-install-hyperledger-fabric-on-ubuntu/ 8/11
12/9/2018 How to install Hyperledger Fabric on Ubuntu - TechRepublic

Can Russian hackers be stopped? Here's why it might take 20 years

The new commute: How driverless cars, hyperloop, and drones will change our travel plans

https://www.techrepublic.com/article/how-to-install-hyperledger-fabric-on-ubuntu/ 9/11
12/9/2018 How to install Hyperledger Fabric on Ubuntu - TechRepublic

RECOMMENDED Sponsored Links by Taboola

Big Sale on Rolex Watches Up-to 70% off. Sale Ends Soon
Luxury Watch

Latest Collection of Rolex Watches Up-to 80% off


Wristro

FREE NEWSLETTERS, IN YOUR INBOX

Tech News You Can Use


We deliver the top business tech news stories about the companies, the people, and the products
revolutionizing the planet.
Delivered Daily

SUBSCRIBE

Best of the Week


Our editors highlight the TechRepublic articles, galleries, and videos that you absolutely cannot miss to
stay current on the latest IT news, innovations, and tips.
Delivered Fridays

SUBSCRIBE

https://www.techrepublic.com/article/how-to-install-hyperledger-fabric-on-ubuntu/ 10/11
12/9/2018 How to install Hyperledger Fabric on Ubuntu - TechRepublic

This fund is suitable for investors


Retirement who are seeking*:
Corpus

•    Long term capital appreciation


Education Corpus
•    A fund that invests in primarily in small cap companies
Long Term Wealth Creation

*Investors
Over  unique
should
3,75,000 investors^
consult their innancial
this fund.
distributors if in doubt about whether the
product is suitable for them.
Investments In Predominantly
Small-Cap Companies

Mutual Fund investments are subject to market risk, read all scheme related document carefully.

https://www.techrepublic.com/article/how-to-install-hyperledger-fabric-on-ubuntu/ 11/11

Вам также может понравиться