Documentation
¶
Overview ¶
Package config provides configuration loading, validation, and persistence for the Push Universal Validator.
Directory layout:
<NodeHome>/ (default: ~/.puniversal)
├── config/
│ └── pushuv_config.json
├── databases/
│ ├── eip155_1.db
│ └── eip155_97.db
└── relayer/
└── <namespace>.json
Index ¶
Constants ¶
const ( NodeDir = ".puniversal" ConfigSubdir = "config" ConfigFileName = "pushuv_config.json" DatabasesSubdir = "databases" RelayerSubdir = "relayer" )
Variables ¶
This section is empty.
Functions ¶
func DefaultNodeHome ¶ added in v0.0.23
func DefaultNodeHome() string
DefaultNodeHome returns the default node home directory (~/.puniversal).
Types ¶
type ChainSpecificConfig ¶
type ChainSpecificConfig struct {
RPCURLs []string `json:"rpc_urls,omitempty"`
CleanupIntervalSeconds *int `json:"cleanup_interval_seconds,omitempty"`
RetentionPeriodSeconds *int `json:"retention_period_seconds,omitempty"`
EventPollingIntervalSeconds *int `json:"event_polling_interval_seconds,omitempty"`
EventStartFrom *int64 `json:"event_start_from,omitempty"`
GasPriceIntervalSeconds *int `json:"gas_price_interval_seconds,omitempty"`
GasPriceMarkupPercent *int `json:"gas_price_markup_percent,omitempty"` // % markup on fetched gas price to handle spikes
ProtocolALT string `json:"protocol_alt,omitempty"` // Protocol ALT address (base58) for V0 transactions
TokenALTs map[string]string `json:"token_alts,omitempty"` // mint address → token ALT address (base58)
// SVM rent reclaimer (orphaned StoredIxData PDA cleanup). Both default if unset.
RentReclaimSweepIntervalSeconds *int `json:"rent_reclaim_sweep_interval_seconds,omitempty"` // how often to sweep
RentReclaimMinPDAAgeSeconds *int `json:"rent_reclaim_min_pda_age_seconds,omitempty"` // skip PDAs younger than this
}
ChainSpecificConfig holds per-chain configuration.
type Config ¶
type Config struct {
// Logging
LogLevel int `json:"log_level"`
LogFormat string `json:"log_format"`
LogSampler bool `json:"log_sampler"`
// Node
NodeHome string `json:"node_home"`
// Push Chain
PushChainID string `json:"push_chain_id"`
PushChainGRPCURLs []string `json:"push_chain_grpc_urls"`
PushValoperAddress string `json:"push_valoper_address"`
ConfigRefreshIntervalSeconds int `json:"config_refresh_interval_seconds"`
MaxRetries int `json:"max_retries"`
// Query Server
QueryServerPort int `json:"query_server_port"`
// Keyring
KeyringBackend KeyringBackend `json:"keyring_backend"`
KeyringPassword string `json:"keyring_password"`
// Per-chain settings (keyed by CAIP-2 chain ID)
ChainConfigs map[string]ChainSpecificConfig `json:"chain_configs"`
// TSS
TSSP2PPrivateKeyHex string `json:"tss_p2p_private_key_hex"`
TSSP2PListen string `json:"tss_p2p_listen"`
TSSPassword string `json:"tss_password"`
TSSHomeDir string `json:"tss_home_dir"`
}
Config holds all configuration for the Universal Validator.
func Load ¶
Load reads the config from <basePath>/config/pushuv_config.json, applies defaults for any missing fields, and validates.
func LoadDefaultConfig ¶
LoadDefaultConfig loads the embedded default configuration.
func (*Config) GetChainCleanupSettings ¶
func (c *Config) GetChainCleanupSettings(chainID string) (cleanupInterval, retentionPeriod int, err error)
GetChainCleanupSettings returns cleanup settings for a specific chain.
func (*Config) GetChainConfig ¶
func (c *Config) GetChainConfig(chainID string) *ChainSpecificConfig
GetChainConfig returns the configuration for a specific chain, or an empty config if not found.
type KeyringBackend ¶
type KeyringBackend string
KeyringBackend represents the type of keyring backend to use.
const ( KeyringBackendTest KeyringBackend = "test" KeyringBackendFile KeyringBackend = "file" )