orchestrator

package
v1.14.13 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BridgeConfig

type BridgeConfig struct {
	Type        string            `yaml:"type" json:"type"` // awm, ibc, ccip
	Source      string            `yaml:"source" json:"source"`
	Destination string            `yaml:"destination" json:"destination"`
	RelayerKey  string            `yaml:"relayer_key,omitempty" json:"relayer_key,omitempty"`
	Contracts   map[string]string `yaml:"contracts,omitempty" json:"contracts,omitempty"`
}

BridgeConfig defines bridge configuration between engines

type EngineConfig

type EngineConfig struct {
	Name         string                 `yaml:"name" json:"name"`
	Type         string                 `yaml:"type" json:"type"` // lux, lux, geth, op, eth2
	Binary       string                 `yaml:"binary,omitempty" json:"binary,omitempty"`
	NetworkID    uint32                 `yaml:"network_id" json:"network_id"`
	HTTPPort     uint16                 `yaml:"http_port,omitempty" json:"http_port,omitempty"`
	WSPort       uint16                 `yaml:"ws_port,omitempty" json:"ws_port,omitempty"`
	StakingPort  uint16                 `yaml:"staking_port,omitempty" json:"staking_port,omitempty"`
	DataDir      string                 `yaml:"data_dir,omitempty" json:"data_dir,omitempty"`
	LogLevel     string                 `yaml:"log_level,omitempty" json:"log_level,omitempty"`
	BootstrapIPs []string               `yaml:"bootstrap_ips,omitempty" json:"bootstrap_ips,omitempty"`
	Extra        map[string]interface{} `yaml:"extra,omitempty" json:"extra,omitempty"`
	WaitHealthy  bool                   `yaml:"wait_healthy,omitempty" json:"wait_healthy,omitempty"`
	DependsOn    []string               `yaml:"depends_on,omitempty" json:"depends_on,omitempty"`

	// OP Stack specific
	L1RPC     string `yaml:"l1_rpc,omitempty" json:"l1_rpc,omitempty"`
	Sequencer bool   `yaml:"sequencer,omitempty" json:"sequencer,omitempty"`

	// Eth2 specific
	ConsensusClient  string `yaml:"consensus_client,omitempty" json:"consensus_client,omitempty"`
	ExecutionClient  string `yaml:"execution_client,omitempty" json:"execution_client,omitempty"`
	ValidatorEnabled bool   `yaml:"validator_enabled,omitempty" json:"validator_enabled,omitempty"`
}

EngineConfig defines an engine configuration

type EngineInfo

type EngineInfo struct {
	Name      string
	Type      string
	NetworkID uint32
	ChainID   string
	RPC       string
	WS        string
	Healthy   bool
	Uptime    time.Duration
}

EngineInfo contains engine information

type EngineMetrics

type EngineMetrics struct {
	Name        string
	LastUpdated time.Time
	Values      map[string]interface{}
	History     []MetricSnapshot
}

EngineMetrics contains metrics for an engine

type EngineOptions

type EngineOptions struct {
	NetworkID    uint32
	HTTPPort     uint16
	WSPort       uint16
	StakingPort  uint16
	DataDir      string
	LogLevel     string
	Binary       string
	BootstrapIPs []string
	Extra        map[string]interface{}
}

EngineOptions contains options for starting an engine

type EngineState

type EngineState struct {
	Name      string  `json:"name"`
	Type      string  `json:"type"`
	NetworkID uint32  `json:"network_id"`
	ChainID   string  `json:"chain_id"`
	RPC       string  `json:"rpc"`
	WS        string  `json:"ws"`
	Uptime    float64 `json:"uptime_seconds"`
}

EngineState represents the state of an engine

type EngineStatus

type EngineStatus struct {
	Type   string
	Health *engines.HealthStatus
}

EngineStatus contains engine status information

type Host

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

Host manages multiple consensus engines

func NewHost

func NewHost() *Host

NewHost creates a new multi-engine host

func (*Host) GetAllStatus

func (h *Host) GetAllStatus(ctx context.Context) (map[string]*EngineStatus, error)

GetAllStatus returns status of all engines

func (*Host) GetMetrics

func (h *Host) GetMetrics() map[string]*EngineMetrics

GetMetrics returns collected metrics

func (*Host) ListEngines

func (h *Host) ListEngines() []EngineInfo

ListEngines returns all running engines

func (*Host) LoadState

func (h *Host) LoadState(path string) error

LoadState loads the host state from disk

func (*Host) SaveState

func (h *Host) SaveState(path string) error

SaveState saves the host state to disk

func (*Host) SetupBridge

func (h *Host) SetupBridge(ctx context.Context, bridge *BridgeConfig) error

SetupBridge configures a bridge between engines

func (*Host) StartEngine

func (h *Host) StartEngine(ctx context.Context, name string, typ string, options *EngineOptions) error

StartEngine starts a single engine

func (*Host) StartStack

func (h *Host) StartStack(ctx context.Context, manifest *StackManifest) error

StartStack starts a predefined stack of engines

