Hands-On Blockchain with Hyperledger
上QQ阅读APP看书,第一时间看更新

Setting up the development environment

As you already know by now, an instance of a Hyperledger Fabric blockchain is referred to as a channel, which is a log of transactions linked to each other in a cryptographically secure manner. To design and run a blockchain application, the first step is to determine how many channels are required. For our trade application, we will use one channel, which will maintain the history of trades carried out among the different participants.

A Fabric peer may belong to multiple channels, which from the application's perspective will be oblivious to each other, but which help a single peer run transactions in different applications on behalf of its owners (or clients). A channel may run multiple smart contracts, each of which may be an independent application or linked together in a multi-contract application. In this chapter, and in this book, we will walk the reader through the design of a single-channel, single-contract application for simplicity's sake. It is up to the reader to design more complex applications, relying on the information provided in this book as well as in the Fabric documentation.

Before we delve into the mechanics of setting up our system to install an application and run transactions on our smart contract, we will describe how to create and launch a network on which the application will be installed. A sample network structure will be used to illustrate  trade operations throughout this chapter (in Chapter 9, Life in a Blockchain Network, you will see how this sample network can be modified as the requirements change and evolve).