gateway

package
v0.0.0-...-9b7ba46 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACLChecker

type ACLChecker interface {
	CheckACL(policyName string, channelName string, data interface{}) error
}

type CommitFinder

type CommitFinder interface {
	TransactionStatus(ctx context.Context, channelName string, transactionID string) (*commit.Status, error)
}

type Discovery

type Discovery interface {
	Config(channel string) (*dp.ConfigResult, error)
	IdentityInfo() gossipapi.PeerIdentitySet
	PeersForEndorsement(channel gossipcommon.ChannelID, interest *peer.ChaincodeInterest) (*dp.EndorsementDescriptor, error)
	PeersOfChannel(gossipcommon.ChannelID) gossipdiscovery.Members
}

type EndorserServerAdapter

type EndorserServerAdapter struct {
	Server peerproto.EndorserServer
}

func (*EndorserServerAdapter) ProcessProposal

type Server

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

Server represents the GRPC server for the Gateway.

func CreateServer

func CreateServer(
	localEndorser peerproto.EndorserServer,
	discovery Discovery,
	peerInstance *peer.Peer,
	secureOptions *comm.SecureOptions,
	policy ACLChecker,
	localMSPID string,
	options config.Options,
	systemChaincodes scc.BuiltinSCCs,
) *Server

CreateServer creates an embedded instance of the Gateway.

func (*Server) ChaincodeEvents

func (gs *Server) ChaincodeEvents(signedRequest *gp.SignedChaincodeEventsRequest, stream gp.Gateway_ChaincodeEventsServer) error

ChaincodeEvents supplies a stream of responses, each containing all the events emitted by the requested chaincode for a specific block. The streamed responses are ordered by ascending block number. Responses are only returned for blocks that contain the requested events, while blocks not containing any of the requested events are skipped. The events within each response message are presented in the same order that the transactions that emitted them appear within the block.

func (*Server) CommitStatus

func (gs *Server) CommitStatus(ctx context.Context, signedRequest *gp.SignedCommitStatusRequest) (*gp.CommitStatusResponse, error)

CommitStatus returns the validation code for a specific transaction on a specific channel. If the transaction is already committed, the status will be returned immediately; otherwise this call will block and return only when the transaction commits or the context is cancelled.

If the transaction commit status cannot be returned, for example if the specified channel does not exist, a FailedPrecondition error will be returned.

func (*Server) Endorse

func (gs *Server) Endorse(ctx context.Context, request *gp.EndorseRequest) (*gp.EndorseResponse, error)

Endorse will collect endorsements by invoking the transaction function specified in the SignedProposal against sufficient Peers to satisfy the endorsement policy.

func (*Server) Evaluate

func (gs *Server) Evaluate(ctx context.Context, request *gp.EvaluateRequest) (*gp.EvaluateResponse, error)

Evaluate will invoke the transaction function as specified in the SignedProposal

func (*Server) Submit

func (gs *Server) Submit(ctx context.Context, request *gp.SubmitRequest) (*gp.SubmitResponse, error)

Submit will send the signed transaction to the ordering service. The response indicates whether the transaction was successfully received by the orderer. This does not imply successful commit of the transaction, only that is has been delivered to the orderer.

Directories

Path Synopsis
Package commit provides an implementation for finding transaction commit status that is specific to the Gateway embedded within a peer.
Package commit provides an implementation for finding transaction commit status that is specific to the Gateway embedded within a peer.
mocks
Code generated by counterfeiter.
Code generated by counterfeiter.
mocks
Code generated by counterfeiter.
Code generated by counterfeiter.
mocks
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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