Home Data Blockchain with Hyperledger Fabric - Second Edition

Blockchain with Hyperledger Fabric - Second Edition

By Nitin Gaur , Anthony O'Dowd , Petr Novotny and 3 more
books-svg-icon Book
eBook $38.99 $26.99
Print $54.99
Subscription $15.99 $10 p/m for three months
$10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
BUY NOW $10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
eBook $38.99 $26.99
Print $54.99
Subscription $15.99 $10 p/m for three months
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
  1. Free Chapter
    Exploring Hyperledger Fabric
About this book
Blockchain with Hyperledger Fabric - Second Edition is a refreshed and extended version of the successful book on practical Hyperledger Fabric blockchain development. This edition includes many new chapters, alongside comprehensive updates and additions to the existing ones. Entirely reworked for Hyperledger Fabric version 2, this edition will bring you right up to date with the latest in blockchain. Using a real-world Trade Finance and Logistics example, with working code available on GitHub, you’ll really understand both how and why Hyperledger Fabric can be used to maximum effect. This book is your comprehensive guide and reference to explore and build blockchain networks using Hyperledger Fabric version 2. This edition of the book begins by outlining the evolution of blockchain, including an overview of relevant blockchain technologies. Starting from first principles, you’ll learn how to design and operate a permissioned blockchain network based on Hyperledger Fabric version 2. You will learn how to configure the main architectural components of a permissioned blockchain network including Peers, Orderers, Certificate Authorities, Channels, and Policies. You’ll then learn how to design, develop, package, and deploy smart contracts, and how they are subsequently used by applications. This edition also contains chapters on DevOps, blockchain governance, and security, making this your go-to book for Hyperledger Fabric version 2.
Publication date:
November 2020
Publisher
Packt
Pages
756
ISBN
9781839218750

 

Exploring Hyperledger Fabric

The focus of this chapter is the Hyperledger Fabric project—its components, design, reference architecture, and overall enterprise readiness. We will also discuss the broader aim of Linux Foundation-hosted Hyperledger projects and the importance of open source and open standards. The goal is to build an understanding of the diversity of various Hyperledger projects, and what frameworks and tools may be suitable for particular enterprise use cases and software consumption models. While the blockchain technology landscape is constantly in flux, Hyperledger projects represent a structure that supports a mature and peer-reviewed technology geared toward enterprise consumption and fueled by a diverse set of talent and community interests.

This chapter will cover the following topics:

  • Building on the foundations of open computing
  • Fundamentals of the Hyperledger project
  • Hyperledger frameworks, tools, and building blocks
  • ...
 

Building on the foundations of open computing

Open source projects, such as Linux and Java, have gained strength in mainstream businesses by serving as low-cost alternatives to commercial software. They provide capabilities that rival those of proprietary software, thanks to support from a large developer community. Popular open source projects can also accelerate open standards, the collective building blocks for products, by serving as a common implementation. Businesses and vendors using open standards free up development and services budgets for items that offer higher value and competitive advantage.

Open source is a part of the wider open computing movement, along with open standards and open architecture, as shown in the following diagram. Together, these initiatives enable integration and flexibility, and benefit customers by helping them avoid vendor lock-in.

open computing

Figure 2.1: Community innovation as a result of the open computing movement

Enterprises are...

 

Fundamentals of the Hyperledger project

To start building an understanding of Hyperledger, let's look at some of the key players and fundamental elements of the Hyperledger Fabric space.

The Linux Foundation

The Linux Foundation (LF) is a world leader in supporting open technology development, and it is highly esteemed in the developer community. The LF fosters partnerships that address some of the world's biggest challenges through open source computing. It has made enormous investments in open source projects since it was founded in 2000 and helped to build an ecosystem that paved the way for the technologies discussed in this book.

Hyperledger

Hyperledger is an open source project that came out of the LF and was created to help advance cross-industry blockchain technologies. It's a global open source collaboration involving leaders from numerous industries.

Open source and open standards

As noted previously, the open computing movement...

 

Hyperledger frameworks, tools, and building blocks

Now that we've looked at Hyperledger's foundations in the open computing movement, as well as its benefits for industry, let's talk about its frameworks, tools, and building blocks. A summary of the Hyperledger projects is shown in the following diagram:

