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) errorApplyDevLightMode applies --dev-light settings to viper. This is equivalent to --dev --low-memory.
BuildFlagSet
func BuildFlagSet() *pflag.FlagSetBuildFlagSet 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) stringGPUBackend
func GPUBackend() stringGPUBackend returns the configured GPU backend.
GetNodeConfig
func GetNodeConfig(v *viper.Viper) (node.Config, error)IsGPUEnabled
func IsGPUEnabled() boolIsGPUEnabled 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) errorSetGlobalGPUConfig 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) stringfunc (c *ChainDatabaseConfig) Validate() errorGPUConfig
GPUConfig holds GPU acceleration configuration.
func DefaultGPUConfig() GPUConfigfunc GetGlobalGPUConfig() GPUConfigfunc (c GPUConfig) ResolveBackend() stringfunc (c GPUConfig) Validate() errorLowMemoryConfig
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() LowMemoryConfigfunc GetLowMemoryConfig(v *viper.Viper) LowMemoryConfigfunc GetMemoryConfigForProfile(profile MemoryProfile) LowMemoryConfigfunc NewLowMemoryConfig() LowMemoryConfigfunc NewMaxMemoryConfig() LowMemoryConfigfunc (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) *ZapDBConfigfunc (c *ZapDBConfig) Validate(dataDir string) error