Designing Smart Contract Transactions and Ledger Data Structures
In Hyperledger Fabric, a smart contract, sometimes referred to as chaincode or just contract, is written by a developer. A contract implements a business logic agreed upon by stakeholders of the blockchain network. The functionality is exposed to client applications for them to invoke, provided they have the correct permissions.
A contract runs as an independent process in its own container, isolated from the other components of the Fabric network. An endorsing peer manages the lifecycle of the contract and of the transaction invocations. In response to client invocations, the contract queries the ledger and generates a transactions proposal.
Fabric provides Contract APIs for the development of contracts in three languages of Go, Java, and Node.js (JavaScript or TypeScript). In the first edition of this book published along with Fabric 1.2, we focused on the development of contracts in Go. The APIs and mechanisms...