Hyperledger Cookbook: Over 40 recipes implementing the latest Hyperledger blockchain frameworks and tools
Book information
Description
Explore the entire Hyperledger blockchain family, including frameworks such as Fabric, Sawtooth, Indy, Burrow, and Iroha; and tools such as Composer, Explorer, and Caliper. Key FeaturesPlan, design, and create a full-fledged private decentralized application using Hyperledger services Master the ins and outs of the Hyperledger network using real-world examples Packed with problem-solution-based recipes to tackle pain areas in the blockchain development cycleBook Description Hyperledger is an open-source project and creates private blockchain applications for a range of domains. This book will be your desk reference as you explore common and not-so-common challenges faced while building blockchain networks using Hyperledger services. We'll work through all Hyperledger platform modules to understand their services and features and build end-to-end blockchain applications using various frameworks and tools supported by Hyperledger. This book's independent, recipe-based approach (packed with real-world examples) will familiarize you with the blockchain development cycle. From modeling a business network to integrating with various tools, you will cover it all. We'll cover common and not-so-common challenges faced in the blockchain life cycle. Later, we'll delve into how we can interact with the Hyperledger Fabric blockchain, covering all the principles you need to master, such as chaincode, smart contracts, and much more. We'll also address the scalability and security issues currently faced in blockchain development. By the end of this book, you will be able to implement each recipe to plan, design, and create a full-fledged, private, decentralized application to meet organizational needs. What you will learnCreate the most popular permissioned blockchain network with Fabric and Composer Build permissioned and permission-less blockchains using Sawtooth Utilize built-in Iroha asset/account management with role-based permissions Implement and run Ethereum smart contracts with Burrow Get to grips with security and scalability in Hyperledger Explore and view blockchain data using Hyperledger Explorer Produce reports containing performance indicators and benchmarks using CaliperWho this book is for This book is for blockchain developers who want to understand how they can apply Hyperledger services in their day-to-day projects. This book uses a recipe-based approach to help you use Hyperledger to build powerful, decentralized autonomous applications. We assume the reader has a basic knowledge of the Blockchain technology and cryptography concepts Table of ContentsWorking with Hyperledger FabricImplementing Hyperledger FabricModeling Business network using Hyperledger ComposerIntegrating Hyperledger Fabric with ExplorerWorking with Hyperledger SawtoothOperating Ethereum smart contract with Hyperledger BurrowWorking with Hyperledger IrohaExploring CLI with Hyperledger IndyHyperledger blockchain scalability and securityHyperledger blockchain ecosystem Cover Title Page Copyright and Credits About Packt Contributors Table of Contents Preface Chapter 1: Working with Hyperledger Fabric Reviewing the Hyperledger Fabric architecture and components Getting ready How to do it... How it works... Installing Hyperledger Fabric on AWS Getting ready How to do it... How it works... Building the Fabric network How to do it... How it works... Adding an organization to a channel Getting ready... How to do it... How it works... There's more... Using CouchDB How to do it... How it works... Writing your first application How to do it... Accessing the API with SDK How it works... See also Chapter 2: Implementing Hyperledger Fabric Inventory asset management Writing chaincode as a smart contract Getting ready Writing chaincode using Go How to do it... The OrgAsset entity The Init function The Invoke function The query and getHistory functions How it works... The Init function The Invoke function The query function Compiling and deploying Fabric chaincode Getting ready How to do it... Starting the sample Fabric network Building and deploying the chaincode How it works... Running and testing the smart contract How to do it... Installing the assermgr chaincode Instantiating the assermgr chaincode Invoking the assermgr chaincode How it works... Developing an application with Hyperledger Fabric through the SDK How to do it... Creating and executing startFabric.sh Setting up a client project Writing Node.js sever-side code Writing Node.js client-side code Running the web application How it works... Chapter 3: Modeling a Business Network Using Hyperledger Composer The Hyperledger Composer business network and development components Getting ready How to do it... Process flow Entities Assets Query How it works... Setting up the Hyperledger Composer prerequisites environment Getting ready How to do it... How it works... Setting up the development environment Getting ready How to do it... How it works... Configuring a Composer business network How to do it... How it works... Implementing models, transaction logic, access control, and query definitions Getting ready How to do it... How it works... There's more... Deploying, testing, and exporting business network archives using the Composer command-line interface Getting ready How to do it... How it works... Interacting with Composer through the RESTful API Getting ready How to do it... How it works... Chapter 4: Integrating Hyperledger Fabric with Explorer Technical requirements Setting up the Hyperledger Explorer environment Getting ready How to do it... Installing Hyperledger Explorer and setting up the database How to do it... Configuring Hyperledger Explorer with Fabric Getting ready How to do it... How it works... Building Hyperledger Explorer How to do it... Running the Hyperledger Explorer application Getting ready How to do it... Chapter 5: Working with Hyperledger Sawtooth Introduction Installing Hyperledger Sawtooth Getting ready How to do it... Configuring Hyperledger Sawtooth How to do it... How it works... Designing a namespace and address Getting ready How to do it... How it works... The namespace and address scheme There's more... Implementing a transaction family How to do it... How it works... Building a transaction processor Getting ready How to do it... Registering the transaction handler to the transaction processor Implementing the transaction handler class Building the command-line script Setting up the transaction processor as a service Building a Python egg and installing your python package Starting the transaction processor service How it works... Granting permissions on the Sawtooth network How to do it... How it works... There's more... Developing client applications with the Sawtooth REST API and SDK How to do it... Step 1 – Generating a private/public key-pair and creating a signer instance Step 2 – Implementing transaction-payload encoding Step 3 – Implementing the namespace prefix and address scheme Step 4 – Building a transaction header and a transaction Step 5 – Building a batch Step 6 – Submitting the batch with REST API Step 7 – Building the client application Step 8 – Testing the sample client How it works... Chapter 6: Operating an Ethereum Smart Contract with Hyperledger Burrow Introduction An introduction to Seth Installing Hyperledger Burrow on AWS Getting ready How to do it... How it works... Writing smart contracts with Solidity Getting ready How to do it... How it works... Using the pragma version and importing another source file Using contracts Deploying and calling the Ethereum smart contract on Burrow Getting ready How to do it... How it works... Installing Hyperledger Seth with Docker on AWS How to do it... How it works... Creating externally owned accounts and writing Solidity contracts on Seth How to do it... How it works... Deploying and calling Ethereum contracts with the Seth CLI and RPC How to do it... How it works... Permissioning Ethereum EOA and contract accounts on Seth How to do it... How it works... Chapter 7: Working with Hyperledger Iroha Installing Hyperledger Iroha on AWS How to do it... How it works... Configuring Hyperledger Iroha Getting ready How to do it... How it works... Interacting with Hyperledger Iroha using the CLI to create cryptocurrency Getting ready How to do it... How it works... There's more... Interacting with Hyperledger Iroha using the client library Getting ready How to do it... How it works... Chapter 8: Exploring the CLI with Hyperledger Indy Introduction Installing Hyperledger Indy and the Indy CLI on AWS Getting ready How to do it... How it works... There's more... Exploring the Indy CLI with Hyperledger Indy Getting ready How to do it... Running the Indy CLI Creating, opening, and listing the wallet Creating, importing, and using the DID Creating, connecting, and listing the Indy node pool Sending NYM transactions to the ledger Posting the credential schema and credential definition transaction to the ledger How it works... Hyperledger Blockchain Scalability and Security Hyperledger blockchain scalability and performance How to do it... Block-size scaling Endorser scaling The endorser policy Channels and resource allocation Hyperledger blockchain security How to do it... The Fabric CA server The Fabric CA client The Fabric CA database How it works... Hyperledger performance measurement Getting ready How to do it... Installing dependencies Running the benchmark How it works... The adaption layer The interface and core layer The application layer See also Hyperledger Blockchain Ecosystem An introduction to the Hyperledger family The framework projects The tool projects Building the Hyperledger framework layers The Hyperledger design philosophy at a glance Framework architecture overview The consensus layer Smart contracts Solving business problems with Hyperledger IBM and Walmart – blockchain for food safety with Hyperledger Fabric The problem The approach The results ScanTrust and Cambio Coffee – supply-chain blockchain with Hyperledger Sawtooth The problem The approach The results BC and VON – cutting government red tape with Hyperledger Indy The problem The approach The results Other Books You May Enjoy Index
Similar books
Learn Ethereum, 2nd Edition
2024 · PDF
Blockchain Quick Start Guide: A beginner's guide to developing enterprise-grade decentralized applications
Learn Ethereum, 2nd Edition
2023 · EPUB
Blockchain By Example: A developer's guide to creating decentralized applications using Bitcoin, Ethereum, and Hyperledger
2018 · EPUB
Blockchain By Example: A developer's guide to creating decentralized applications using Bitcoin, Ethereum, and Hyperledger
2018 · MOBI
Blockchain By Example: A developer's guide to creating decentralized applications using Bitcoin, Ethereum, and Hyperledger
2018 · PDF
Learn Ethereum: Build your own decentralized applications with Ethereum and smart contracts
2019 · EPUB
Learn Ethereum: Build your own decentralized applications with Ethereum and smart contracts
2019 · PDF