Install Hyperledger Fabric on AWS


Install Hyperledger Fabric on AWS

Recipe ID: hsts-r8


If you like to develop small to enterprise blockchain applications using Hyperledger tools, the first step is to learn what is Hyperledger and how it works. Specifically, Hyperledger Fabric Architecture and Components for Blockchain Developers article is a great start. Once you learn the structure of transaction flow in Hyperledger, you can proceed with setting up your development environment. In this article, we show you how to install and run Hyperldger Fabric on Amazon Web Services or AWS.

For those who are not familiar with Hyperledger project, reading Blockchain Overview, Intro to Hyperledger Family and Hyperledger Blockchain Ecosystem, Hyperledger Design Philosophy and Framework Architecture, and Overview of Building Blockchain Smart Contracts in Hyperledger articles are strongly recommended beforehand.

Keep in mind that to install and run this recipe, you need AWS EC2 Ubuntu Server 16.04 with 4 GB of memory. We will use the Fabric 1.3 release as it is the most stable release as of writing this recipe.

Hyperledger AWS Installation Requirements

From the Hyperledger Fabric website (https://hyperledger-fabric.readthedocs.io/en/release-1.3/prereqs.html), the prerequisites for this recipe are as follows:

We chose Amazon Ubuntu Server 16.04. If you don't have experience with installing Ubuntu in EC2, please refer to the AWS document:https://aws.amazon.com/getting-started/tutorials/launch-a-virtual-machine/.​

You can also choose to install Ubuntu in your local machine virtual box. A tutorial for this can be found at http://www.psychocats.net/ubuntu/virtualbox or https://askubuntu.com/questions/142549/how-to-install-ubuntu-on-virtualbox

Step-by-Step Hyperledger Installation

To install Hyperledger on AWS, follow these steps:

 1. Execute the following commands to update the software on your system:

sudo apt-get update

 2. Install curl and the golang software package:

sudo apt-get install curl

sudo apt-get install golang

export GOPATH=$HOME/go

export PATH=$PATH:$GOPATH/bin

 

3. Install Node.js, npm, and Python

sudo apt-get install nodejs

sudo apt-get install npm

sudo apt-get install python

 

4. Install and upgrade docker and docker-compose:

$ sudo apt-get install docker

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu

$(lsb_release -cs) stable"

$ sudo apt-get update

$ apt-cache policy docker-ce

sudo apt-get install -y docker-ce

sudo apt-get install docker-compose

sudo apt-get upgrade

 

5. Let's customize and update Node.js and golang to the proper versions:

wget https://dl.google.com/go/go1.11.2.linux-amd64.tar.gz\

tar -xzvf go1.11.2.linux-amd64.tar.gz

sudo mv go/ /usr/local

export GOPATH=/usr/local/go

export PATH=$PATH:$GOPATH/bin

curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -

sudo apt-get install -y nodejs

 

6. Verify the installed software package versions:

$ curl --version

/usr/local/go/bin/go version

python -V

node -v

npm -version

docker --version

docker-compose --version

The result should look like this:

 

7. Install Hyperledger Fabric 1.3:

$ curl -sSL http://bit.ly/2ysbOFE | sudo bash -s 1.3.0
It will take a few minutes to download the Docker images. When it is done, the results should look like this:

 

This completes the installation of the Hyperledger Fabric on the AWS EC2 machine. The next step after installation is to build your first Hyperledger network.

Putting Things Together
In previous section, we installed several prerequisites, so let's explain what each software package is and how they work together to build the Hyperledger Fabric platform:

With this Hyperledger Fabric installation, it will download and install samples and binaries to your system. The sample applications installed are useful for learning the capabilities and operations of Hyperledger Fabric:

Congratulation! We have successfully installed Hyperledger Fabric on an AWS EC2 virtual machine. The next step is to build the first Hyperledger Fabric network.

The following recipes are excellent resources for installing other Hyperledger tools:

Blockchain Developer Guide- How to Install and work with Hyperledger Sawtooth
Blockchain Hyperledger Composer Business Network Modeling and Environment Setup
Blockchain Developer Guide- How to Install Hyperledger Burrow on AWS
Blockchain Developer Guide- How to Install Hyperledger Iroha on AWS
Blockchain Developer Guide- How to Install Hyperledger Indy and Indy CLI on AWS
Blockchain Developer Guide- How to Install Hyperledger Seth and Docker on AWS

To conclude this recipe, we like to recommend our Blockchain Hyperledger Development in 30 hours course to those interested in pursuing a blockchain development career. Indeed, as of this writing, Hyperledger Foundation offers the following two Hyperledger certifications: The Certified Hyperledger Fabric Administrator (CHFA) and The Certified Hyperledger Sawtooth Administrator (CHSA), both of which are highly regarded in the industry. Hyperledger Foundation is in the process of creating Hyperledger Developer certification program, which may be released in early or middle of 2020. In short, by taking our hands-on online Hyperledger class, you would be able to obtain CHFA certification.

This recipe is written by Brian Wu who is our senior Hyperledger instructor in Washington DC. His Hyperledger Cookbook with 40+ hands-on recipes is highly recommended.

Related Training Courses

Hands-on Node.JS, MongoDB and Express.js Training
Advance JavaScript, jQuery Using JSON and Ajax
Learn Hands-on Blockchain Ethereum Development & Get Certified in 30 Hrs
Learn Blockchain Hyperledger Development & Get Certified in 30 Hrs
Become Blockchain Certified Security Architect in 30 hours
Blockchain Certified Solution Architect in 30 hours
Introduction to Python Programming
Object Oriented Programming with UML


Private and Custom Tutoring

We provide private tutoring classes online and offline (at our DC site or your preferred location) with custom curriculum for almost all of our classes for $50 per hour online or $75 per hour in DC. Give us a call or submit our private tutoring registration form to discuss your needs.


View Other Classes!