Skip to content

Instantly share code, notes, and snippets.

@himani1
Last active Jun 20, 2017
Embed
What would you like to do?
func (t *SampleChaincode) Init(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {
if len(args) != 1 {
       return nil, errors.New("Incorrect number of arguments. Expecting 1")
   }
   err := stub.PutState("emp_name", []byte(args[0]))
   if err != nil {
       return nil, err
   }
   return nil, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment