
Hyperledger Cookbook
Over 40 recipes implementing the latest Hyperledger blockchain frameworks and tools
- 310 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
Hyperledger Cookbook
Over 40 recipes implementing the latest Hyperledger blockchain frameworks and tools
About this book
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 Features
- Plan, 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 cycle
Book 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 learn
- Create 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 Caliper
Who 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
Frequently asked questions
- 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.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Information
Working with Hyperledger Sawtooth
- Installing Hyperledger Sawtooth
- Configuring Hyperledger Sawtooth
- Designing a namespace and address
- Implementing a transaction family
- Building a transaction processor
- Granting permission on the Sawtooth network
- Developing client applications with the Sawtooth REST API and SDK
Introduction
- A truly distributed DLT: The Hyperledger Sawtooth blockchain network is made up of validator nodes. The ledger is shared between all validator nodes and each node has the same information. They participate in a consensus to manage the network.
- Proof of Elapsed Time (PoET) consensus and support for large-scale networks: Hyperledger Sawtooth includes a novel consensus algorithm, PoET. PoET is a Byzantine Fault-tolerance (BFT) consensus algorithm that supports large-scale networks with minimal computing and much more efficient resource consumption compared to proof of work algorithms. PoET was invented by Intel and utilizes the special CPU instruction set called Software Guard Extensions (SGX), to achieve the scaling benefits of the Nakamoto-style consensus algorithms. Each node waits for a random period of time and the first node to finish is the leader and commits the next block.
- Fast transaction performance: Hyperledger Sawtooth keeps the latest version of assets in the global state and transactions in the block chain on each network node. This means that you can look up the state quickly to carry out CRUD actions, which provides fast transaction processing. Sawtooth requires transactions to be processed in batches and supports parallel scheduling of transactions. Parallel transaction execution not only accelerates the execution of transactions but also correctly handles the double spending problem known as Unspent Transaction Output (UTXO).
- Support for a broad variety of languages: Sawtooth supports the implementation of transaction families (safe and smart contracts) in a wide variety of programming languages, including Python, Go, Rust, Java, and Javascript.
- The ability to configure private, public, and consortium blockchain networks: Sawtooth can be configured with different permissions to build private, consortium, or public networks by specifying which nodes are allowed to join the validator network and participate in the consensus, and which clients are allowed to submit batches and transactions.
- Validator nodes: These are peer nodes that shape the network. They are responsible for peer discovery, message communication, blockchain synchronization, managing the global state, consensus, block commits, and so on.
- Transaction processor: This is a smart contract for processing business logic.
- REST API: This is an API that provides the client application with the ability to interact with Validator nodes:

Installing Hyperledger Sawtooth
Getting ready
- Install PuTTy (from https://www.chiark.greenend.org.uk/~sgtatham/putty/) on your Windows desktop and convert the private key generated by Amazon EC2 into a putty key file using PuTTygen, following the guide that can be found at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html.
- In PuTTygen, load the EC2 key file and save the private key:

- Run PuTTy and specify the private key file for PuTTy in Connection | SSH| Auth. Log in as ubuntu to the Sawtooth AWS instance:

- Set up Python. Verify that Python version 3.5 or above is pre-installed on the instance:
python3 -V
- Refresh the Unix package list:
sudo apt-get update
- Install the Python package manager, pip:
sudo apt install python3-pip
- Verify that pip has been installed correctly:
pip3 -V
How to do it...
- Subscribe to and install the Hyperledger Sawtooth product 1.0.4 (https://aws.amazon.com/marketplace/pp/B075TKQCC2) on the AWS marketplace and launch an AWS EC2 instance, which can be of the m4.2xlarge or t2.mroc type for personal development. To check whether Hyperledger Sawtooth is running on the instance, enter the following command:
systemctl list-units|grep -i sawtooth|less

- View the Sawtooth block on the chain, as follows:
sawtooth block list

- View the Sawtooth global state as follows:
sawtooth state list

- Verify that the Sawtooth REST API service is working as follows:
curl http://localhost:8008/blocks
Table of contents
- Title Page
- Copyright and Credits
- About Packt
- Contributors
- Preface
- Working with Hyperledger Fabric
- Implementing Hyperledger Fabric
- Modeling a Business Network Using Hyperledger Composer
- Integrating Hyperledger Fabric with Explorer
- Working with Hyperledger Sawtooth
- Operating an Ethereum Smart Contract with Hyperledger Burrow
- Working with Hyperledger Iroha
- Exploring the CLI with Hyperledger Indy
- Hyperledger Blockchain Scalability and Security
- Hyperledger Blockchain Ecosystem
- Other Books You May Enjoy