Skip to content

Instantly share code, notes, and snippets.

@vitiko
Last active May 20, 2018 14:23
Show Gist options
  • Save vitiko/d6584aca56c468a0cb5af8c068f9c84f to your computer and use it in GitHub Desktop.
Save vitiko/d6584aca56c468a0cb5af8c068f9c84f to your computer and use it in GitHub Desktop.
type ChaincodeStubInterface interface {
// GetArgs returns the arguments intended for the chaincode Init and Invoke
GetArgs() [][]byte
// InvokeChaincode locally calls the specified chaincode
InvokeChaincode(chaincodeName string, args [][]byte, channel string) pb.Response
// GetState returns the value of the specified `key` from the ledger.
GetState(key string) ([]byte, error)
// PutState puts the specified `key` and `value` into the transaction's writeset as a data-write proposal.
PutState(key string, value []byte) error
// DelState records the specified `key` to be deleted in the writeset of the transaction proposal.
DelState(key string) error
// GetStateByRange returns a range iterator over a set of keys in the ledger.
GetStateByRange(startKey, endKey string) (StateQueryIteratorInterface, error)
// CreateCompositeKey combines the given `attributes` to form a composite key.
CreateCompositeKey(objectType string, attributes []string) (string, error)
// GetCreator returns `SignatureHeader.Creator` (e.g. an identity of the agent (or user) submitting the transaction.
GetCreator() ([]byte, error)
// and many more methods
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment