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 ¶
DefaultProfileForNetwork returns the default profile name for a network type. For local development, all networks use turbo for ultra-fast consensus.
func GetProfileMap ¶
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 ¶
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 ¶
GetProfile loads a profile by name. Returns error if profile not found or invalid.
func MustGetProfile ¶
MustGetProfile loads a profile by name or panics on error.
func (*Profile) ToNodeConfig ¶
ToNodeConfig converts a profile to luxd node configuration flags. Returns a map of flag keys to values suitable for JSON config.