Documentation
¶
Index ¶
- type BridgeConfig
- type EngineConfig
- type EngineInfo
- type EngineMetrics
- type EngineOptions
- type EngineState
- type EngineStatus
- type Host
- func (h *Host) GetAllStatus(ctx context.Context) (map[string]*EngineStatus, error)
- func (h *Host) GetMetrics() map[string]*EngineMetrics
- func (h *Host) ListEngines() []EngineInfo
- func (h *Host) LoadState(path string) error
- func (h *Host) SaveState(path string) error
- func (h *Host) SetupBridge(ctx context.Context, bridge *BridgeConfig) error
- func (h *Host) StartEngine(ctx context.Context, name string, typ string, options *EngineOptions) error
- func (h *Host) StartStack(ctx context.Context, manifest *StackManifest) error
- func (h *Host) StopAll(ctx context.Context) error
- func (h *Host) StopEngine(ctx context.Context, name string) error
- func (h *Host) StopStack(ctx context.Context, stackName string) error
- func (h *Host) WaitForHealth(ctx context.Context, name string, timeout time.Duration) error
- type HostState
- type IndexData
- type Indexer
- type MetricSnapshot
- type MetricsCollector
- func (mc *MetricsCollector) Clear(engine string)
- func (mc *MetricsCollector) Get(engine string) *EngineMetrics
- func (mc *MetricsCollector) GetAll() map[string]*EngineMetrics
- func (mc *MetricsCollector) Record(engine string, values map[string]interface{})
- func (mc *MetricsCollector) Summary() map[string]interface{}
- type NetworkConfig
- type NetworkInfo
- type PortManager
- type StackManifest
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, avalanche, 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 (*Host) GetAllStatus ¶
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) 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) StopEngine ¶
StopEngine stops a single engine
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
type MetricSnapshot ¶
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 (*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) 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