Hyperledger is a set of open source tools and blockchain subprojects resulting from cross- industry collaboration. We will present two main components in this article – Hyperledger Fabric and Hyperledger Composer.
If you are not familiar with blockchain technology or Hyperledger family reading History and Evolution of Blockchain Technology from Bitcoin, Intro to Hyperledger Family and Hyperledger Blockchain Ecosystem, Hyperledger Design Philosophy and Framework Architecture, The Survey of Hyperledger Fabric Architecture and Components for Blockchain Developers and Overview of Building Blockchain Smart Contracts in Hyperledger articles are highly recommended.
If you like to explore blockchain development with an alternative platform like Ethereum (with Solidity programming), Blockchain Developer Guide- Introduction to Ethereum Blockchain Development with DApps and Ethereum VM, Building Ethereum Financial Applications with Java and Web3j API through Blockchain Oracles, Harness the Power of Distributed Storage IPFS and Swarm in Ethereum Blockchain Applications, and Building Enterprise Blockchain-as-a-Service Applications Using Ethereum and Quorum are highly recommended.
In this article, we will introduce an enterprise blockchain solution called Hyperledger Fabric. Hyperledger (or the Hyperledger project) is one of the biggest projects in the blockchain industry. It is a global collaboration, hosted by The Linux Foundation, and includes leaders in different sectors aiming to build a robust business-driven blockchain framework. After this article, we move on to our tutorial where you will develop, from a practical standpoint, a strong grasp of core Hyperledger, understand what Fabric is and how it works, and learn key vocabulary and concepts commonly used when discussing Hyperledger. This article presents a first glimpse to Hyperledger by building a blockchain-based supply chain application. It will be an occasion to show how blockchain, and in particular Hyperledger, enables global business transactions with greater visibility and trust and less entanglement.
Food industry supply chain
The main reason for classical supply chain inefficiency is the lack of transparency and reliable reporting. Many companies suffer from the lack of visibility regarding the entire supply chain of their products, and hence lose an immediate competitive advantage over competitors in their industries. In the traditional supply chain models, the information about an entity is not fully transparent to others, which leads to inaccurate reports and a lack of interoperability. Emails and printed documents provide certain information, but still can’t contain fully detailed visibility and traceability information since the products across the entire supply chain are hard to trace. It is almost impossible for the consumer to know the true value of the product they purchased. Since the blockchain is a transparent, immutable, and secure decentralized system, it is considered to be a game-changing solution for traditional supply chain industries. It can help to build an effective supply chain system by improving the following areas: · Tracking the products in the entire chain · Verifying and authenticating the products in the chain · Sharing the entire chain information between supply chain actors · Providing better auditability The food industry's supply chain use case is a difficult landscape, where multiple actors need to coordinate with each other in order to deliver the goods to their final destination, that is, the customers. The following picture depicts the actors we will consider in our example of a food supply chain (multi-echelon) network.
Every stage of the chain introduces potential security vulnerabilities, integration issues, and other inefficiency issues. The main growing threat in current food supply chains remains counterfeit food and food fraud. Given these threats, in this example we will build a food- tracking system based on the Hyperledger blockchain, which will enable full visibility, tracking, and traceability. More importantly, it will assure the authenticity of food by recording a product's details in an immutable and viable way. By sharing a product's details over an immutable framework, we will enable the end consumer to self-verify a product's authenticity.
Now that we have an idea about the project we will build, let's take a quick overview of the Hyperledger project before we start coding.
Quick Hyperledger overview
There are three main types of blockchain networks; public blockchains, consortium or federated blockchains, and private blockchains. Hyperledger is a blockchain framework which aims to help companies to build private or consortium permissioned blockchain networks, where multiple organizations can share the control and the permission to operate a node within the network. Hyperledger is a set of open source tools and blockchain subprojects resulting from cross- industry collaboration. We will present two main components in this article – Hyperledger Fabric and Hyperledger Composer.
Hyperledger Fabric
Hyperledger Fabric is the cornerstone of the Hyperledger projects hosted by the Linux Foundation. It is a permission-based blockchain, or more accurately a distributed ledger technology (DLT), which was originally created by IBM and Digital Asset. It is designed as a modular framework with different components, such as the orderer and Membership Services Provider (MSP). It is also a flexible solution, offering a pluggable consensus model, although it is currently only providing permissioned, voting-based consensus, with the assumption being that any current Hyperledger networks will be operating in a partially trustworthy environment. Given this, there is no need for anonymous miners to validate any transactions, there is no need either for an associated currency to act as an incentive. All participants are required to be authenticated in order to participate and transact on the blockchain. As with Ethereum, it supports smart contracts, which in Hyperledger are called Chaincode and these contracts describe and execute the application logic of the system. Unlike Ethereum, however, Hyperledger Fabric doesn’t require expensive mining computation to commit transactions and thus can help us to build blockchains that can scale up with less latency.
Hyperledger Fabric is different from blockchains such as Ethereum or Bitcoin, not only in its type or because it is currency-agnostic, but also in terms of its internal machinery. In a typical Hyperledger network we have the following key elements:
· Ledger: This stores a chain of blocks, which keeps all immutable historical records of all state transitions.
· Nodes: These are the logical entities of the blockchain. There are three types of nodes :
o Client: Clients are applications that act on behalf of a user to submit transactions to the network.
o Peer: This is an entity that commits transactions and maintains the ledger state.
o Orderer: This creates a shared communication channel between clients and peers, and it packages blockchain transactions into blocks and sends them to committing peers. Together with these key elements, Hyperledger Fabric is based on the following key design features:
· Chaincode: Chaincode is a similar concept to a smart contract in other networks such as Ethereum. It is a program written in a higher level language, executing against the ledger’s current state database.
· Channels: A channel is a private communication subnet for sharing confidential information between multiple network members. Each transaction is executed on the channel which is only visible to the authenticated and authorized parties.
· Endorsers: These validate transactions and invoke chaincode, sending back the endorsed transaction results to the calling applications.
· MSP: This provides identity validation and authentication processes by issuing and validating certificates. It identifies which certification authorities (CAs) are trusted to define the members of a trust domain, and determines the specific roles an actor might play (member, admin, and so on).
End-to-end transaction flow
To understand how Hyperledger Fabric is different and how it works under the hood, let's look at how a transaction gets validated. In a typical Hyperledger network, the following figure depicts the end-to-end system flow for processing a transaction:
As a first step, the client initiates a transaction by sending a request to a Hyperledger Fabric-based application client, which submits the transaction proposal to endorsing peers. These peers simulate the transaction by executing the Chaincode (using a local copy of the state) specified by the transaction and sending back the results to the application. At this point, the application combines the transaction along with the endorsements and broadcasts it to the Ordering Service. The Ordering Service checks the endorsements and creates a block of transactions for each channel before broadcasting them to all peers in the channel. Peers will then verify the transactions and commit them. In our use case, the Hyperledger Fabric blockchain can connect participants through a transparent, permanent, and shared record of food origin data, processing data, shipping details, and more. The Chaincode we defined will be invoked by authorized participants in the food supply chain. All executed transaction records will be permanently saved in the ledger, and all entities will be able to look up this information.
Hyperledger Composer
Alongside blockchain frameworks such as Fabric or Iroha, the Hyperledger project provides us with tools such as Composer, Hyperledger Explorer, and Cello. Composer provides a tool set to help build blockchain applications more easily. It consists of CTO (a modelling language), Playground (a browser-based development tool for rapid testing and deployment), and a command-line interface (CLI) tool. Composer supports the Hyperledger Fabric runtime and infrastructure, and internally the composer's APIs utilize the underlying Fabric API. Composer runs on Fabric, meaning the business networks generated by Composer can be deployed to Hyperledger Fabric for execution.
Summary
In this article, we review a typical food supply chain. We also reviewed the highlights of Hyperledger Fabric and Composer. After this short introduction to Hyperledger Fabric's main components, it's time to run the first Hyperledger blockchain network. Specifically, we move on to Ultimate Guide for Building A Blockchain Supply Chain Using Hyperledger Fabric and Composer tutorial which will help you to achieve the following practical goals:
· Setting up a private Hyperledger network
· Writing and deploying your first Chaincode (smart contract)
· Building a web interface to query your Chaincode
About Authors
This article is written by Matt Zand (founder of High School Technology Services) in collaboration with Brian Wu who is a senior Blockchain consultant at DC Web Makers.
Hey there @dcwebmakers, welcome to STEEM. If you join @schoolofminnows, you can receive votes for free.
1. Your post will appear in post-promotion on the discord.
2. Your posts will also get featured on the school of minnows account on steem
https://steemit.com/@schoolofminnows
3. You get votes from other members.
4. The whole thing is FREE.
To join follow this link:
https://steem.host/connect/steempunks
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit