<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Bitcoin",
  "identifier" : "/documentation/Bitcoin/Daemon/start(with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Bitcoin"
    ],
    "preciseIdentifier" : "s:7Bitcoin6DaemonO5start4withyAA0A6ConfigVyxG_tAA0E5ErrorOYKAA0A7NetworkRzlFZ"
  },
  "title" : "start(with:)"
}
-->

# 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.

## 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.

```swift
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.