Skip to content

Instantly share code, notes, and snippets.

@himani1
Last active June 20, 2017 05:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save himani1/b6fcd3c1b968e970ab9861a2b861ff7e to your computer and use it in GitHub Desktop.
Save himani1/b6fcd3c1b968e970ab9861a2b861ff7e to your computer and use it in GitHub Desktop.
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