rpc

package
v0.14.1-access-node-in... Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: AGPL-3.0 Imports: 22 Imported by: 3 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPServer

func NewHTTPServer(
	grpcServer *grpc.Server,
	address string,
) *http.Server

NewHTTPServer creates and intializes a new HTTP GRPC proxy server

Types

type Config

type Config struct {
	GRPCListenAddr          string        // the GRPC server address as ip:port
	HTTPListenAddr          string        // the HTTP web proxy address as ip:port
	ExecutionAddr           string        // the address of the upstream execution node
	CollectionAddr          string        // the address of the upstream collection node
	HistoricalAccessAddrs   string        // the list of all access nodes from previous spork
	MaxMsgSize              int           // GRPC max message size
	ExecutionClientTimeout  time.Duration // execution API GRPC client timeout
	CollectionClientTimeout time.Duration // collection API GRPC client timeout
}

Config defines the configurable options for the access node server

type Engine

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

Engine implements a gRPC server with a simplified version of the Observation API.

func New

func New(log zerolog.Logger,
	state protocol.State,
	config Config,
	executionRPC execproto.ExecutionAPIClient,
	collectionRPC accessproto.AccessAPIClient,
	historicalAccessNodes []accessproto.AccessAPIClient,
	blocks storage.Blocks,
	headers storage.Headers,
	collections storage.Collections,
	transactions storage.Transactions,
	executionReceipts storage.ExecutionReceipts,
	chainID flow.ChainID,
	transactionMetrics module.TransactionMetrics,
	collectionGRPCPort uint,
	executionGRPCPort uint,
	retryEnabled bool,
	rpcMetricsEnabled bool,
) *Engine

New returns a new RPC engine.

func (*Engine) Done

func (e *Engine) Done() <-chan struct{}

Done returns a done channel that is closed once the engine has fully stopped. It sends a signal to stop the gRPC server, then closes the channel.

func (*Engine) Ready

func (e *Engine) Ready() <-chan struct{}

Ready returns a ready channel that is closed once the engine has fully started. The RPC engine is ready when the gRPC server has successfully started.

func (*Engine) SubmitLocal

func (e *Engine) SubmitLocal(event interface{})

SubmitLocal submits an event originating on the local node.

type HTTPHeader

type HTTPHeader struct {
	Key   string
	Value string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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