Basic details and installation process
Hyperledger
Hyperledger project is an opensource collaborative effort created to advance cross-industry blockchain technology.
It is a collection of the project under hyperledger initiative created by Linux Foundation.
There are two types of projects-
- A framework, like Hyperledger Composer
- A tool, like Hyperledger Fabric
Hyperledger fabric is a Distributed Ledger Technology (DLT) framework for building Business Blockchain Applications.
It has four characteristics which make it suitable for a business environment-
- Permissioned Network
- Member identities are known among network users.
- Participants have role-based access to the network application.
- Confidential transaction
- Not all transactions should be visible to all the members of the network.
- Members of the network have the option to transact privately.
- No cryptocurrency
- No incentivization needed.
- No crypto tokens needed for the transaction.
- Programmable
- The smart contract can be made according to the Business need.
- Business Logic Implementation is possible on the blockchain network.
Blockchain Network
All the blockchain technologies have the concept os nodes, which are connected to other nodes to form a blockchain network.
Node are of three types
- Orderer
- Peer (Leader, Anchor)
- Client
1. Orderer
a. Communication channel for fabric.
b. Responsible for consistent ledger state across the network. Provides consensus mechanism. Ensures order of transaction.
c. Creates the blocks and generates atomic delivery.
d. Implemented with Message Oriented Middleware.
2. Peer
a. Maintain its own copy of the ledger.
b. Anchor Peers are known outside the Organization, Discoverable, Each organization must have at least one anchor peer.
c. Leader Peers receive blocks from Orderer. May be assigned statically or dynamically. Leadership is at the channel level.
3. Client
- Act on behalf of the end-user.
- Creates transaction requests and submits to the network.
Channels
- Transactions can be isolated within the channel.
- Chain code is deployed to a channel, not the network.
- Ordering System channel gets automatically created at the time of network initialization.
- Organizations/Peers may join multiple channels.
Consortium
An association of two or more individuals, companies, organizations, or governments with the objective of achieving a common goal.
Types of consortium
- Industry consortium –
- Here, the members are from the same industry.
- These are also known as Business Consortium or Consortia.
- Technology consortium –
- It is focused on the technology like WC3, Hyperledger, Enterprise Ethereum Alliance.
Benefits of Consortium –
- Standardization
- Collaboration
- Efficiencies
Members of the consortium make decisions like
- Rules for Addition/Removal of members
- Access/Authorization policies
- Configuration of the system
Installation Process
cURL
Step 1. Update the package list
sudo apt-get update
Step 2. Install cURL
sudo apt install curl
Step 3. Check curl version
curl — version
Docker
Step 1. Update the package list
sudo apt-get update
Step 2. Install the required packages
sudo apt-get install apt-transport-https ca-certificates gnupg-agent software-properties-common
Step 3. Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
Step 4. Setup the Docker stable repository
sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable”
Step 5. Update the package list
sudo apt-get update
Step 6. Install the latest version of Docker engine
sudo apt-get install docker-ce docker-ce-cli containerd.io
Step 7. Add user to Docker group
In order to run the docker commands without sudo, you need to add the current user to the docker group with the below command.
sudo usermod -aG docker $USER
To confirm if the user is added to the docker group, try the command
id -nG
Step 8. Check Docker version
docker version
Docker version 19.03.8, build afacb8b7f0
Step 9. Verify the Docker Engine
The below command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits.
docker run hello-world
Install Docker Compose
Step 1. Download the latest version of the Docker Compose
sudo curl -L “https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)” -o /usr/local/bin/docker-compose
Step 2. Apply executable permissions to the binary
sudo chmod +x /usr/local/bin/docker-compose
Step 3. Check Docker Compose version
docker-compose — version
docker-compose version 1.25.5, build 8a1c60f6
Install Go
The recommended version of Go is version 1.12.x.
Step 1. Download the tar file
curl -O https://storage.googleapis.com/golang/go1.12.9.linux-amd64.tar.gz
Step 2. Extract the tar file
tar -xvf go1.12.9.linux-amd64.tar.gz
Step 3. Move the go directory
sudo mv go /usr/local
Step 4. Update environment variables
We need to update environment variables i.e. PATH and GOPATH. For this, the user’s profile needs to be updated.
nano ~/.profile
Add the below in the .profile file.
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
Save the .profile file and load the updated environment variables.
source ~/.profile
Step 5. Check to GoLang version
go version
go version go1.12.9 linux/amd64
Install Node.js and NPM
If you will be developing applications for Hyperledger Fabric leveraging the Hyperledger Fabric SDK for Node.js, version 8 is supported from 8.9.4 and higher. Node.js version 10 is supported by 10.15.3 and higher.
We will be installing a 10.x version. Installing Node.js will also install NPM
Step 1. Install the Node.js v10.x repository
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash –
Step 2. Install nodejs
sudo apt-get install -y nodejs
Step 3. Check node version
node -v
v10.20.1
Step 4. Check NPM version
npm -v
6.14.4
Install Hyperledger Samples, Binaries and Docker Images
Under Fabric 1.4.x releases, v 1.4.7 is the latest release and we will install this version.
Step 1. Before downloading the Fabric binaries, create a directory for e.g. hyperledger in your home path.
mkdir hyperledger
cd hyperledger/
Step 2. Download Fabric v1.4.7
From the hyperledger directory (for e.g. /home/jay/hyperledger) run the below command. Please note, this will take quite some time based on your internet speed.
curl -sSL http://bit.ly/2ysbOFE | bash -s — 1.4.7 1.4.7 0.4.20
Step 3. Update environment variable
nano ~/.profile
Add the fabric bin path to the PATH variable. Please make sure to use the path where you have downloaded fabric binaries.
export PATH=/home/$USER/hyperledger/fabric-samples/bin:$PATH
Save the .profile file and load the updated environment variables.
source ~/.profile
Cryptogen
A utility for generating crypto material for testing.
Command to get help
cryptogen help
cryptogen command help
cryptogen showtemplate
- Shows the template that can be used for creating your own config file.
- Users provide the YML file input
cryptogen generate
to generate the crypto-material. This is used for generating crypto material for testing.
Cryptogen configuration file setup
Crypto-config.yaml file has two sections
- OrdererOrgs — A list of organizations managing orderers.



PeerOrgs — A list of member Organizations managing peers.
- Use specs for specific peer hostname
- Use the template for defining multiple peers
- Creates crypto for multiple peers i.e. Peer0 and Peer1



To create the configuration folder with all the details about the different organization within the network,
cryptogen generate — config=./crypto-config.yaml
The command is used.
https://twitter.com/thecapital_io
https://medium.com/media/3b6b127891c5c8711ad105e61d6cc81f/href
Hyperledger Fabric was originally published in The Capital on Medium, where people are continuing the conversation by highlighting and responding to this story.
Post fetched from this article