channel

package
v1.0.0-alpha3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package channel enables access to a channel on a Fabric network.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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.

func (*Client) Execute

func (cc *Client) Execute(request Request, options ...RequestOption) (Response, error)

Execute prepares and executes transaction using request and optional options provided

func (*Client) InvokeHandler

func (cc *Client) InvokeHandler(handler invoke.Handler, request Request, options ...RequestOption) (Response, error)

InvokeHandler invokes handler using request and options provided

func (*Client) Query

func (cc *Client) Query(request Request, options ...RequestOption) (Response, error)

Query chaincode using request and optional options provided

func (*Client) RegisterChaincodeEvent

func (cc *Client) RegisterChaincodeEvent(chainCodeID string, eventFilter string) (fab.Registration, <-chan *fab.CCEvent, 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

func (*Client) UnregisterChaincodeEvent

func (cc *Client) UnregisterChaincodeEvent(registration fab.Registration)

UnregisterChaincodeEvent removes chain code event registration

type ClientOption

type ClientOption func(*Client) error

ClientOption describes a functional parameter for the New constructor

type Request

type Request struct {
	ChaincodeID  string
	Fcn          string
	Args         [][]byte
	TransientMap map[string][]byte
}

Request contains the parameters to query and execute an invocation transaction

type RequestOption

type RequestOption func(ctx context.Client, opts *requestOptions) error

RequestOption func for each Opts argument

func WithParentContext

func WithParentContext(parentContext reqContext.Context) RequestOption

WithParentContext encapsulates grpc context parent to Options

func WithRetry

func WithRetry(retryOpt retry.Opts) RequestOption

WithRetry option to configure retries

func WithTargetFilter

func WithTargetFilter(filter fab.TargetFilter) RequestOption

WithTargetFilter specifies a per-request target peer-filter

func WithTargetURLs

func WithTargetURLs(urls ...string) RequestOption

WithTargetURLs allows overriding of the target peers for the request. Targets are specified by URL, and the SDK will create the underlying peer objects.

func WithTargets

func WithTargets(targets ...fab.Peer) RequestOption

WithTargets encapsulates ProposalProcessors to Option

func WithTimeout

func WithTimeout(timeoutType core.TimeoutType, timeout time.Duration) RequestOption

WithTimeout encapsulates key value pairs of timeout type, timeout duration to Options

type Response

type Response struct {
	Payload          []byte
	TransactionID    fab.TransactionID
	TxValidationCode pb.TxValidationCode
	Proposal         *fab.TransactionProposal
	Responses        []*fab.TransactionProposalResponse
}

Response contains response parameters for query and execute an invocation transaction

Directories

Path Synopsis
Package invoke provides the handlers for performing chaincode invocations.
Package invoke provides the handlers for performing chaincode invocations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL