Setup a Hyperledger Fabric Host and Create a Machine Image

Overview

Launch an EC2 Instance

Install Prerequisite components for Hyperledger Fabric

ssh -i <key> ubuntu@<public_ip>
sudo apt-get update

Install cURL

sudo apt install curl

Install docker and docker-compose

sudo apt-get -y install docker-compose
sudo usermod -aG docker $USER
docker -v
docker-compose -v

Install Go Programming Language

wget https://golang.org/dl/go1.11.11.linux-amd64.tar.gz
sudo tar -xvf go1.11.11.linux-amd64.tar.gz
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin

Install Node.js and NPM

curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -
sudo apt install nodejs
node -v
npm -v

Install Python

Install Hyperledger Fabric Components

Installation

curl -sSL http://bit.ly/2ysbOFE | bash -s 1.4.1

Verification

docker images
cd fabric-samples/first-network
./byfn.sh up
./byfn.sh downexit

Create an AMI on this Host

Launch an EC2 instance with our AMI

// should have no running containers
docker ps
// hyperledger fabric docker images are all there
docker images
cd fabric-samples/first-network// wait till whole script complete
./byfn.sh up
// tear down the first network and chaincode
./byfn.sh down

Summary

Visit http://www.ledgertech.biz/kcarticles.html for all my works. Reach me on https://www.linkedin.com/in/ktam1/ or follow me @kctheservant in Twitter.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store