// invoke
// Every functions that read and write in the ledger will be here

invoke
Every functions that read and write in the ledger will be here
// invoke // Every functions that read and write in the ledger will be here
func (t *HeroesServiceChaincode) invoke(stub shim.ChaincodeStubInterface, args []string) pb.Response {
	fmt.Println("########### HeroesServiceChaincode invoke ###########")
	if len(args) < 2 {
		return shim.Error("The number of arguments is insufficient.")
	}
	sreAsBytes, err := stub.GetState(args[1])
	if err != nil {
		return shim.Error("Failed to get sre: " + err.Error())
	} else if sreAsBytes != nil {	
		err = stub.PutState(args[1], []byte(args[2]))
		if err != nil {
			return shim.Error("Failed to update state of sre")
		}
		err = stub.SetEvent("eventInvoke", []byte{})
		if err != nil {
			return shim.Error(err.Error())
		}
		return shim.Success(nil)
	}
	return shim.Error("This sreno not exists")
}
func ( t * HeroesServiceChaincode ) invoke ( stub shim . ChaincodeStubInterface , args [ ] string ) pb . Response { fmt . Println ( " " ) if len ( args ) < 2 { return shim . Error ( " " ) } sreAsBytes , err := stub . GetState ( args [ 1 ] ) if err != nil { return shim . Error ( " " + err . Error ( ) ) } else if sreAsBytes != nil { err = stub . PutState ( args [ 1 ] , [ ] byte ( args [ 2 ] ) ) if err != nil { return shim . Error ( " " ) } err = stub . SetEvent ( " " , [ ] byte { } ) if err != nil { return shim . Error ( err . Error ( ) ) } return shim . Success ( nil ) } return shim . Error ( " " ) }
invoke
Every functions that read and write in the ledger will be here
invoke Every functions that read and write in the ledger will be here
//cmd := strings.SplitN(args[2], "γ", -1)	
 //	NoState := cmd[0]
 //	OptMan := cmd[1]
 //	OptAdd := cmd[2]
 //	OptDev := cmd[3]
 // Notify listeners that an event "eventInvoke" have been executed (check line 19 in the file invoke.go)
