Documentation ¶
Overview ¶
Package chclient enables channel client
Index ¶
- type ChannelClient
- func (cc *ChannelClient) Close() error
- func (cc *ChannelClient) ExecuteTx(request apitxn.ExecuteTxRequest) (apitxn.TransactionID, error)
- func (cc *ChannelClient) ExecuteTxWithOpts(request apitxn.ExecuteTxRequest, opts apitxn.ExecuteTxOpts) (apitxn.TransactionID, error)
- func (cc *ChannelClient) Query(request apitxn.QueryRequest) ([]byte, error)
- func (cc *ChannelClient) QueryWithOpts(request apitxn.QueryRequest, opts apitxn.QueryOpts) ([]byte, error)
- func (cc *ChannelClient) RegisterChaincodeEvent(notify chan<- *apitxn.CCEvent, chainCodeID string, eventID string) apitxn.Registration
- func (cc *ChannelClient) UnregisterChaincodeEvent(registration apitxn.Registration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelClient ¶
type ChannelClient struct {
// contains filtered or unexported fields
}
ChannelClient enables access to a Fabric network.
func NewChannelClient ¶
func NewChannelClient(client fab.FabricClient, channel fab.Channel, discovery fab.DiscoveryService, selection fab.SelectionService, eventHub fab.EventHub) (*ChannelClient, error)
NewChannelClient returns a ChannelClient instance.
func (*ChannelClient) Close ¶
func (cc *ChannelClient) Close() error
Close releases channel client resources (disconnects event hub etc.)
func (*ChannelClient) ExecuteTx ¶
func (cc *ChannelClient) ExecuteTx(request apitxn.ExecuteTxRequest) (apitxn.TransactionID, error)
ExecuteTx prepares and executes transaction
func (*ChannelClient) ExecuteTxWithOpts ¶
func (cc *ChannelClient) ExecuteTxWithOpts(request apitxn.ExecuteTxRequest, opts apitxn.ExecuteTxOpts) (apitxn.TransactionID, error)
ExecuteTxWithOpts allows the user to provide options for execute transaction: sync vs async, filter to inspect proposal response before commit etc)
func (*ChannelClient) Query ¶
func (cc *ChannelClient) Query(request apitxn.QueryRequest) ([]byte, error)
Query chaincode
func (*ChannelClient) QueryWithOpts ¶
func (cc *ChannelClient) QueryWithOpts(request apitxn.QueryRequest, opts apitxn.QueryOpts) ([]byte, error)
QueryWithOpts allows the user to provide options for query (sync vs async, etc.)
func (*ChannelClient) RegisterChaincodeEvent ¶
func (cc *ChannelClient) RegisterChaincodeEvent(notify chan<- *apitxn.CCEvent, chainCodeID string, eventID string) apitxn.Registration
RegisterChaincodeEvent registers chain code event @param {chan bool} channel which receives event details when the event is complete @returns {object} object handle that should be used to unregister
func (*ChannelClient) UnregisterChaincodeEvent ¶
func (cc *ChannelClient) UnregisterChaincodeEvent(registration apitxn.Registration) error
UnregisterChaincodeEvent removes chain code event registration