L11 12 13 Hyper Ledger Fabric overview
L11 12 13 Hyper Ledger Fabric overview
• Key Features:
• Modular architecture
• Smart contract functionality
• Pluggable consensus mechanisms
Key Components of Hyperledger Fabric
• Peers – Nodes that maintain the ledger and execute smart contracts.
• Orderer – Ensures consensus and delivers transactions to peers.
• Channels – Private sub-networks for data segregation.
• Chaincode (Smart Contracts) – Business logic execution.
• Membership Service Provider (MSP) – Identity and access control.
• Ledger – Immutable transaction record.
Transaction Flow in Hyperledger Fabric
The transactional mechanics that take place during a standard asset exchange. The scenario includes
two clients, A and B, who are buying and selling radishes. They each have a peer on the network
through which they send their transactions and interact with the ledger.
Assumptions
• This flow assumes that a channel is set up and running. The
application user has registered and enrolled with the organization’s
Certificate Authority (CA)
• The chaincode (containing a set of key value pairs representing the
initial state of the radish market) is installed on the peers and
deployed to the channel.
• The chaincode contains logic defining a set of transaction instructions
and the agreed upon price for a radish.
• An endorsement policy has also been set for this chaincode, stating
that both peerA and peerB must endorse any transaction.
1.Client A initiates a transaction to purchase radishes, targeting peerA and peerB.
2.A transaction proposal is constructed using a supported SDK, packaging the proposal
and adding a unique signature.
3.Endorsing peers verify the proposal, execute the chaincode, and produce transaction
results (response value, read set, and write set).
4.The application inspects proposal responses to verify signatures and compare
responses.
5.The client assembles endorsements into a transaction message (read/write sets,
endorsing peers' signatures, and Channel ID) and broadcasts it to the ordering
service.
6.The ordering service orders transactions chronologically by channel and creates
blocks of transactions per channel.
7.The blocks are delivered to all peers on the channel, and the transactions are
validated.
8.Each peer appends the block to the channel's chain, commits write sets to the
current state database for valid transactions, and notifies the client application of the
transaction's status.
Peer Roles in Hyperledger Fabric
• Deployment Process:
• Developer writes the chaincode.
• Chaincode is packaged and installed on endorsing peers.
• A chaincode definition is approved and committed to the
channel.
• Chaincode is invoked to execute transactions.
• Endorsement Policies:
• Define which peers must approve a transaction before it is
committed.
• Example: "At least 2 out of 3 peers must endorse."
• State Management:
• Uses World State Database (CouchDB/LevelDB) to store asset
states.
• Transactions update state through key-value operations.
• Chaincode Interaction:
• Uses gRPC APIs for communication between applications and
peers.
• Implements CRUD operations on the blockchain ledger.
Security and Privacy in Hyperledger Fabric