rpc

package
v0.38.0-preview.0.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: AGPL-3.0 Imports: 29 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultMaxBlockRange = 300

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ListenAddr        string
	MaxMsgSize        uint // In bytes
	RpcMetricsEnabled bool // enable GRPC metrics reporting
}

Config defines the configurable options for the gRPC 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,
	config Config,
	scriptsExecutor exeEng.ScriptExecutor,
	headers storage.Headers,
	state protocol.State,
	events storage.Events,
	exeResults storage.ExecutionResults,
	txResults storage.TransactionResults,
	commits storage.Commits,
	transactionMetrics metrics.TransactionExecutionMetricsProvider,
	chainID flow.ChainID,
	signerIndicesDecoder hotstuff.BlockSignerDecoder,
	apiRatelimits map[string]int,
	apiBurstLimits map[string]int,
) *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.

Jump to

Keyboard shortcuts

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