December 2018
Intermediate to advanced
222 pages
6h 6m
English
There are three important functions in Fabric chaincode: Init, and Invoke, Query. Every chaincode program must implement the chaincode interface, as follows:
type Chaincode interface { Init(stub ChaincodeStubInterface) pb.Response Invoke(stub ChaincodeStubInterface) pb.Response}
Init() is called when the application initializes its internal data for other chaincode functions to use. It is triggered when a chaincode receives an instantiate or upgrade transaction.
When the application client proposes an update or query transaction, the Invoke(); function is called.
Query() is called when a chaincode queries a chaincode state. Hyperledger Fabric uses LevelDB (key/value store) as the default database to store world;state ...
Read now
Unlock full access