Run NodesReference

config

Package config

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

Functions

ApplyConfigProfile

func ApplyConfigProfile(v *viper.Viper, profile map[string]interface{})

ApplyConfigProfile applies a configuration profile to viper. Profile values are set with lower priority than command-line flags.

ApplyDevLightMode

func ApplyDevLightMode(v *viper.Viper) error

ApplyDevLightMode applies --dev-light settings to viper. This is equivalent to --dev --low-memory.

BuildFlagSet

func BuildFlagSet() *pflag.FlagSet

BuildFlagSet returns a complete set of flags for node

BuildViper

func BuildViper(fs *pflag.FlagSet, args []string) (*viper.Viper, error)

BuildViper returns the viper environment from parsing config file from default search paths and any parsed command line flags

EnvVarName

func EnvVarName(prefix string, key string) string

GPUBackend

func GPUBackend() string

GPUBackend returns the configured GPU backend.

GetNodeConfig

func GetNodeConfig(v *viper.Viper) (node.Config, error)

IsGPUEnabled

func IsGPUEnabled() bool

IsGPUEnabled returns whether GPU acceleration is enabled globally.

LoadConfigProfile

func LoadConfigProfile(name string) (map[string]interface{}, error)

LoadConfigProfile loads a predefined configuration profile from embedded files. Returns the profile as a map for merging with viper.

SetGlobalGPUConfig

func SetGlobalGPUConfig(cfg GPUConfig) error

SetGlobalGPUConfig sets the global GPU configuration. This should be called once during node initialization before any GPU accelerators are created.

Types

BenchlistConfig

BenchlistConfig contains configuration for benchlisting

ChainDatabaseConfig

ChainDatabaseConfig holds per-chain database configuration

func (c *ChainDatabaseConfig) GetDatabaseType(chainAlias string) string
func (c *ChainDatabaseConfig) Validate() error

GPUConfig

GPUConfig holds GPU acceleration configuration.

func DefaultGPUConfig() GPUConfig
func GetGlobalGPUConfig() GPUConfig
func (c GPUConfig) ResolveBackend() string
func (c GPUConfig) Validate() error

LowMemoryConfig

LowMemoryConfig holds memory-related configuration for resource-constrained environments. Default mode uses standard production settings. Low memory mode targets <200MB idle, <500MB under load.

func DefaultLowMemoryConfig() LowMemoryConfig
func GetLowMemoryConfig(v *viper.Viper) LowMemoryConfig
func GetMemoryConfigForProfile(profile MemoryProfile) LowMemoryConfig
func NewLowMemoryConfig() LowMemoryConfig
func NewMaxMemoryConfig() LowMemoryConfig
func (c LowMemoryConfig) EstimatedMemoryUsage() (idle, load uint64)

MemoryProfile

MemoryProfile defines memory usage profiles.

PrismParameters

PrismParameters contains prism protocol parameters

RouterHealthConfig

RouterHealthConfig contains configuration for router health checks

TrackerTargeterConfig

TrackerTargeterConfig contains resource allocation configurations

ZapDBConfig

ZapDB flags for C-Chain

func AddZapDBFlags(fs *flag.FlagSet) *ZapDBConfig
func (c *ZapDBConfig) Validate(dataDir string) error