Figure 2.2: Hyperledger frameworks (Source: Hyperledger.org, used under Creative Commons Attribution 3.0 Unported, https://creativecommons.org/licenses/by/3.0/)

In this section, we'll discuss each layer of the Hyperledger project, as illustrated in Figure 2.2, Distributed Ledgers, Libraries, and Tools, before considering some of the broader building blocks and concepts of Hyperledger Fabric.

Hyperledger distributed ledger frameworks

There are six blockchain frameworks, as follows:

  • Hyperledger Besu: This is a Java-based Ethereum Virtual Machine (EVM) client designed for use in private or public networks and for application...
 

Hyperledger Fabric component design

Let's discuss various Hyperledger Fabric components that facilitate the key blockchain components of the shared ledger, encryption, the trust system, and smart contracts. The components represent the Hyperledger Fabric infrastructure components and provide isolation from contract's development constructs. Chaincode or smart contract development details will be discussed in detail in a separate chapter.

The following diagram depicts the Hyperledger Fabric infrastructure components:

Figure 2.4: Hyperledger Fabric infrastructure components

Let's consider three key components before moving into the design discussion: the membership service, dedicated order nodes, and peers.

The membership service provides identity management to network participants:

  • Hyperledger Fabric CA is a certificate authority-based implementation of membership services, but you are not required to use it (that is, any X509-based PKI...
 

Hyperledger Fabric – the journey of a sample transaction

Now, let's look at the journey of a sample transaction with Hyperledger Fabric, as illustrated in the following diagram. This section will facilitate an understanding of the transaction processing protocol of Fabric:

Figure 2.7: Hyperledger Fabric walkthrough

Fabric introduces a newly designed blockchain, preserving the transaction processing architecture and aiming at a secure, scalable, resilient, modular, and confidential design. Hyperledger Fabric 2.0 supports the execution of distributed applications supporting enterprise-friendly programming models. The components in Hyperledger Fabric provide a modular design, optimally suited for a business network made of various enterprises. Hyperledger Fabric introduces a model based on three steps, an endorse-order-validate architecture, designed for the distributed execution of untrusted code in an untrusted environment. This separation not only allows...

 

Actors and components in a Hyperledger Fabric network

In this section we will explore the actors and their roles and responsibilities within a network. In the context of the actors we also look at the list of components of the network. We give a special focus to the role of the developer and the tasks the developer performs in the design of the Fabric-based solution.

Actors in a blockchain network

A blockchain is a network-based infrastructure where network-centric design, development, deployment, management, and support constructs apply. It is therefore vital to understand the various actors and their roles, shown in the following diagram and explained in the following text, that interact with the blockchain network for various purposes such as management, support, business use, regulation, and so on:

Figure 2.8: Actors in a blockchain network

Each actor has a role and entry point and defines a governance structure that aids in network governance, audit, and...

 

CAP theorem

In Chapter 1, Blockchain – An Enterprise and Industry Perspective, we introduced the CAP theorem in the context of general system properties. Formally, the CAP theorem as postulated by Eric Brewer in 2000 at ACM Symposium on Principles of Distributed Computing (PODC) (https://dl.acm.org/citation.cfm?id=343502) states that in a distributed data store it is impossible to guarantee more than any two of the following three properties: consistency (C), availability (A), and partition tolerance (P). A distributed data store thus can be characterized on the two properties it guarantees, namely CA, CP, or AP.

More specifically, the theorem is aimed at distributed systems deployed across unreliable networks (networks with faults and delays, such as the internet), leading to a partitioning of the system components. According to CAP, in these environments, the system design must focus on the balance between availability and consistency. For example, the...

 

New features covered in this book

The first edition of this book was published along with Fabric version 1.1. The following is an overview of the new features introduced between version 1.1 and the current version, 2.0:

  • Private data: Private data allows a subset of organizations participating in one ledger to keep some data private between themselves.
  • Service discovery: This helps client applications to dynamically discover configuration information about the network peers, cryptographic materials, endorsement policy, and other information needed to submit transactions to the network.
  • State-based endorsement: This allows the contract-level endorsement policy to be overridden by a policy for a specific key(s).
  • Pluggable system contracts: Developers can now develop own consensus models by implementing and deploying own system endorsement (ESCC) and validation (VSCC) contracts.
  • Identity Mixer: This is a new type of membership provider that provides...
 

Summary

We have learned about the general concepts that underpin blockchains and reviewed the blockchain frameworks, libraries, and tools currently in development by the LF. Fabric presents a modular and extensible implementation of these general concepts. This design helps us to develop and operate private networks that provide trust to attract new participants, as well as sustaining the confidence of founding and existing participants, all while maintaining business benefits and value. We have also learned about the CAP theorem, which underpins the potential of blockchains, and about the new features included in Fabric since version 1.1.

In the next chapter, we will introduce the notion of a business network and the various concepts of which business networks are composed, including participants, assets, and others.

About the Authors
Blockchain with Hyperledger Fabric - Second Edition
Unlock this book and the full library FREE for 7 days
Start now