Hyperledger Fabric: How to Setup Application from Scratch using Nodejs— Series 1 to ??
--
This tutorial is purely for technical developer or programmer, so if you are a manager or non-techno people, I am sorry! you will find this very programmatic but you are free to read & enrich your knowledge in Hyperledger Fabric Development.
I will go over step by step from Scratch, it is right from generating certificates, setting up organization, peers, developing chain codes, instantiating it & finally creating web application to interact with your blockchain ledger!.
Are you ready for the journey?!!
Before we start, it is very important to understand what is “Hyperledger Fabric”, without which you cannot move further. Have a basic knowledge and foundation strong, then you can easily set it up.
Just before Hyperledger Fabric, go & watch this Video!.. It makes you clear, what is BLOCKCHAIN & how distributed ledger works.
Hyperledger Fabric ?
Hyperledger Fabric is a platform for distributed ledger solutions, underpinned by a modular architecture delivering high degrees of confidentiality, resiliency, flexibility and scalability. It is designed to support pluggable implementations of different components, and accommodate the complexity and intricacies that exist across the economic ecosystem. To know more, read this official documentation Link here
Environment Setup
- Ubuntu 16.04
- Fabric Version 1.1
Once you have the basic environment setup with Ubuntu 16.04 OS ready, then open the terminal & initiate the below command(reference : Link here)
curl -sSL https://goo.gl/6wtTN5 | bash -s 1.1.0
Note: If you get Curl command not available error, install CURL using below command first
sudo apt-get install curl
this command ( curl -sSL https://goo.gl/6wtTN5 | bash -s 1.1.0) will
- Download set of executable shell script files(given below), which are to generate certificates, genesis blocks & etc..
cryptogen
,configtxgen
,configtxlator
,peer
orderer
andfabric-ca-client
2. Download fabric-samples repo, which contains bootstrap or boilerplate for setting up our project in quicker way.
3. Finally, it downloads docker containers.
Note: it will take atleast 20 to 30 minutes, since each docker containers are 1.5GB of image.. So make sure that, you have enough storage space. (If you are running in Virtual Box, then allocate enough storage space, I had hard time with Virtual box)
To view all docker container, use this command from your terminal
docker images
It will display all the images that are downloaded. Look at the “TAG”, it shows 1.2.0-rc1 latest
Hyperledge Fabric is comprised of multiple components, here component I meant, Orderer, Certificate Authority, Peeres & Couch DB(database). Basically these four components are important for hyperledger fabric to communicate & commit the transactions in DLT(Distributed Ledger).
Wait?!, do you want to compare this with real time example?.. Let’s apply this in concept. Consider a supply chain market(Laptop Manufacturer to end user). In current system(Without blockchain), it is not easy for end user or distributor of laptop’s to identify the originality of the products. They just need to rely on Brand.
Now, with the blockchain, every participants (Manufacturer, Distributor, Seller) will maintain their own ledger & copy of every transactions will be tracked in their ledger, which results easy identification of laptops ownership, originality, from which manufacturers the laptops are distributed etc. If any case, laptops are malfunctioning it will be easy to identify how many laptops in that LOT/BATCH are to be replaced.
I spoke about 4 components & told you supply chain story, how these are interrelated?, let’s see in my next article!..
I write often to keep my readers engaged, so keep reading!. This series, will give you enough & strong knowledge in Hyperledger Framework.
Note: if you find this article interesting, give me a thumpsup(claps) & feel free to share this. Also, tag this series to get notified for next article.
Part II -> Click here
Part III -> Click here