Documentation
¶
Index ¶
Constants ¶
const ( DefaultDir = paths.ConfigDir DefaultPath = paths.ConfigFile SystemSchema = 1 )
const ( NetworkMainnet = "mainnet" NetworkTestnet4 = "testnet4" NetworkPublicSignet = "public-signet" )
const ( PublicSignetGenesis = "00000008819873e925422c1ff0f99f7cc9bbb232af63a077a480a3633bee1ef6" PublicSignetChallenge = "" /* 142-byte string literal not displayed */ )
The public signet identity is part of the installation contract, not merely a command-line selector. A custom challenge must never be substituted here: any future controlled signet is a separate immutable profile.
const PreferencesSchema = 1
Variables ¶
This section is empty.
Functions ¶
func SavePreferences ¶
func SavePreferences(prefs *Preferences) error
func SupportedNetworks ¶
func SupportedNetworks() []string
SupportedNetworks returns the immutable profile identifiers in stable product order. The returned slice is a new value and may be modified by the caller without changing the profile table.
func ValidateNetwork ¶
Types ¶
type AppConfig ¶
type AppConfig struct {
Schema int `json:"schema"`
Network string `json:"network"`
PruneSize int `json:"prune_size_gb"`
DbCache int `json:"db_cache_mb"`
P2PMode string `json:"p2p_mode"`
P2PAddress string `json:"p2p_address"`
AutoUnlock bool `json:"auto_unlock_enabled"`
SyncthingEnabled bool `json:"syncthing_enabled"`
}
AppConfig is the root-owned, non-secret desired system configuration. It deliberately contains no live daemon observations, credentials, installer lifecycle state, security-workflow markers, or TUI preferences.
func (*AppConfig) NetworkConfig ¶
func (c *AppConfig) NetworkConfig() (*NetworkConfig, error)
type NetworkConfig ¶
type NetworkConfig struct {
Name string
DisplayName string
TestingOnly bool
BitcoinFlag string
BitcoinCLIFlag string
CoreNetwork string
CoreDataDir string
ExpectedGenesis string
ExpectedSignetChallenge string
LNDBitcoinFlag string
LNDNetwork string
RPCPort int
P2PPort int
ZMQBlockPort int
ZMQTxPort int
InvoicePrefix string
AddressPlaceholder string
InvoicePlaceholder string
}
NetworkConfig is the closed, durable deployment profile shared by the installer, lifecycle authority, helpers, wrappers, and TUI. Name is VPN's immutable profile identifier. CoreNetwork and LNDNetwork are deliberately separate upstream identifiers: public-signet maps to "signet" in both daemons and must never use a /public-signet daemon-state directory.
func NetworkConfigFromName ¶
func NetworkConfigFromName(name string) (*NetworkConfig, error)
func (*NetworkConfig) AcceptsInvoicePrefix ¶
func (n *NetworkConfig) AcceptsInvoicePrefix(invoice string) bool
AcceptsInvoicePrefix distinguishes testnet4's lntb HRP from public signet's lntbs HRP. A plain HasPrefix check is unsafe because every lntbs invoice also begins with lntb. After the network prefix, BOLT11 permits either the bech32 separator (amountless invoice) or a decimal amount.
type Preferences ¶
func DefaultPreferences ¶
func DefaultPreferences() *Preferences
func LoadPreferences ¶
func LoadPreferences() (*Preferences, error)
func (*Preferences) Validate ¶
func (p *Preferences) Validate() error
type PreferencesStore ¶
func DefaultPreferencesStore ¶
func DefaultPreferencesStore() (*PreferencesStore, error)
func (*PreferencesStore) Load ¶
func (s *PreferencesStore) Load() (*Preferences, error)
func (*PreferencesStore) Save ¶
func (s *PreferencesStore) Save(prefs *Preferences) error
type Store ¶
type Store struct {
Dir string
Path string
OwnerUID int
GroupGID int
GroupName string
RequireRootWrite bool
}
Store reads and atomically publishes one system-configuration file. The production store requires root for writes and resolves the vpn group at the moment of use. Tests use explicit numeric ownership under an isolated path.
func DefaultStore ¶
func DefaultStore() *Store
func (*Store) Save ¶
Save validates and atomically publishes the desired system configuration. The production store can only be written by root. The parent is verified as a real root-controlled directory, the existing destination (if any) must be the expected regular file, and the replacement is synchronized before and after rename.