fabric-sdk-go: github.com/hyperledger/fabric-sdk-go/pkg/client/channel/invoke Index | Files

package invoke

import "github.com/hyperledger/fabric-sdk-go/pkg/client/channel/invoke"

Package invoke provides the handlers for performing chaincode invocations.

Index

Package Files

api.go selectendorsehandler.go signature.go txnhandler.go

type CCFilter Uses

type CCFilter func(ccID string) bool

CCFilter returns true if the given chaincode should be included in the invocation chain when computing endorsers.

func NewChainedCCFilter Uses

func NewChainedCCFilter(filters ...CCFilter) CCFilter

NewChainedCCFilter returns a chaincode filter that chains multiple filters together. False is returned if at least one of the filters in the chain returns false.

type ClientContext Uses

type ClientContext struct {
    CryptoSuite  core.CryptoSuite
    Discovery    fab.DiscoveryService
    Selection    fab.SelectionService
    Membership   fab.ChannelMembership
    Transactor   fab.Transactor
    EventService fab.EventService
}

ClientContext contains context parameters for handler execution

type CommitTxHandler Uses

type CommitTxHandler struct {
    // contains filtered or unexported fields
}

CommitTxHandler for committing transactions

func NewCommitHandler Uses

func NewCommitHandler(next ...Handler) *CommitTxHandler

NewCommitHandler returns a handler that commits transaction propsal responses

func (*CommitTxHandler) Handle Uses

func (c *CommitTxHandler) Handle(requestContext *RequestContext, clientContext *ClientContext)

Handle handles commit tx

type EndorsementHandler Uses

type EndorsementHandler struct {
    // contains filtered or unexported fields
}

EndorsementHandler for handling endorse transactions

func NewEndorsementHandler Uses

func NewEndorsementHandler(next ...Handler) *EndorsementHandler

NewEndorsementHandler returns a handler that endorses a transaction proposal

func NewEndorsementHandlerWithOpts Uses

func NewEndorsementHandlerWithOpts(next Handler, provider TxnHeaderOptsProvider) *EndorsementHandler

NewEndorsementHandlerWithOpts returns a handler that endorses a transaction proposal

func (*EndorsementHandler) Handle Uses

func (e *EndorsementHandler) Handle(requestContext *RequestContext, clientContext *ClientContext)

Handle for endorsing transactions

type EndorsementValidationHandler Uses

type EndorsementValidationHandler struct {
    // contains filtered or unexported fields
}

EndorsementValidationHandler for transaction proposal response filtering

func NewEndorsementValidationHandler Uses

func NewEndorsementValidationHandler(next ...Handler) *EndorsementValidationHandler

NewEndorsementValidationHandler returns a handler that validates an endorsement

func (*EndorsementValidationHandler) Handle Uses

func (f *EndorsementValidationHandler) Handle(requestContext *RequestContext, clientContext *ClientContext)

Handle for Filtering proposal response

type Handler Uses

type Handler interface {
    Handle(context *RequestContext, clientContext *ClientContext)
}

Handler for chaining transaction executions

func NewExecuteHandler Uses

func NewExecuteHandler(next ...Handler) Handler

NewExecuteHandler returns execute handler with chain of SelectAndEndorseHandler, EndorsementValidationHandler, SignatureValidationHandler and CommitHandler

func NewQueryHandler Uses

func NewQueryHandler(next ...Handler) Handler

NewQueryHandler returns query handler with chain of ProposalProcessorHandler, EndorsementHandler, EndorsementValidationHandler and SignatureValidationHandler

func NewSelectAndEndorseHandler Uses

func NewSelectAndEndorseHandler(next ...Handler) Handler

NewSelectAndEndorseHandler returns a new SelectAndEndorseHandler

type Opts Uses

type Opts struct {
    Targets       []fab.Peer // targets
    TargetFilter  fab.TargetFilter
    TargetSorter  fab.TargetSorter
    Retry         retry.Opts
    BeforeRetry   retry.BeforeRetryHandler
    Timeouts      map[fab.TimeoutType]time.Duration
    ParentContext reqContext.Context //parent grpc context
    CCFilter      CCFilter
}

Opts allows the user to specify more advanced options

type ProposalProcessorHandler Uses

type ProposalProcessorHandler struct {
    // contains filtered or unexported fields
}

ProposalProcessorHandler for selecting proposal processors

func NewProposalProcessorHandler Uses

func NewProposalProcessorHandler(next ...Handler) *ProposalProcessorHandler

NewProposalProcessorHandler returns a handler that selects proposal processors

func (*ProposalProcessorHandler) Handle Uses

func (h *ProposalProcessorHandler) Handle(requestContext *RequestContext, clientContext *ClientContext)

Handle selects proposal processors

type Request Uses

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

    // InvocationChain contains meta-data that's used by some Selection Service implementations
    // to choose endorsers that satisfy the endorsement policies of all chaincodes involved
    // in an invocation chain (i.e. for CC-to-CC invocations).
    // Each chaincode may also be associated with a set of private data collection names
    // which are used by some Selection Services (e.g. Fabric Selection) to exclude endorsers
    // that do NOT have read access to the collections.
    // The invoked chaincode (specified by ChaincodeID) may optionally be added to the invocation
    // chain along with any collections, otherwise it may be omitted.
    InvocationChain []*fab.ChaincodeCall
}

Request contains the parameters to execute transaction

type RequestContext Uses

type RequestContext struct {
    Request         Request
    Opts            Opts
    Response        Response
    Error           error
    RetryHandler    retry.Handler
    Ctx             reqContext.Context
    SelectionFilter selectopts.PeerFilter
    PeerSorter      selectopts.PeerSorter
}

RequestContext contains request, opts, response parameters for handler execution

type Response Uses

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

Response contains response parameters for query and execute transaction

type SelectAndEndorseHandler Uses

type SelectAndEndorseHandler struct {
    *EndorsementHandler
    // contains filtered or unexported fields
}

SelectAndEndorseHandler selects endorsers according to the policies of the chaincodes in the provided invocation chain and then sends the proposal to those endorsers. The read/write sets from the responses are then checked to see if additional chaincodes were invoked that were not in the original invocation chain. If so, a new endorser set is computed with the additional chaincodes and (if necessary) endorsements are requested from those additional endorsers.

func (*SelectAndEndorseHandler) Handle Uses

func (e *SelectAndEndorseHandler) Handle(requestContext *RequestContext, clientContext *ClientContext)

Handle selects endorsers and sends proposals to the endorsers

type SignatureValidationHandler Uses

type SignatureValidationHandler struct {
    // contains filtered or unexported fields
}

SignatureValidationHandler for transaction proposal response filtering

func NewSignatureValidationHandler Uses

func NewSignatureValidationHandler(next ...Handler) *SignatureValidationHandler

NewSignatureValidationHandler returns a handler that validates an endorsement

func (*SignatureValidationHandler) Handle Uses

func (f *SignatureValidationHandler) Handle(requestContext *RequestContext, clientContext *ClientContext)

Handle for Filtering proposal response

type TxnHeaderOptsProvider Uses

type TxnHeaderOptsProvider func() []fab.TxnHeaderOpt

TxnHeaderOptsProvider provides transaction header options which allow the provider to specify a custom creator and/or nonce.

Package invoke imports 18 packages (graph) and is imported by 1 packages. Updated 2019-08-24. Refresh now. Tools for package owners.