func (*Host) StopAll

func (h *Host) StopAll(ctx context.Context) error

StopAll stops all running engines

func (*Host) StopEngine

func (h *Host) StopEngine(ctx context.Context, name string) error

StopEngine stops a single engine

func (*Host) StopStack

func (h *Host) StopStack(ctx context.Context, stackName string) error

StopStack stops all engines in a stack

func (*Host) WaitForHealth

func (h *Host) WaitForHealth(ctx context.Context, name string, timeout time.Duration) error

WaitForHealth waits for an engine to be healthy

type HostState

type HostState struct {
	Engines  map[string]*EngineState `json:"engines"`
	Networks map[string]*NetworkInfo `json:"networks"`
}

HostState represents the persistent state of the host

type IndexData

type IndexData struct {
	Engine       string
	LastUpdate   time.Time
	BlockHeight  uint64
	Transactions uint64
	Accounts     uint64
	Extra        map[string]interface{}
}

IndexData contains indexed blockchain data

type Indexer

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

Indexer provides cross-engine blockchain indexing

func NewIndexer

func NewIndexer() *Indexer

NewIndexer creates a new indexer

func (*Indexer) Clear

func (i *Indexer) Clear(engine string)

Clear clears index data for an engine

func (*Indexer) Get

func (i *Indexer) Get(engine string) *IndexData

Get retrieves index data for an engine

func (*Indexer) GetAll

func (i *Indexer) GetAll() map[string]*IndexData

GetAll retrieves all index data

func (*Indexer) Update

func (i *Indexer) Update(engine string, data *IndexData)

Update updates index data for an engine

type MetricSnapshot

type MetricSnapshot struct {
	Timestamp time.Time
	Values    map[string]interface{}
}

MetricSnapshot is a point-in-time metric snapshot

type MetricsCollector

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

MetricsCollector collects metrics from engines

func NewMetricsCollector

func NewMetricsCollector() *MetricsCollector

NewMetricsCollector creates a new metrics collector

func (*MetricsCollector) Clear

func (mc *MetricsCollector) Clear(engine string)

Clear clears metrics for an engine

func (*MetricsCollector) Get

func (mc *MetricsCollector) Get(engine string) *EngineMetrics

Get returns current metrics for an engine

func (*MetricsCollector) GetAll

func (mc *MetricsCollector) GetAll() map[string]*EngineMetrics

GetAll returns all metrics

func (*MetricsCollector) Record

func (mc *MetricsCollector) Record(engine string, values map[string]interface{})

Record records metrics for an engine

func (*MetricsCollector) Summary

func (mc *MetricsCollector) Summary() map[string]interface{}

Summary returns a summary of all metrics

type NetworkConfig

type NetworkConfig struct {
	Name      string   `yaml:"name" json:"name"`
	Type      string   `yaml:"type" json:"type"` // l1, l2, l3
	Engine    string   `yaml:"engine" json:"engine"`
	Parent    string   `yaml:"parent,omitempty" json:"parent,omitempty"`
	ChainID   uint64   `yaml:"chain_id" json:"chain_id"`
	Endpoints []string `yaml:"endpoints,omitempty" json:"endpoints,omitempty"`
}

NetworkConfig defines network topology

type NetworkInfo

type NetworkInfo struct {
	Name      string
	Engine    string
	NetworkID uint32
	ChainID   string
	RPC       string
	WS        string
	Parent    string // parent network name for L2/L3
}

NetworkInfo describes a network's properties

type PortManager

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

PortManager manages port allocation for engines

func NewPortManager

func NewPortManager() *PortManager

NewPortManager creates a new port manager

func (*PortManager) AllocateHTTP

func (pm *PortManager) AllocateHTTP() uint16

AllocateHTTP allocates an HTTP port

func (*PortManager) AllocateP2P

func (pm *PortManager) AllocateP2P() uint16

AllocateP2P allocates a P2P port

func (*PortManager) Release

func (pm *PortManager) Release(port uint16)

Release releases a port

func (*PortManager) Reserve

func (pm *PortManager) Reserve(ports ...uint16) error

Reserve reserves specific ports

type StackManifest

type StackManifest struct {
	Name        string          `yaml:"name" json:"name"`
	Version     string          `yaml:"version" json:"version"`
	Description string          `yaml:"description" json:"description"`
	Engines     []EngineConfig  `yaml:"engines" json:"engines"`
	Bridge      *BridgeConfig   `yaml:"bridge,omitempty" json:"bridge,omitempty"`
	Networks    []NetworkConfig `yaml:"networks,omitempty" json:"networks,omitempty"`
}

StackManifest defines a multi-engine stack configuration

func LoadManifest

func LoadManifest(path string) (*StackManifest, error)

LoadManifest loads a manifest from file

func (*StackManifest) Save

func (m *StackManifest) Save(path string) error

SaveManifest saves a manifest to file

func (*StackManifest) Validate

func (m *StackManifest) Validate() error

Validate validates the manifest

Jump to

Keyboard shortcuts

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