Documentation
¶
Index ¶
Constants ¶
const CC_INVOKE_BROADCAST = "chaincode.invoke.broadcast"
const CC_INVOKE_PROPOSAL = "chaincode.invoke.proposal"
Variables ¶
This section is empty.
Functions ¶
func NewCollectionConfig ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client enables access to a channel on a Fabric network.
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.
func New ¶
func New(channelProvider context.ChannelProvider, opts ...ClientOption) (*Client, error)
New returns a Client instance. Channel client can query chaincode, execute chaincode and register/unregister for chaincode events on specific channel.
func (*Client) Execute ¶
Execute prepares and executes transaction using request and optional request options
Parameters: request holds info about mandatory chaincode ID and function options holds optional request options Returns: the proposal responses from peer(s)
func (*Client) InvokeHandler ¶
func (cc *Client) InvokeHandler(handler invoke.Handler, request ch.Request, options ...RequestOption) (ch.Response, error)
InvokeHandler invokes handler using request and optional request options provided
Parameters: handler to be invoked request holds info about mandatory chaincode ID and function options holds optional request options Returns: the proposal responses from peer(s)
type ClientOption ¶
ClientOption describes a functional parameter for the New constructor
type CollectionConfig ¶
type RequestOption ¶
RequestOption func for each Opts argument
func WithTargetEndpoints ¶
func WithTargetEndpoints(keys ...string) RequestOption
WithTargetEndpoints allows overriding of the target peers for the request. Targets are specified by name or URL, and the SDK will create the underlying peer objects.
func WithTimeout ¶
func WithTimeout(timeoutType fab.TimeoutType, timeout time.Duration) RequestOption
WithTimeout encapsulates key value pairs of timeout type, timeout duration to Options