Book Image

Hands-On Blockchain with Hyperledger

By : Nitin Gaur, Luc Desrosiers, Venkatraman Ramakrishna, Petr Novotny, Salman A. Baset, Anthony O'Dowd
Book Image

Hands-On Blockchain with Hyperledger

By: Nitin Gaur, Luc Desrosiers, Venkatraman Ramakrishna, Petr Novotny, Salman A. Baset, Anthony O'Dowd

Overview of this book

Blockchain and Hyperledger technologies are hot topics today. Hyperledger Fabric and Hyperledger Composer are open source projects that help organizations create private, permissioned blockchain networks. These find application in finance, banking, supply chain, and IoT among several other sectors. This book will be an easy reference to explore and build blockchain networks using Hyperledger technologies. The book starts by outlining the evolution of blockchain, including an overview of relevant blockchain technologies. You will learn how to configure Hyperledger Fabric and become familiar with its architectural components. Using these components, you will learn to build private blockchain networks, along with the applications that connect to them. Starting from principles first, you’ll learn to design and launch a network, implement smart contracts in chaincode and much more. By the end of this book, you will be able to build and deploy your own decentralized applications, handling the key pain points encountered in the blockchain life cycle.
Table of Contents (20 chapters)
Title Page
Copyright and Credits
Packt Upsell

Starting the chaincode development

Before we can start coding our chaincode, we need to first start up our development environment.

The steps of setting up the development environment has been explained in Chapter 3, Setting the Stage with a Business Scenario. However, we now proceed with starting up the Fabric network in dev-mode. This mode allows us to control how we built and run the chaincode. We will use this network to run our chaincode in the development environment.

Here is how we start the Fabric network in dev mode:

$ cd $GOPATH/src/trade-finance-logistics/network
$ ./ up -d true  


If you encounter any error while the network start, it could be caused by some left-over Docker container.  You can resolve this by stopping the network using ./ down -d true and running the following command: ./ clean -d true. The -d true option tells our script to take action on the dev network.

Our development network is now running in four Docker containers. The network is...