Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelClient ¶
type ChannelClient interface {
// Query chaincode with request and optional options provided
Query(request Request, opts ...Option) (Response, error)
// Execute execute transaction with request and optional options provided
Execute(request Request, opts ...Option) (Response, error)
// InvokeHandler invokes the given handler with the given request and optional options provided
InvokeHandler(handler Handler, request Request, options ...Option) (Response, error)
// 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
RegisterChaincodeEvent(notify chan<- *CCEvent, chainCodeID string, eventID string) (Registration, error)
// UnregisterChaincodeEvent unregisters chain code event
UnregisterChaincodeEvent(registration Registration) error
// Close releases channel client resources (disconnects event hub etc.)
Close() error
}
ChannelClient ...
- A channel client instance provides a handler to interact with peers on specified channel.
- An application that requires interaction with multiple channels should create a separate
- instance of the channel client for each channel. Channel client supports non-admin functions only. *
- Each Client instance maintains {@link Channel} instance representing channel and the associated
- private ledgers. *
type ClientContext ¶
type ClientContext struct {
CryptoSuite apicryptosuite.CryptoSuite
Channel apifabclient.Channel
Discovery apifabclient.DiscoveryService
Selection apifabclient.SelectionService
EventHub apifabclient.EventHub
}
ClientContext contains context parameters for handler execution
type Handler ¶
type Handler interface {
Handle(context *RequestContext, clientContext *ClientContext)
}
Handler for chaining transaction executions
type Option ¶
Option func for each Opts argument
func WithProposalProcessor ¶
func WithProposalProcessor(proposalProcessors ...apifabclient.ProposalProcessor) Option
WithProposalProcessor encapsulates ProposalProcessors to Option
func WithTimeout ¶
WithTimeout encapsulates time.Duration to Option
type Opts ¶
type Opts struct {
ProposalProcessors []apifabclient.ProposalProcessor // targets
Timeout time.Duration
Retry retry.Opts
}
Opts allows the user to specify more advanced options
type Registration ¶
type Registration interface {
}
Registration is a handle that is returned from a successful Register Chaincode Event. This handle should be used in Unregister in order to unregister the event.
type RequestContext ¶
type RequestContext struct {
Request Request
Opts Opts
Response Response
Error error
RetryHandler retry.Handler
}
RequestContext contains request, opts, response parameters for handler execution
type Response ¶
type Response struct {
Payload []byte
TransactionID apifabclient.TransactionID
TxValidationCode pb.TxValidationCode
Responses []*apifabclient.TransactionProposalResponse
}
Response contains response parameters for query and execute transaction