March 2019
Intermediate to advanced
636 pages
27h 50m
English
To trigger the invoke function, you can call the name of the chaincode application function and pass shim.ChaincodeStubInterface as the signature. In the insurance claim case, we defined several functions to support our use case, for example:
AddCompany, ReportLost, RequestedInfo, SubmitClaim, ConfirmClaimSubmission, ApproveClaim.
We also defined a query to keep track of the current claim request and getHistory to get all of the historical claim transaction records, as follows:
func (c *ClaimContract) Invoke(stub shim.ChaincodeStubInterface) pb.Response { function, args := stub.GetFunctionAndParameters() if function == "AddCompany" { return c.AddCompany(stub, args) } else if function == "ReportLost" { return c.ReportLost(stub, ...Read now
Unlock full access