Hyperledger Fabric Network
Creating a first hyperledger fabric network through Amazon AWS
- create an AWS account
- Connecting to the instance
- Creating first network - installing prerequisites
- Install cURL
- Install Docker and Docker Compose
- Install GO Programming Language
- Install Node.js Runtime and NPM
- Install Python
- Installing Sample Binaries and Docker Images
- Running first network
I created an AWS student account through www.awseducate.com
Through your workbench, go to AWS console and create an EC2 instance
Go to Services-> ec2-> launchinstance-> Ubuntu Server 16.04 LTS (HVM), SSD Volume Type-> m4large
Add tag->basicnetwork, Create a new key-pair, Download key pair and click launch instance
Once the instance has started, you can connect it through Putty
Before connecting, convert the .pem file (key pair) into .ppk file using PuttyGen. This step is required because Putty requires a .ppk file and cannot connect using .pem file
Now add .ppk file to Putty, and connect to the IP of the running AWS instance
Type on the terminal cURL command to check if its installed or run cURL --version. If it is not installed you can install it through below command
sudo apt-get install curl
I followed this article: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04
and
Run the command sudo curl -O https://storage.googleapis.com/golang/go1.9.1.linux-amd64.tar.gz
Easy article explanation here https://medium.com/@patdhlk/how-to-install-go-1-9-1-on-ubuntu-16-04-ee64c073cd79
Don't forget to set the path. Run command export PATH=$PATH:$GOPATH/bin
Retrieve the Python version 2.7, which is goof for running Fabric Node.js SDK, by using command sudo apt-get install python
You can also check python version by command "python --version"
You are essentially done for installing the prerequisites. You can refer to detailed installation article herehttps://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html
Once you are ready, and in the directory into which you will install the Fabric Samples and binaries, go ahead and execute the following command: curl -sSL http://bit.ly/2ysbOFE | bash -s 1.2.0
then, curl -sSL http://bit.ly/2ysbOFE | bash -s curl -sSL http://bit.ly/2ysbOFE | bash -s 1.2.0 1.2.0 0.4.10
I faced an issue of Docker permission denied while trying to connect to the Docker daemon socket
I solved the issue with command sudo usermod -a -G docker $USER . Don't forget to completely log out of your account and log back in (if in doubt, reboot!):
Detailed solution at: https://techoverflow.net/2017/03/01/solving-docker-permission-denied-while-trying-to-connect-to-the-docker-daemon-socket/
cd fabric-samples/first-network
Ready to give it a go. Run the command: ./byfn.sh generate
This command generates all the certificates. And after this, bring up the network
./byfn.sh up
If you’d like to run through this tutorial with node chaincode, pass the following command instead:
we use the -l flag to specify the chaincode language forgoing the -l flag will default to Golang
./byfn.sh up -l node
Bring down the network with the command ./byfn.sh down