October 2018
Intermediate to advanced
530 pages
14h 25m
English
The first step is to create the skeleton of the chaincode. In order for the validator in VSCode not to mess up your progress, it is best to program the skeleton in one step before saving the file. Add the following code to your file:
package mainimport ( "fmt" "github.com/hyperledger/fabric/core/chaincode/shim" pb "github.com/hyperledger/fabric/protos/peer")// InsuranceChaincode smart contract implementation type InsuranceChaincode struct {}
Each chaincode starts with the package declaration. In our case, it is called main. Following this line of code, we need to add a few essential imports, such as "fmt" to print log messages to the console, and most essential, the shim interface and the peer implementation ...
Read now
Unlock full access