Hyperledger Cookbook
上QQ阅读APP看书,第一时间看更新

Writing chaincode as a smart contract

Chaincode in Hyperledger Fabric is similar to smart contracts. It is a program that implements the business logic and is run on top of blockchain. The application can interact with the blockchain by invoking chaincode to manage the ledger state and keep the transaction record in the ledger. This chaincode needs to be installed on each endorsing peer node that runs in a secured Docker container. The Hyperledger Fabric chaincode can be programmed in Go, Node.js, and Java.

Every chaincode program must implement the Chaincode interface. In this section, we will explore chaincode implementation using Go.