Hyperledger Fabric Components

iOSTom
8 min readDec 27, 2018

After reading this article you will understand the components that make up a Hyperledger fabric network. I will begin by explaining what a network is and then explain how the different components work together to create a trusted and secure network.

What is a blockchain network?

A blockchain network provides ledger and smart contract services to applications. Smart contracts are used to generate transactions which are distributed to every peer node in the network. Multiple organizations come together as a consortium. The consortium agrees upon permissions which are defined in a set of policies.

A network consists of a min of one peer who is responsible for endorsing and committing transactions. The blockchain network also utilizes a ordering service and membership service to revoke certifications and control permissions.

What is a domain?

Top level namespace of program, aka project name

multiple ledger “Channels” can be defined and managed, supporting a secure distributed environment for sharing data. For security, PKI Digital certificates and keys are required to access the network and query or create transactions.

What is an organization?

Are the containers for the peers and respective certificate authorities (CA). Each organization has its own CA and a list of peers. Organizations are used for physical separation of the blockchain network where each organization who users your product can setup their physical machines and join your network.

Organization they also hold the certification authority as well. Each organization has its own certificate authority CA that is implemented by the Membership Service Provider and a list of peers. Usually organizations are used for physical separation of the blockchain network where each organization who uses your product can setup their physical machines and join your network.

Hyper ledger Fabric Infrastructure Components

  1. Application
  2. Peer Nodes
  3. Membership Service Providers
  4. Ordering Service

What is a peer?

Peer is a component that executes, and maintains a ledger of, transactions. There are two roles for a peer.

  1. Endorser
  2. Committer

Explain how peers work?

Fabric designates peers as always being a committer but not always an endorser. Peers play no role in the ordering of transactions. A peer executes chaincode, accesses ledger data, endorses transactions, and interfaces with applications. Every chaincode may specify an endorsement policy.

Committer peer are responsible for committing transactions. maintaining ledger and state. The endorser node is responsible for receiving a transaction proposal for endorsement, responds granting or denying endorsement. The ordering peer, approves the transaction and communicates with peer and endorsing nodes.

Who controls the peers?

Members operate component such as Peers, Orderers, and applications in the blockchain network.

What is an endorsement policy?

Defines the necessary and sufficient conditions for valid transaction endorsements.

What is a Membership Service Provider?

Is responsible for managing certificates used to authenticate member identity and roles.

What is the difference between Membership Service Provider and Certificate Authority?

MSP is a Membership Service Provider — pluggable interface to support variety of credentials architectures, basically offering abstraction layer for membership orchestration architecture. MSP abstraction provides:

  1. Concrete identity format
  2. User credential validation
  3. User credential revocation
  4. Signature generation and verification

While Fabric-CA used to generate certificates and keys to actually initialize MSP facilities. Fabric-CA is a default implementation of MSP interface to cover identity management.

What are the different types of transactions?

Hyperledger fabric has two types of transactions:

  1. Deploy
  2. Invoke

Explain how a transaction works?

When transaction is proposed and committed by a peer, the orderer is informed about the new transaction. If the transaction is endorsed, the client submits the transactions to the ordering service. Otherwise the transaction is canceled.

How does the ordering service work?

The ordering service is also refereed to as the orderer it approves blocks into the ledger. It communicates with peers and endorsing peers. It provides a shared communication channel to clients and peers over which the transaction can be broadcast.

Participants and components

Ledger — is a channels chain and current state data which is maintained by each peer on the channel

Shared Ledger

Hyperledger Fabric has a ledger subsystem comprising of two components:

  1. World state
  2. Transaction log

Each participant has a copy of the ledger to every Hyperledger Fabric network they belong to.

World State

Describes the state of the ledger at a given point in time, it is the database of the ledger.

Smart Contract — Software running on a ledger, to encode assets and the transaction instructions for modifying the assets.

Peer Network — A broader term overarching the entire transactional flow, which serves to generate an agreement on the order and to confirm the correctness of the set of transactions constituting a block.

