Type Method
start(with:)
Validates a BitcoinConfig and starts the daemon with its arguments.
static func start<N>(with config: BitcoinConfig<N>) throws(ConfigError) where N : BitcoinNetwork
Parameters
-
config
-
The validated configuration to start the daemon with.
Mentioned In
Discussion
Validation is performed before any daemon process is started. If a fatal ConfigError is thrown, the daemon is never started and Daemon.waitUntilStopped() must not be called.
Non-fatal warnings are printed to stdout with an ⚠️ prefix.
let auth = RPCAuth(username: "user", salt: "abc", passwordHMAC: "def")
let config = BitcoinConfig.regtest().rpcAuth(auth).server()
try Daemon.start(with: config)
Daemon.waitUntilStopped()
Throws
ConfigError if the configuration contains a fatal conflict.