invoke

package
v1.0.0-alpha4 Latest Latest
Warning

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

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

Documentation

Overview

Package invoke provides the handlers for performing chaincode invocations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientContext

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

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

CommitTxHandler for committing transactions

func NewCommitHandler

func NewCommitHandler(next ...Handler) *CommitTxHandler

NewCommitHandler returns a handler that commits transaction propsal responses

func (*CommitTxHandler) Handle

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

Handle handles commit tx

type EndorsementHandler

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

EndorsementHandler for handling endorse transactions

func NewEndorsementHandler

func NewEndorsementHandler(next ...Handler) *EndorsementHandler

NewEndorsementHandler returns a handler that endorses a transaction proposal

func (*EndorsementHandler) Handle

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

Handle for endorsing transactions

type EndorsementValidationHandler

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

EndorsementValidationHandler for transaction proposal response filtering

func NewEndorsementValidationHandler

func NewEndorsementValidationHandler(next ...Handler) *EndorsementValidationHandler

NewEndorsementValidationHandler returns a handler that validates an endorsement

func (*EndorsementValidationHandler) Handle

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

Handle for Filtering proposal response

type Handler

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

Handler for chaining transaction executions

func NewExecuteHandler

func NewExecuteHandler(next ...Handler) Handler

NewExecuteHandler returns query handler with EndorseTxHandler, EndorsementValidationHandler & CommitTxHandler Chained

func NewQueryHandler

func NewQueryHandler(next ...Handler) Handler

NewQueryHandler returns query handler with EndorseTxHandler & EndorsementValidationHandler Chained

type Opts

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

Opts allows the user to specify more advanced options

type ProposalProcessorHandler

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

ProposalProcessorHandler for selecting proposal processors

func NewProposalProcessorHandler

func NewProposalProcessorHandler(next ...Handler) *ProposalProcessorHandler

NewProposalProcessorHandler returns a handler that selects proposal processors

func (*ProposalProcessorHandler) Handle

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

Handle selects proposal processors

type Request

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

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

RequestContext contains request, opts, response parameters for handler execution

type Response

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 SignatureValidationHandler

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

SignatureValidationHandler for transaction proposal response filtering

func NewSignatureValidationHandler

func NewSignatureValidationHandler(next ...Handler) *SignatureValidationHandler

NewSignatureValidationHandler returns a handler that validates an endorsement

func (*SignatureValidationHandler) Handle

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

Handle for Filtering proposal response

Jump to

Keyboard shortcuts

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