Run NodesReference

node

Package node

import "github.com/luxfi/node/node"

Functions

NewResourceManagerWrapper

func NewResourceManagerWrapper(manager resource.Manager) tracker.ResourceManager

NewResourceManagerWrapper creates a new resource manager wrapper

Types

CoreVM

CoreVM describes a VM that runs in-process (linked into luxd), never loaded from PluginDir and never restricted.

Factory is the concrete in-process factory for VMs whose construction needs no node runtime state (Q, Z) — registerCoreVMs installs these. It is nil for P and X, whose factories must be built with live node dependencies (chainManager, validators, security profile, classical-compat registry) and are therefore registered explicitly in node.go; RegisteredInNodeGo records that ownership so the nil Factory is self-documenting, not a footgun.

HealthConfig

HealthConfig for router health monitoring

Node

Node is an instance of a Lux node.

func New(
	config *node.Config,
	logFactory log.Factory,
	logger log.Logger,
) (*Node, error)
func (n *Node) Dispatch() error
func (n *Node) ExitCode() int
func (n *Node) SecurityProfile() *consensusconfig.ChainSecurityProfile
func (n *Node) Shutdown(exitCode int)

PluginSpec

PluginSpec describes a VM that is loaded ONLY from PluginDir (never linked in-process), and whether its chain is restricted to entitled nodes.

Router

Router handles message routing between chains

func NewRouter(logger log.Logger, timeoutManager timer.AdaptiveTimeoutManager) Router
func NewSimpleRouter(logger log.Logger, timeoutManager timer.AdaptiveTimeoutManager) Router
func Trace(router Router, name string, tracer trace.Tracer) Router

Targeter

Type aliases

ValidatorManager

ValidatorManager wraps the consensus router and handles:

  • Validator connection tracking
  • Beacon connection management for bootstrap
  • Sybil protection weight management
func NewValidatorManager(cfg ValidatorManagerConfig) *ValidatorManager
func (v *ValidatorManager) AddChain(ctx context.Context, chainID ids.ID, h handler.Handler)
func (v *ValidatorManager) Benched(chainID ids.ID, nodeID ids.NodeID)
func (v *ValidatorManager) Connected(nodeID ids.NodeID, nodeVersion *version.Application, netID ids.ID)
func (v *ValidatorManager) Disconnected(nodeID ids.NodeID)
func (v *ValidatorManager) HandleInbound(ctx context.Context, msg message.InboundMessage)
func (v *ValidatorManager) HealthCheck(ctx context.Context) (interface{}, error)
func (v *ValidatorManager) Initialize(
	nodeID ids.NodeID,
	logger log.Logger,
	timeoutManager timer.AdaptiveTimeoutManager,
	gossipFrequency uint64,
	harshQuittersTime uint64,
	harshQuittersSlashingFraction uint64,
	appGossipValidatorSize uint64,
	appGossipNonValidatorSize uint64,
	gossipAcceptedFrontierSize uint64,
	appSendQueueSize uint64,
	peerNotConnectedF uint64,
	connectedPeers ...ids.NodeID,
) error
func (v *ValidatorManager) Shutdown(ctx context.Context)
func (v *ValidatorManager) Unbenched(chainID ids.ID, nodeID ids.NodeID)

ValidatorManagerConfig

ValidatorManagerConfig configures the validator manager