|
| 1 | +# `bitcoin.conf` Configuration File |
| 2 | + |
| 3 | +The configuration file is used by `bitcoind`, `bitcoin-qt` and `bitcoin-cli`. |
| 4 | + |
| 5 | +All command-line options (except for `-?`, `-help`, `-version` and `-conf`) may be specified in a configuration file, and all configuration file options (except for `includeconf`) may also be specified on the command line. Command-line options override values set in the configuration file and configuration file options override values set in the GUI. |
| 6 | + |
| 7 | +## Configuration File Format |
| 8 | + |
| 9 | +The configuration file is a plain text file and consists of `option=value` entries, one per line. Leading and trailing whitespaces are removed. |
| 10 | + |
| 11 | +In contrast to the command-line usage: |
| 12 | +- an option must be specified without leading `-`; |
| 13 | +- a value of the given option is mandatory; e.g., `testnet=1` (for chain selection options), `noconnect=1` (for negated options). |
| 14 | + |
| 15 | +### Blank lines |
| 16 | + |
| 17 | +Blank lines are allowed and ignored by the parser. |
| 18 | + |
| 19 | +### Comments |
| 20 | + |
| 21 | +A comment starts with a number sign (`#`) and extends to the end of the line. All comments are ignored by the parser. |
| 22 | + |
| 23 | +Comments may appear in two ways: |
| 24 | +- on their own on an otherwise empty line (_preferable_); |
| 25 | +- after an `option=value` entry. |
| 26 | + |
| 27 | +### Network specific options |
| 28 | + |
| 29 | +Network specific options can be: |
| 30 | +- placed into sections with headers `[main]` (not `[mainnet]`), `[test]` (not `[testnet]`) or `[regtest]`; |
| 31 | +- prefixed with a chain name; e.g., `regtest.maxmempool=100`. |
| 32 | + |
| 33 | +## Configuration File Path |
| 34 | + |
| 35 | +The configuration file is not automatically created; you can create it using your favorite text editor. By default, the configuration file name is `bitcoin.conf` and it is located in the Bitcoin data directory, but both the Bitcoin data directory and the configuration file path may be changed using the `-datadir` and `-conf` command-line options. |
| 36 | + |
| 37 | +The `includeconf=<file>` option in the `bitcoin.conf` file can be used to include additional configuration files. |
0 commit comments