Documentation ¶
Index ¶
- func Start(cc Chaincode) error
- type Chaincode
- type ChaincodeStub
- func (stub *ChaincodeStub) DelState(key string) error
- func (stub *ChaincodeStub) GetState(key string) ([]byte, error)
- func (stub *ChaincodeStub) InvokeChaincode(chaincodeName string, function string, args []string) ([]byte, error)
- func (stub *ChaincodeStub) PutState(key string, value []byte) error
- func (stub *ChaincodeStub) QueryChaincode(chaincodeName string, function string, args []string) ([]byte, error)
- func (stub *ChaincodeStub) RangeQueryState(startKey, endKey string) (*StateRangeQueryIterator, error)
- type Handler
- type PeerChaincodeStream
- type StateRangeQueryIterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Chaincode ¶
type Chaincode interface { // Run method will be called during init and for every transaction Run(stub *ChaincodeStub, function string, args []string) ([]byte, error) // Query is to be used for read-only access to chaincode state Query(stub *ChaincodeStub, function string, args []string) ([]byte, error) }
Chaincode is the standard chaincode callback interface that the chaincode developer needs to implement.
type ChaincodeStub ¶
type ChaincodeStub struct {
UUID string
}
ChaincodeStub for shim side handling.
func (*ChaincodeStub) DelState ¶
func (stub *ChaincodeStub) DelState(key string) error
DelState function can be invoked by a chaincode to delete state from the ledger.
func (*ChaincodeStub) GetState ¶
func (stub *ChaincodeStub) GetState(key string) ([]byte, error)
GetState function can be invoked by a chaincode to get a state from the ledger.
func (*ChaincodeStub) InvokeChaincode ¶
func (stub *ChaincodeStub) InvokeChaincode(chaincodeName string, function string, args []string) ([]byte, error)
InvokeChaincode function can be invoked by a chaincode to execute another chaincode.
func (*ChaincodeStub) PutState ¶
func (stub *ChaincodeStub) PutState(key string, value []byte) error
PutState function can be invoked by a chaincode to put state into the ledger.
func (*ChaincodeStub) QueryChaincode ¶
func (stub *ChaincodeStub) QueryChaincode(chaincodeName string, function string, args []string) ([]byte, error)
QueryChaincode function can be invoked by a chaincode to query another chaincode.
func (*ChaincodeStub) RangeQueryState ¶
func (stub *ChaincodeStub) RangeQueryState(startKey, endKey string) (*StateRangeQueryIterator, error)
RangeQueryState function can be invoked by a chaincode to query of a range of keys in the state. Assuming the startKey and endKey are in lexical order, an iterator will be returned that can be used to iterate over all keys between the startKey and endKey, inclusive. The order in which keys are returned by the iterator is random.
type Handler ¶
type Handler struct { sync.RWMutex To string ChatStream PeerChaincodeStream FSM *fsm.FSM // contains filtered or unexported fields }
Handler handler implementation for shim side of chaincode.
type PeerChaincodeStream ¶
type PeerChaincodeStream interface { Send(*pb.ChaincodeMessage) error Recv() (*pb.ChaincodeMessage, error) }
PeerChaincodeStream interface for stream between Peer and chaincode instance.
type StateRangeQueryIterator ¶
type StateRangeQueryIterator struct {
// contains filtered or unexported fields
}
StateRangeQueryIterator allows a chaincode to iterate over a range of key/value pairs in the state.
func (*StateRangeQueryIterator) Close ¶
func (iter *StateRangeQueryIterator) Close() error
Close closes the range query iterator. This should be called when done reading from the iterator to free up resources.
func (*StateRangeQueryIterator) HasNext ¶
func (iter *StateRangeQueryIterator) HasNext() bool
HasNext returns true if the range query iterator contains additional keys and values.