Fabric's Chaincode

Now, let's begin the fun part of the chapter  writing smart contracts.

Chaincode is the smart contract that handles the business logic agreed to by members of the network. It is a piece of code that performs the logic operation in the blockchain network, and can be written in any conventional programming language and executed in a container. Currently, since Fabric 1.1, Golang and Javascript are the supported Chaincode languages. In this example, we will use Golang (Go) as the Chaincode language to implement our food supply chain example. Therefore, I recommend learning about the Go lanauge before starting. You can refer to the official documentation, or to Go playground (https://play.golang.org/), which is a web-based IDE where you can learn to code in Go online.

As creating the entire supply chain logic may not be within the scope of this chapter, we will implement some very simple logic for our food industry supply chain example.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset