config

package
v0.0.0-...-c504f8e Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsFullChainNetwork

func IsFullChainNetwork(n Network) bool

IsFullChainNetwork reports whether the network has full mainnet-scale block volume (mainnet / forknet). Callers gate IBD-only RPC throttling on this — signet / testnet / regtest blocks are small or empty so running scans through their IBD doesn't move the needle on Core load.

Types

type Config

type Config struct {
	Version bool `long:"version" short:"v" description:"Print version information and exit"`

	EnforcerHost     string `long:"enforcer.host" description:"host:port for connecting to the enforcer server" default:"localhost:50051"`
	OrchestratorAddr string `long:"orchestrator.addr" description:"URL for connecting to the orchestrator daemon" default:"http://localhost:30400"`

	APIHost string `long:"api.host" env:"API_HOST" description:"public address for the connect server" default:"localhost:30301"`
	Datadir string `long:"datadir" description:"Path to the data directory"`

	LogPath  string `long:"log.path" description:"Path to write logs to"`
	LogLevel string `long:"log.level" description:"Log level" default:"info" env:"LOG_LEVEL"`

	GuiBootedMainchain bool `` /* 140-byte string literal not displayed */
	GuiBootedEnforcer  bool `` /* 139-byte string literal not displayed */

	SyncToHeight uint32 `long:"sync-to-height" description:"Sync to this height and then exit"`

	// BitcoinCoreNetwork is set by Finalize from orchestratord — never from
	// CLI flags. Used downstream for Datadir scoping and chain-params lookup.
	BitcoinCoreNetwork Network `no-flag:"true"`
	// contains filtered or unexported fields
}

Config holds bitwindowd's runtime configuration. Network identity is **not** declared here as a CLI flag — bitwindowd sources it from orchestratord at startup via [Finalize] so it is always aligned with orchestrator's view of the world. bitcoind RPC creds aren't needed either: bitwindowd dials orchestratord's hosted BitcoinService for any bitcoind call.

func Parse

func Parse() (Config, error)

func (*Config) BitwindowDir

func (c *Config) BitwindowDir() string

BitwindowDir returns the parent dir before the per-network suffix is appended in Finalize. wallet.json lives here.

func (*Config) Finalize

func (c *Config) Finalize(network Network) error

Finalize sets the network (sourced from orchestratord by the caller) and appends the per-network suffix to Datadir. Idempotent — re-running on network swap recomputes paths from the original base, so suffixes don't stack across swaps.

func (*Config) IsDemoMode

func (c *Config) IsDemoMode() bool

IsDemoMode returns true when running on mainnet, enabling demo mode with simulated sidechain data instead of requiring an enforcer connection.

type Network

type Network string
const (
	NetworkMainnet Network = "mainnet"
	NetworkForknet Network = "forknet"
	NetworkRegtest Network = "regtest"
	NetworkSignet  Network = "signet"
	NetworkTestnet Network = "testnet"
)

Jump to

Keyboard shortcuts

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