Bitcoin BitcoinConfig Structure BitcoinConfig A type-safe, fluent builder for Bitcoin Core CLI arguments. struct BitcoinConfig<N> where N : BitcoinNetwork Mentioned In Getting Started with Bitcoin (Embedded Daemon) Overview BitcoinConfig accumulates validated -key=value arguments and tracks conflict-relevant state in a ConfigFlags bitmask. Call validate() before passing the config to Daemon.start(with:) to surface warnings and errors. Create configs exclusively via the static factory methods: BitcoinConfig.mainnet() BitcoinConfig.regtest() The initializer is intentionally internal — phantom typing requires that the network type is always inferred from the factory call site. Topics Instance Properties var arguments: [String]The accumulated CLI argument list, ready to pass to Daemon.start(_:). Instance Methods func acceptNonStdTxn(Bool) -> BitcoinConfig<N>Relay non-standard transactions that are otherwise rejected. func acceptStaleFeeEstimates(Bool) -> BitcoinConfig<N>Accept stale fee estimates (useful in regtest where blocks arrive on demand and the fee estimator has no data). func addNode(String) -> BitcoinConfig<N>Add a peer node to connect to and attempt to keep connected. func addressType(AddressType) -> BitcoinConfig<N>The default address type for new receiving addresses. func alertNotify(String) -> BitcoinConfig<N>Execute a command when a relevant alert is received. func assumeValid(String) -> BitcoinConfig<N>If set, skip validation of scripts in blocks before this block hash. func avoidPartialSpends(Bool) -> BitcoinConfig<N>Group inputs by address to avoid linking addresses. func banTime(UInt) -> BitcoinConfig<N>Number of seconds misbehaving peers are banned (default 86400). func bind(String) -> BitcoinConfig<N>Bind to a specific address and port for incoming connections. func blockFilterIndex(BlockFilterMode) -> BitcoinConfig<N>Maintain compact block filters for peer and personal use. func blockMaxSize(UInt) -> BitcoinConfig<N>Maximum block size for legacy (pre-segwit) block templates in bytes. func blockMaxWeight(UInt) -> BitcoinConfig<N>Maximum block weight for mined blocks in weight units (default 3,996,000). func blockMinTxFee(FeeRate) -> BitcoinConfig<N>Minimum fee rate for transactions to be included in block templates (BTC/kvB). func blockNotify(String) -> BitcoinConfig<N>Execute a command when the best block changes. func blockVersion(Int) -> BitcoinConfig<N>Override the block version for newly mined blocks. func blocksDir(String) -> BitcoinConfig<N>Specify blocks directory. func blocksOnly(Bool) -> BitcoinConfig<N>Do not accept transactions from remote peers (blocks-only mode). func bytesPerSigOp(UInt) -> BitcoinConfig<N>Equivalent number of bytes per sigop in transactions for relay/mining. func changeType(AddressType) -> BitcoinConfig<N>The default address type for change outputs. func checkBlocks(UInt) -> BitcoinConfig<N>How many recent blocks to check on startup (0 = all, default 6). func checkLevel(UInt) -> BitcoinConfig<N>Thoroughness of block and chain validation (0–4, default 3). func coinStatsIndex(Bool) -> BitcoinConfig<N>Maintain coinstats index used by the gettxoutsetinfo RPC. func conf(String) -> BitcoinConfig<N>Path to the bitcoin.conf configuration file. func connect(String) -> BitcoinConfig<N>Connect only to the specified node(s); disables peer discovery. func daemon(Bool) -> BitcoinConfig<N>Run in the background as a daemon. func daemonWait(Bool) -> BitcoinConfig<N>Wait for initialization to be finished before exiting (with -daemon). func dataCarrier(Bool) -> BitcoinConfig<N>Relay and mine OP_RETURN data carrier transactions. func dataCarrierSize(UInt) -> BitcoinConfig<N>Maximum bytes of data in OP_RETURN outputs (default 83). func dataDir(String) -> BitcoinConfig<N>Specify data directory. func dbCache(UInt) -> BitcoinConfig<N>Set database cache size in MiB (minimum 4 MiB). func debug(DebugCategory) -> BitcoinConfig<N>Enable logging for the specified category. func debugExclude(DebugCategory) -> BitcoinConfig<N>Exclude a category from debug logging. func disableWallet(Bool) -> BitcoinConfig<N>Disable the wallet and all wallet RPC calls. func discardFee(FeeRate) -> BitcoinConfig<N>Fee rate below which change outputs are omitted as dust (BTC/kvB). func discover(Bool) -> BitcoinConfig<N>Discover own IP address (default 1 unless -externalip or -proxy is set). func dns(Bool) -> BitcoinConfig<N>Allow DNS lookups for -addnode, -seednode, and -connect. func dnsSeed(Bool) -> BitcoinConfig<N>Query for peer addresses via DNS lookup on startup. func dustRelayFee(FeeRate) -> BitcoinConfig<N>Fee rate used to define dust outputs (BTC/kvB). func externalIP(IPAddress) -> BitcoinConfig<N>Specify your own public IP address. func fallbackFee(FeeRate) -> BitcoinConfig<N>Fallback fee rate if fee estimation is unavailable (BTC/kvB). func fastPrune(Bool) -> BitcoinConfig<N>Allow mining of blocks with near-zero difficulty (regtest only). func includeConf(String) -> BitcoinConfig<N>Specify an additional configuration file to include. func incrementalRelayFee(FeeRate) -> BitcoinConfig<N>Minimum fee rate increment for mempool limiting or BIP 125 replacement (BTC/kvB). func keypool(UInt) -> BitcoinConfig<N>Set the pre-generated key pool size. func limitAncestorCount(UInt) -> BitcoinConfig<N>Maximum number of in-mempool ancestors for a transaction (default 25). func limitDescendantCount(UInt) -> BitcoinConfig<N>Maximum number of in-mempool descendants for a transaction (default 25). func listen(Bool) -> BitcoinConfig<N>Accept incoming connections from peers. func listenOnion(Bool) -> BitcoinConfig<N>Automatically create and use a Tor hidden service. func loadBlock(String) -> BitcoinConfig<N>Import blocks from an external blk*.dat file on startup. func logIPs(Bool) -> BitcoinConfig<N>Include IP addresses in debug output. func logLevel(LogLevel) -> BitcoinConfig<N>Set the verbosity level for all log categories. func logSourceLocations(Bool) -> BitcoinConfig<N>Prepend log messages with the source location (file + line number). func logThreadNames(Bool) -> BitcoinConfig<N>Prepend log messages with the name of the thread that generated them. func logTimestamps(Bool) -> BitcoinConfig<N>Prepend log messages with a timestamp. func maxConnections(UInt) -> BitcoinConfig<N>Maintain at most N connections to peers. func maxMempool(UInt) -> BitcoinConfig<N>Keep the transaction memory pool below this many MiB (minimum 5 MiB). func maxReceiveBuffer(UInt) -> BitcoinConfig<N>Maximum per-connection receive buffer in kilobytes. func maxSendBuffer(UInt) -> BitcoinConfig<N>Maximum per-connection send buffer in kilobytes. func maxSigCacheSize(UInt) -> BitcoinConfig<N>Maximum size of the signature cache in MiB (default 32). func maxTxFee(FeeRate) -> BitcoinConfig<N>Maximum total fees to use in a single wallet transaction (BTC). func maxUploadTarget(UInt) -> BitcoinConfig<N>Target daily data upload cap across all peers in MiB (0 = no limit). func mempoolExpiry(UInt) -> BitcoinConfig<N>Evict transactions from the mempool after this many hours (minimum 1). func minRelayTxFee(FeeRate) -> BitcoinConfig<N>Minimum relay fee rate — transactions below this rate are not relayed (BTC/kvB). func minTxFee(FeeRate) -> BitcoinConfig<N>Minimum fee rate for wallet transactions (BTC/kvB). func mockTime(UInt) -> BitcoinConfig<N>Set the internal clock to a fixed UNIX timestamp for deterministic testing. Use 0 to restore real-time. func networkActive(Bool) -> BitcoinConfig<N>Disable all P2P network activity. func onion(String) -> BitcoinConfig<N>Use a SOCKS5 proxy for connections to the Tor network. func onlyNet(NetworkType) -> BitcoinConfig<N>Only connect to nodes via the specified network type. func par(Int) -> BitcoinConfig<N>Set the number of script verification threads (-par). Use 0 for auto, negative to leave that many cores free. func peerBlockFilters(Bool) -> BitcoinConfig<N>Serve compact block filters to peers per BIP 157 / BIP 158. func peerBloomFilters(Bool) -> BitcoinConfig<N>Support filtering of blocks and transactions with bloom filters (BIP37). func permitBareMultisig(Bool) -> BitcoinConfig<N>Allow relay of bare (non-P2SH-wrapped) multisig transactions. func persistMempool(Bool) -> BitcoinConfig<N>Save the mempool to disk on shutdown and load it on startup. func pid(String) -> BitcoinConfig<N>Specify PID file path (only used when -daemon is set). func port(UInt16) -> BitcoinConfig<N>Listen for peer connections on the specified port. func printToConsole(Bool) -> BitcoinConfig<N>Send log output to stdout instead of debug.log. func privateBroadcast(Bool) -> BitcoinConfig<N>Broadcast own transactions only via Tor or I2P (v31+). func proxy(String) -> BitcoinConfig<N>Connect to peers via a SOCKS5 proxy. func proxyRandomize(Bool) -> BitcoinConfig<N>Randomize credentials for every proxy connection (for privacy). func prune(PruneMode) -> BitcoinConfig<N>Enable pruning to reduce storage requirements. func raw(String) -> BitcoinConfig<N>Appends a raw CLI argument string for options not yet modeled by the typed API. func reindex() -> BitcoinConfig<N>Rebuild chain state and block index on startup. func reindexChainstate() -> BitcoinConfig<N>Rebuild chain state only (faster than full reindex). func rpcAllowIP(IPAddress) -> BitcoinConfig<N>Allow JSON-RPC connections from the specified address. func rpcAuth(RPCAuth) -> BitcoinConfig<N>Credentials for JSON-RPC connections. func rpcBind(IPAddress) -> BitcoinConfig<N>Bind to the given address for the RPC interface. func rpcCookieFile(String) -> BitcoinConfig<N>Path to the RPC authentication cookie file. func rpcCookiePerms(String) -> BitcoinConfig<N>Unix file permission mode for the RPC cookie file (e.g. "0600"). func rpcPort(UInt16) -> BitcoinConfig<N>Listen for RPC connections on this port. func rpcSerialVersion(UInt) -> BitcoinConfig<N>Set the serialization format for certain RPC results. func rpcThreads(UInt) -> BitcoinConfig<N>Number of RPC server threads (1–64, default 4). func rpcWhitelist(String) -> BitcoinConfig<N>Set a whitelist to filter incoming RPC calls. func rpcWhitelistDefault(Bool) -> BitcoinConfig<N>Sets default behavior for rpc whitelisting. func rpcWorkQueue(UInt) -> BitcoinConfig<N>Depth of the RPC server’s work queue (1–1024, default 16). func seedNode(String) -> BitcoinConfig<N>Connect to a seed node to retrieve peer addresses, then disconnect. func server(Bool) -> BitcoinConfig<N>Accept command line and JSON-RPC commands. func shrinkDebugFile(Bool) -> BitcoinConfig<N>Shrink debug.log on startup if it grows too large. func shutdownNotify(String) -> BitcoinConfig<N>Execute a command before beginning shutdown. func signetChallenge(String) -> BitcoinConfig<N>Override the default signet challenge script. func signetSeedNode(String) -> BitcoinConfig<N>Specify a seed node for the signet network. func spendZeroConfChange(Bool) -> BitcoinConfig<N>Spend unconfirmed change from your own transactions. func startupNotify(String) -> BitcoinConfig<N>Execute a command after startup is complete. func stopAtHeight(UInt) -> BitcoinConfig<N>Stop syncing and exit after reaching this block height. Useful for benchmarking or reproducible test environments. func testActivationHeight(String) -> BitcoinConfig<N>Activate a particular soft fork at a given height. func timeout(UInt) -> BitcoinConfig<N>Peer connection timeout in milliseconds (default 5000). func torControl(String) -> BitcoinConfig<N>Tor control port address (default "127.0.0.1:9051"). func torPassword(String) -> BitcoinConfig<N>Tor control port password. func txConfirmTarget(UInt) -> BitcoinConfig<N>Estimate fee sufficient for confirmation within this many blocks. func txIndex(Bool) -> BitcoinConfig<N>Maintain a full transaction index (txindex=1). func txoSpenderIndex(Bool) -> BitcoinConfig<N>Maintain a transaction output spender index (v31+). func validate() throws(ConfigError) -> [ConfigWarning]Validates the configuration for cross-field conflicts. func vbParams(String) -> BitcoinConfig<N>Override version bits parameters for named soft forks. func wallet(String) -> BitcoinConfig<N>Specify which wallet file(s) to load on startup (relative to -walletdir). func walletBroadcast(Bool) -> BitcoinConfig<N>Make the wallet broadcast its transactions to the network. func walletDir(String) -> BitcoinConfig<N>Specify the directory to hold wallet files. func walletNotify(String) -> BitcoinConfig<N>Execute a command when a wallet transaction changes. func walletRbf(Bool) -> BitcoinConfig<N>Use Replace-By-Fee (RBF) signaling on all new transactions. func whiteBind(String) -> BitcoinConfig<N>Whitelist peers connecting on the given address:port. func whitelistForceRelay(Bool) -> BitcoinConfig<N>Force relay of transactions from whitelisted peers, bypassing filters. func whitelistRelay(Bool) -> BitcoinConfig<N>Relay transactions received from whitelisted peers even if they would normally not be relayed. func zmqPubHashBlock(ZMQEndpoint) -> BitcoinConfig<N>Publish block hashes (32 bytes) to the given ZMQ endpoint. func zmqPubHashBlockHwm(UInt) -> BitcoinConfig<N>Maximum number of block-hash messages queued before dropping (default 1000). func zmqPubHashTx(ZMQEndpoint) -> BitcoinConfig<N>Publish transaction hashes (32 bytes) to the given ZMQ endpoint. func zmqPubHashTxHwm(UInt) -> BitcoinConfig<N>Maximum number of transaction-hash messages queued before dropping (default 1000). func zmqPubRawBlock(ZMQEndpoint) -> BitcoinConfig<N>Publish raw block data to the given ZMQ endpoint. func zmqPubRawBlockHwm(UInt) -> BitcoinConfig<N>Maximum number of raw block messages queued before dropping (default 1000). func zmqPubRawTx(ZMQEndpoint) -> BitcoinConfig<N>Publish raw transaction data to the given ZMQ endpoint. func zmqPubRawTxHwm(UInt) -> BitcoinConfig<N>Maximum number of raw transaction messages queued before dropping (default 1000). func zmqPubSequence(ZMQEndpoint) -> BitcoinConfig<N>Publish mempool and chain sequence events to the given ZMQ endpoint. func zmqPubSequenceHwm(UInt) -> BitcoinConfig<N>Maximum number of sequence messages queued before dropping (default 1000). Type Methods static func fullNode(rpcAuth: RPCAuth) -> BitcoinConfig<N>A full (non-pruned) mainnet node with transaction index. static func lightningEclair(rpcAuth: RPCAuth) -> BitcoinConfig<N>A node tuned for use with the Eclair Lightning Network daemon. static func lowBandwidth(rpcAuth: RPCAuth) -> BitcoinConfig<N>A bandwidth-constrained node, suitable for metered connections. static func mainnet() -> BitcoinConfig<Mainnet>Creates a configuration for Bitcoin mainnet. static func mining(rpcAuth: RPCAuth) -> BitcoinConfig<N>A full node configured for solo mining. static func nonSyncing(rpcAuth: RPCAuth) -> BitcoinConfig<N>A node with all networking disabled, suitable for offline signing, air-gapped validation, or reproducible testing against a fixed chain state. static func prunedDefault(rpcAuth: RPCAuth) -> BitcoinConfig<N>A pruned mainnet node with block filters and RPC server enabled. static func raspberryPi(rpcAuth: RPCAuth) -> BitcoinConfig<N>A resource-constrained node tuned for single-board computers (e.g. Raspberry Pi). static func regtest() -> BitcoinConfig<Regtest>Creates a configuration for Bitcoin regtest. static func regtestDefault(rpcAuth: RPCAuth) -> BitcoinConfig<N>A regtest node bound to localhost, suitable for development and testing. static func signet() -> BitcoinConfig<Signet>Creates a configuration for Bitcoin signet. static func testnet() -> BitcoinConfig<Testnet>Creates a configuration for Bitcoin testnet3. static func testnet4() -> BitcoinConfig<Testnet4>Creates a configuration for Bitcoin testnet4. static func torNode(rpcAuth: RPCAuth) -> BitcoinConfig<N>A node routing all traffic through Tor for privacy.