Hyperledger Fabric
Hyperledger Fabric
Poornima S
SIES/IT
Famous Blockchain Frameworks
Ethereum
Hyperledger
R3 Corda
Quick Comparison
● Ethereum
○ Permissionless and generic Blockchain platform
○ Governed by Ethereum developers
○ Mining based on Proof of Work (POW)
○ Consensus approached at Ledger level
● Hyperledger
○ Modular and permissioned platform
○ Governed by Linux foundation
○ Multiple consensus approaches - at transaction level
● R3 Corda
○ Specialized distributed and permissioned ledger platform
○ Governed by R3
○ Specific consensus at transaction level
Hyper Ledger
● Introduced by Linux foundation, Hyperledger is an open source,
modular architecture targeted at businesses that aim to
streamline their process leveraging blockchain technology.
Org_4 Org_5
Organization
L2 L2
A C2 B
L1 L1
Apps
Channel 1
D C
L1 L1
• Nodes A,B,C, D are
connected to a private
channel (subnet)
Entities involved
Hyperledger - Tools and Frameworks
Client sends the The orderer simply orders The peers validate the
transaction proposal to the transactions, puts them transactions. (Check for double
endorser. The endorsers into blocks and sends it to spending, enforcement of the
return results with their all the peers to be endorsement policy etc.)
signatures. The client validated. It does not have
checks if the endorsement to look at the transactions.
policy is being satisfied. If
yes, it sends the
transaction to the orderer.
HL Fabric Transactions workflow
Modular Architecture of Hyperledger Fabric
Courtesy: IBM
Hyperledger Tools
Setup prerequisites
- Git https://git-scm.com/downloads
- CURL https://curl.se/download.html
- Docker Engine https://docs.docker.com/engine/install/
- NodeJS (recommend to use nvm (Node Version Manager))
- Docker Compose (version 1.29.2)
- Go
- Python 2.7 / 3.6
>> sudo groupadd docker To bypass using sudo every time while using docker
>> sudo usermod -aG docker $USER REQUIRED TO DO
Installing Hyperledger Fabric
Determine a location on your machine where you want to place the fabric-
samples repository and enter that directory in a terminal window.
>> cd fabric
Example:
>> cd fabric-samples/test-network
The script will start containers for each member of the test-network namely:
- orderer
- peer0.org1.example.com
- peer0.org2.example.com
- ca_org1
- ca_org2
- ca_orderer
- cli
Creating a channel and deploying chaincode
Example:
>> ./network.sh -ccn basic –ccp ../asset-transfer-basic/chaincode-javascript -
ccl javascript
The wallet directory stores the crypto material for a user issued by a CA. The CA is respawned
every time we do ./network.sh up.
● asset-transfer-events
While deploying the chaincode for this example set the -ccep flag to
“OR(‘Org1MSP.peer’, ‘Org2MSP.peer’)”
NPTEL links: