profiles

package
v1.16.44 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package profiles provides embedded network tuning profiles for the Lux SDK. These profiles configure consensus, health, and network parameters for different deployment scenarios (mainnet, testnet, devnet, dev mode).

Available profiles:

  • standard: Conservative mainnet settings for production-safe operation
  • fast: Balanced testnet settings for development
  • turbo: Aggressive 5-node local network with 3/5 quorum
  • ultra: Maximum aggression for single-node dev mode with K=1 consensus

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultProfileForNetwork

func DefaultProfileForNetwork(networkName string) string

DefaultProfileForNetwork returns the default profile name for a network type. For local development, all networks use turbo for ultra-fast consensus.

func GetProfileMap

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

GetProfileMap loads a profile and returns it as map[string]interface{}. Useful for direct JSON manipulation.

func ListProfiles

func ListProfiles() []string

ListProfiles returns names of all available profiles, sorted alphabetically.

func ValidateProfile

func ValidateProfile(data map[string]interface{}) error

ValidateProfile checks that a profile has required fields.

Types

type ConsensusConfig

type ConsensusConfig struct {
	SampleSize            int    `json:"sample-size"`
	PreferenceQuorumSize  int    `json:"preference-quorum-size"`
	ConfidenceQuorumSize  int    `json:"confidence-quorum-size"`
	CommitThreshold       int    `json:"commit-threshold"`
	ConcurrentRepolls     int    `json:"concurrent-repolls"`
	OptimalProcessing     int    `json:"optimal-processing"`
	MaxProcessing         int    `json:"max-processing"`
	FrontierPollFreq      string `json:"frontier-poll-frequency"`
	ProposerMinBlockDelay string `json:"proposer-min-block-delay,omitempty"`
}

ConsensusConfig holds consensus tuning parameters.

type HealthConfig

type HealthConfig struct {
	CheckFrequency   string `json:"check-frequency"`
	AveragerHalflife string `json:"averager-halflife"`
}

HealthConfig holds health check tuning parameters.

type NetworkConfig

type NetworkConfig struct {
	MaxReconnectDelay     string `json:"max-reconnect-delay"`
	InitialReconnectDelay string `json:"initial-reconnect-delay"`
	InitialTimeout        string `json:"initial-timeout"`
	MinimumTimeout        string `json:"minimum-timeout"`
	MaximumTimeout        string `json:"maximum-timeout"`
	TimeoutHalflife       string `json:"timeout-halflife"`
	ReadHandshakeTimeout  string `json:"read-handshake-timeout"`
	PingTimeout           string `json:"ping-timeout"`
	PingFrequency         string `json:"ping-frequency"`
}

NetworkConfig holds network tuning parameters.

type Profile

type Profile struct {
	Name        string          `json:"name"`
	Description string          `json:"description"`
	Consensus   ConsensusConfig `json:"consensus"`
	Health      HealthConfig    `json:"health"`
	Network     NetworkConfig   `json:"network"`
}

Profile represents a network tuning profile.

func GetProfile

func GetProfile(name string) (*Profile, error)

GetProfile loads a profile by name. Returns error if profile not found or invalid.

func MustGetProfile

func MustGetProfile(name string) *Profile

MustGetProfile loads a profile by name or panics on error.

func (*Profile) ToNodeConfig

func (p *Profile) ToNodeConfig() map[string]interface{}

ToNodeConfig converts a profile to luxd node configuration flags. Returns a map of flag keys to values suitable for JSON config.

Jump to

Keyboard shortcuts

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