common

package
v0.2403.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SentryAddresses []node.TLSAddress

	TxPool tpConfig.Config
	// contains filtered or unexported fields
}

Config contains common worker config.

func NewConfig

func NewConfig() (*Config, error)

NewConfig creates a new worker config.

type Worker

type Worker struct {
	HostNode        control.NodeController
	DataDir         string
	ChainContext    string
	Identity        *identity.Identity
	Consensus       consensus.Backend
	LightClient     consensus.LightClient
	P2P             p2p.Service
	KeyManager      keymanagerApi.Backend
	RuntimeRegistry runtimeRegistry.Registry
	// contains filtered or unexported fields
}

Worker is a garbage bag with lower level services and common runtime objects.

func New

func New(
	hostNode control.NodeController,
	dataDir string,
	chainContext string,
	identity *identity.Identity,
	consensus consensus.Backend,
	lightClient consensus.LightClient,
	p2p p2p.Service,
	keyManager keymanagerApi.Backend,
	runtimeRegistry runtimeRegistry.Registry,
) (*Worker, error)

New creates a new worker.

func (*Worker) Cleanup

func (w *Worker) Cleanup()

Cleanup performs the service specific post-termination cleanup.

func (*Worker) Enabled

func (w *Worker) Enabled() bool

Enabled returns if worker is enabled.

func (*Worker) GetConfig

func (w *Worker) GetConfig() Config

GetConfig returns the worker's configuration.

func (*Worker) GetRuntime

func (w *Worker) GetRuntime(id common.Namespace) *committee.Node

GetRuntime returns a common committee node for the given runtime (if available).

In case the runtime with the specified id was not configured for this node it returns nil.

func (*Worker) GetRuntimes

func (w *Worker) GetRuntimes() map[common.Namespace]*committee.Node

GetRuntimes returns a map of configured runtimes.

func (*Worker) Initialized

func (w *Worker) Initialized() <-chan struct{}

Initialized returns a channel that will be closed when the transaction scheduler is initialized and ready to service requests.

func (*Worker) Name

func (w *Worker) Name() string

Name returns the service name.

func (*Worker) Quit

func (w *Worker) Quit() <-chan struct{}

Quit returns a channel that will be closed when the service terminates.

func (*Worker) Start

func (w *Worker) Start() error

Start starts the service.

func (*Worker) Stop

func (w *Worker) Stop()

Stop halts the service.

Directories

Path Synopsis
p2p

Jump to

Keyboard shortcuts

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