Additional SHIM API functions

In this section, we provide an overview of the remaining API functions of shim available to chaincode.

 // Returns an unique Id of the transaction proposal. 
func GetTxID() string 
 
// Returns an Id of the channel the transaction proposal was sent to. 
func GetChannelID() string 
 
// Calls an Invoke function on a specified chaincode, in the context of the current transaction. 
// If the invoked chaincode is on the same channel, the ReadSet and WriteSet will be added into the same transaction. 
// If the invoked chaincode is on a different channel, the invocation can be used only as a query. 
func InvokeChaincode(chaincodeName string, args [][]byte, channel string) pb.Response 
 
// Returns a list of historical states, timestamps and transactions ids. 
func GetHistoryForKey(key string) (HistoryQueryIteratorInterface, error) 
 
// Returns the identity of the user submitting the transaction proposal. 
func GetCreator() ([]byte, error) 
 
// Returns a map of fields containing cryptographic material which may be used to implement custom privacy layer in the chaincode. 
func GetTransient() (map[string][]byte, error) 
 
// Returns data which can be used to enforce a link between application data and the transaction proposal. 
func GetBinding() ([]byte, error) 
 
// Returns data produced by peer decorators which modified the chaincode input. 
func GetDecorations() map[string][]byte 
 
// Returns data elements of a transaction proposal. 
func GetSignedProposal() (*pb.SignedProposal, error) 
 
// Returns a timestamp of the transaction creation by the client. The timestamp is consistent across all endorsers. 
func GetTxTimestamp() (*timestamp.Timestamp, error) 
 
// Sets an event attached to the transaction proposal response. This event will be be included in the block and ledger. 
func SetEvent(name string, payload []byte) error  
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset