core

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Feature

type Feature interface {
	features.FeatureInterface
	Start() error
	Stop() error
	Reload() error
	CheckCompatibility(nodeVersion string) error
}

Feature interface that all features must implement

type FeatureConfig

type FeatureConfig struct {
	Features struct {
		Enabled            bool `toml:"enabled"`
		AutoReload         bool `toml:"auto_reload"`
		CheckCompatibility bool `toml:"check_compatibility"`

		QuantumSigning struct {
			Enabled        bool `toml:"enabled"`
			DilithiumMode  int  `toml:"dilithium_mode"`
			QuantumHeaders bool `toml:"quantum_headers"`
			EnableMetrics  bool `toml:"enable_metrics"`
			MaxLatencyMs   int  `toml:"max_latency_ms"`
		} `toml:"quantum_signing"`

		StateSync struct {
			Enabled        bool `toml:"enabled"`
			FastSync       bool `toml:"fast_sync"`
			ChunkSize      int  `toml:"chunk_size"`
			MaxConcurrent  int  `toml:"max_concurrent"`
			TimeoutSeconds int  `toml:"timeout_seconds"`
		} `toml:"state_sync"`

		ZKRollup struct {
			Enabled            bool `toml:"enabled"`
			EnableProofs       bool `toml:"enable_proofs"`
			EnableVerification bool `toml:"enable_verification"`
			BatchSize          int  `toml:"batch_size"`
			ProofTimeout       int  `toml:"proof_timeout"`
		} `toml:"zk_rollup"`

		Distribution struct {
			UseGitSubmodules bool   `toml:"use_git_submodules"`
			AutoUpdate       bool   `toml:"auto_update"`
			RepositoryURL    string `toml:"repository_url"`
			Branch           string `toml:"branch"`
		} `toml:"distribution"`

		Compatibility struct {
			MinNodeVersion string `toml:"min_node_version"`
			MaxNodeVersion string `toml:"max_node_version"`
			APIVersion     string `toml:"api_version"`
		} `toml:"compatibility"`
	} `toml:"features"`
}

FeatureConfig represents the configuration for features

type FeatureLoader

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

FeatureLoader handles loading and managing features

func NewFeatureLoader

func NewFeatureLoader(configPath string, nodeVersion string) *FeatureLoader

NewFeatureLoader creates a new feature loader

func (*FeatureLoader) GetFeatureManager

func (fl *FeatureLoader) GetFeatureManager() *FeatureManager

GetFeatureManager returns the feature manager

func (*FeatureLoader) GetFeatureStatus

func (fl *FeatureLoader) GetFeatureStatus() map[string]interface{}

GetFeatureStatus returns the status of all features

func (*FeatureLoader) InitializeFeatures

func (fl *FeatureLoader) InitializeFeatures() error

InitializeFeatures initializes all features based on configuration

func (*FeatureLoader) LoadConfiguration

func (fl *FeatureLoader) LoadConfiguration() error

LoadConfiguration loads the feature configuration from file

func (*FeatureLoader) ReloadFeatures

func (fl *FeatureLoader) ReloadFeatures() error

ReloadFeatures reloads all features

func (*FeatureLoader) StartFeatures

func (fl *FeatureLoader) StartFeatures() error

StartFeatures starts all enabled features

func (*FeatureLoader) StopFeatures

func (fl *FeatureLoader) StopFeatures() error

StopFeatures stops all features

func (*FeatureLoader) ValidateConfiguration

func (fl *FeatureLoader) ValidateConfiguration() error

ValidateConfiguration validates the feature configuration

type FeatureManager

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

FeatureManager manages all features in the Fluentum node

func NewFeatureManager

func NewFeatureManager(nodeVersion string) *FeatureManager

NewFeatureManager creates a new feature manager

func (*FeatureManager) DisableFeature

func (fm *FeatureManager) DisableFeature(name string) error

DisableFeature disables a specific feature

func (*FeatureManager) EnableFeature

func (fm *FeatureManager) EnableFeature(name string) error

EnableFeature enables a specific feature

func (*FeatureManager) GetFeature

func (fm *FeatureManager) GetFeature(name string) (Feature, bool)

GetFeature returns a feature by name

func (*FeatureManager) GetFeatureStatus

func (fm *FeatureManager) GetFeatureStatus() map[string]interface{}

GetFeatureStatus returns the status of all features

func (*FeatureManager) InitializeFeatures

func (fm *FeatureManager) InitializeFeatures() error

InitializeFeatures initializes all features with their configurations

func (*FeatureManager) ListFeatures

func (fm *FeatureManager) ListFeatures() []string

ListFeatures returns a list of all registered features

func (*FeatureManager) LoadFeatures

func (fm *FeatureManager) LoadFeatures() error

LoadFeatures loads all available features

func (*FeatureManager) RegisterFeature

func (fm *FeatureManager) RegisterFeature(feature Feature) error

RegisterFeature registers a feature with the manager

func (*FeatureManager) ReloadAllFeatures

func (fm *FeatureManager) ReloadAllFeatures() error

ReloadAllFeatures reloads all features

func (*FeatureManager) ReloadFeature

func (fm *FeatureManager) ReloadFeature(name string) error

ReloadFeature reloads a specific feature

func (*FeatureManager) SetFeatureConfig

func (fm *FeatureManager) SetFeatureConfig(name string, config map[string]interface{})

SetFeatureConfig sets the configuration for a feature

func (*FeatureManager) StartFeatures

func (fm *FeatureManager) StartFeatures() error

StartFeatures starts all enabled features

func (*FeatureManager) StopFeatures

func (fm *FeatureManager) StopFeatures() error

StopFeatures stops all features

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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