Membership — Membership services authenticates, authorizes, and manages identities on a permissioned blockchain network. Ecert — enrollment cert, identity on blockchain. Tcert — Transaction cert, one time use credit card, people have to lookup who did that transaction, can hide identity if needed.

Events — Creates notifications of significant operations on the Blockchain as well as notifications related to smart contracts. Does not include event distribution. Publish and subscribe system

System Management — Provides the ability to create, change and monitor Blockchain components.

Wallet — Securely manages a users security credential, store Identity

System Integration- Responsible for integrating Blockchain bi-directional with external systems. Not part of Blockchains

4 important components of blockchain

Shared ledger, smart contracts, privacy, trust

The components represent the Hyperledger Fabric Infrastructure components and provide isolation from chain code or smart contract development

Modular Components

  1. Pluggable ordering service establishes consensus on the order of transactions and then broadcasts blocks to peers.
  2. Pluggable membership service provider is responsible for associating entities in the network with cryptographic identities.
  3. Peer-to-peer gossip service disseminates the blocks output by ordering service to other peers.
  4. Smart contracts run within a container environment
  5. Ledger can be configured to support a variety of DBMSs
  6. Pluggable endorsement and validation policy enforcement that can be independently configured per application.

What are the Hyperledger Infrastructure Components?

Each organization participating in the blockchain network will be a Peer or Endorsing Peer Node with the ability to create ledger transactions.

An organization can have more an one peer, should have multiple peers in an orderer to avoid data loss, having more than 3 or 4 peers might result in higher latency rates.

Order Nodes

Under a domain there are orderers, who are responsible for making sure that all the peers in the network have committed a transaction.

Ordering Nodes(service)- Approves the inclusion of transaction blocks into the ledger and communicates with committing and endorsing peer nodes. Does not hold smart contract, Does not hold ledger.

Implements atomic broadcast API

Orders and batches transactions and signs each batch to create a hash chain

The ordering service is pluggable the implementer needs to only provide an atomic broadcast API based on the gRPC interface def

The Orderer Service will gather transactions, then a subset of Endorsing Peers will execute the chaincode. If valid, they will order the transactions in a block and disseminate to the Peer Nodes, where the block will be validated and applied to the blockchain.

Peer Nodes

Peer nodes can subscribe to an number of channels based on application access control policies.

Peer nodes only receive block data on the subscription channels, data is isolated and confidential (channel specific). Members outside the channel cannot access the data in the channel.

Peers connected to clients responsible for committing transaction to the world state.

Peer Nodes can create Smart Contract transactions (“chaincode” in Hyperledger) that go through the consensus mechanism (“Orderer Nodes” in Hyperledger). If valid, all Peer Nodes are updated, confirmed, and a consensus is achieved.

Responsible for existing smart logic and maintaining the ledger

Endorsement simulates transactions (executes does not commit)

Peers receive batches of endorsed transactions from the orderer nodes and then validate and commit transactions (this eliminates non-determinism)

Committing Peers

Does the final check on the stored transactions before they are submitted to the ledger. The transaction is linked up whether it is valid or not. The state of the transaction indicates whether it is valid or not. If the transaction is invalid, the world state does not change.

Committing Peer — Maintains ledger and state, Commits transactions. May hold smart contract

Endorsing Node

Endorsing Peer — Specialized committing peers that receives a transaction proposal for endorsement, responds granting or denying endorsement. Must hold smart contract

However, Endorsing Peers have the authority to execute chaincode, which is a part of Hyperledger’s consensus mechanism.

Distributed Ledger Technology for Business

Fabric is a highly modular and configurable architecture.

Fabric is the first distributed ledger platform to support smart contracts authored in general purpose programming languages such as Java, Go and Nodejs.

Fabric is also permissioned based, participants are know to each other. This means that while the participants may not fully trust one another, a network can be operated under a governance mode that is built off what trust does exist between participants

Please checkout the below links

Resume website — https://tommarler.org

Linkedin — https://www.linkedin.com/in/tom-m-bb4857112/

https://fabrictestdocs.readthedocs.io/en/latest/glossary.html

--

--

iOSTom

iOS Developer, Go, Java, C#, Blockchain enthusiast, Data junkie