Book Image

Hyperledger Cookbook

By : Xun (Brian) Wu, Chuangfeng Zhang, Zhibin (Andrew) Zhang
Book Image

Hyperledger Cookbook

By: Xun (Brian) Wu, Chuangfeng Zhang, Zhibin (Andrew) Zhang

Overview of this book

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.
Table of Contents (12 chapters)

Developing client applications with the Sawtooth REST API and SDK

Hyperledger Sawtooth provides a pragmatic REST API for clients to interact with a validator using common HTTP standards. There are a many ways to make a REST API request, but the process to build a transaction, batch, encode a payload, and submit them to validator nodes is not easy. Hyperledger Sawtooth provides several SDKs for different languages, such as Python, Go, Java, and JavaScript, to greatly simplify the process of developing client applications to interact with the Sawtooth network.

In this recipe, we will build a client application for our example with the Sawtooth Python SDK and follow the Sawtooth XO transaction family as a template. The full source code for the example is available at GitHub. The basic flow to submit a transaction is shown in the following diagram:

Transaction submission flow
...