Blockchain with Hyperledger Fabric
eBook - ePub

Blockchain with Hyperledger Fabric

Build decentralized applications using Hyperledger Fabric 2, 2nd Edition

  1. 756 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Blockchain with Hyperledger Fabric

Build decentralized applications using Hyperledger Fabric 2, 2nd Edition

About this book

Learn to develop blockchain-based distributed ledgers and deploy a Hyperledger Fabric network with concrete exercises and examples

Key Features

  • Updated with the latest features and additions that come with Hyperledger Fabric 2
  • Write your own smart contracts and services using Java and JavaScript on a Hyperledger Fabric network
  • Dive into real-world blockchain challenges such as integration and scalability

Book Description

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.

What you will learn

  • Discover why blockchain is a technology and business game changer
  • Set up blockchain networks using Hyperledger Fabric version 2
  • Understand how to create decentralized applications
  • Learn how to integrate blockchains with existing systems
  • Write smart contracts and services quickly with Hyperledger Fabric and Visual Studio Code
  • Design transaction models and smart contracts with Java, JavaScript, TypeScript, and Golang
  • Deploy REST gateways to access smart contracts and understand how wallets maintain user identities for access control
  • Maintain, monitor, and govern your blockchain solutions

Who this book is for

This book is designed in such a way that professionals from different areas including business leaders, technology leaders, blockchain application developers, and even beginners can benefit from it.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, weโ€™ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere โ€” even offline. Perfect for commutes or when youโ€™re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Blockchain with Hyperledger Fabric by Nitin Gaur,Anthony O'Dowd,Petr Novotny,Luc Desrosiers,Venkatraman Ramakrishna,Salman A. Baset in PDF and/or ePUB format, as well as other popular books in Computer Science & Cryptography. We have over one million books available in our catalogue for you to explore.

Information

9

Network Operation and Distributed Application Building

In previous chapters, we established the foundations of a business network and application spanning multiple organizations and stakeholders:
  • In Chapter 4, Setting the Stage with a Business Scenario, we configured and ran a barebones trade network from a set of specifications
  • In Chapter 5, Designing Smart Contract Transactions and Ledger Data Structure, we built the core of a blockchain application in the form of a set of smart contracts that directly read and manipulate the ledgers that are the systems-of-record for your network
The bulk of the configuration and application logic development is done, but our task is far from finished.
As you can imagine, the contracts, which act on data used by multiple organizations, are sensitive pieces of code that ought to be accessible only via safe channels with built-in protections against misuse. Therefore, it is standard practice among blockchain developers to layer one or more applications above the contracts, exposing the contracts' capabilities in ways that provide adequate security and privacy safeguards. These applications, unlike smart contracts, can be engineered as typical enterprise applications using well-known technology stacks. They can also be integrated with existing enterprise applications used by organizations that participate in blockchain networks.
Unlike a smart contract, which acts on a shared backing store (ledger) whose state is held in consensus by network participants, the higher-layer enterprise applications don't necessarily have to act on behalf of the entire network. In fact, the various organizations and stakeholders within them may have unique and specific business logic requirements, requiring the development of different applications serving selected clientele. Therefore, a single blockchain network may end up exposing different ledger views and contract capabilities to different stakeholders. Further, these applications may run in enterprise security domains maintained independently by the different organizations. Collectively, though, the set of smart contracts and higher-layer applications can be viewed as a distributed application acting on a common data storage layer.
In this chapter:
  • We will learn how to build and operate a distributed Fabric application for the business entities that participate in our trade scenario:
    • We will recap the Hyperledger Fabric ledger setup and transaction pipelines
    • We will show how each step is performed using code and configuration samples
  • At the end of this process, you will understand how to:
    • Bootstrap network ledgers
    • Install contracts
    • Engineer applications as web services that can be exercised by users through commands on a terminal or from a web browser
  • We will learn how to build a production-grade ordering service that generates transaction blocks by consensus of a cluster of nodes running the Raft protocol
We will begin this chapter by discussing the nature of a multi-layered distributed Fabric application: first in generic terms, and subsequently using our trade scenario as an example. Later, we will demonstrate how to develop and bootstrap such an application to enable our trade scenario.

Stages in a Fabric network's life cycle

Before we dive into the details of application-building, it is important to first gain a broader perspective on how a Fabric network is created and bootstrapped in readiness for deploying and running applications, and what streams of developmental activities must be undertaken. Figure 9.1 illustrates these stages and activities from the perspectives of three groups of subjects: operators and maintainers, developers, and users:
  • Network setup and bootstrapping activities are classified into operations, which is the responsibility of network operators designated by their respective organizations or by the consortium. Operators will also typically oversee DevOps.
  • Development, which involves designing, writing, and testing application code, can occur before or concurrently with operations. The developers responsible for this are typically distinct from operators and do not need to know operational details, though they need to know the organizational and channel structure to write proper code.
  • Finally, the exercising of the applications' business logic is classified into runtime activities, and this is done by members and clients of the enterprises that belong to the network consortium.
Figure 9.1: A Fabric network's life cycle categorized into operational, developmental, and runtime stages
The operations stage (steps 1 to 4 in Figure 9.1) begins with the process of starting up individual components of a network (step 1), namely the peers belonging to designated organizations that share channel ledgers, ordering nodes (typically) belonging to their separate organizations, and nodes running Fabric CA servers and acting as CAs for their respective organizations. We demonstrated this process in Chapter 4, Setting the Stage with a Business Scenario.
Next, we set up channels and associate each network peer with one or more channels (step 2). We walked through an example of defining a channel's configuration and creating the artifacts necessary to start up those channels in Chapter 4, Setting the Stage with a Business Scenario. In this chapter, we will see how to create channels and bootstrap their ledgers (or chains). Smart contract development (step 1a) can occur together with the channel definition and setup; since contracts running on different channels may need to communicate at runtime, the contract developers must know channel names and organizational affiliations beforehand.
Having completed Chapter 5, Designing Smart Contract Transactions and Ledger Data Structure, you should already know how to implement a contract. Once the channels are set up, each contract must be installed and initialized on a given channel (step 3), which we will see how to do later in this chapter. Finally, the higher-layer applications can be started (step 4); these can be developed (step 3a) at any point in time using knowledge of the API offered by each contract, but must be started for users to complete this exercise.
At the end of the operations stage, a distributed applica...

Table of contents

  1. Preface
  2. Blockchain โ€“ An Enterprise and Industry Perspective
  3. Exploring Hyperledger Fabric
  4. Business Networks
  5. Setting the Stage with a Business Scenario
  6. Designing Smart Contract Transactions and Ledger Data Structures
  7. Developing Smart Contracts
  8. Developing Applications
  9. Advanced Topics for Developing Smart Contracts and Applications
  10. Network Operation and Distributed Application Building
  11. Enterprise Design Patterns and Considerations
  12. Agility in a Blockchain Network
  13. Governance โ€“ A Necessary Evil of Regulated Industries
  14. Life in a Blockchain Network
  15. Hyperledger Fabric Security
  16. Blockchain's Future, Protocol Commercialization, and Challenges Ahead
  17. Another Book You May Enjoy
  18. Index