Skip to content

Commit 1fb3c16

Browse files
committed
Add doc/bitcoin-conf.md
1 parent 23419e4 commit 1fb3c16

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

doc/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ The Bitcoin repo's [root README](/README.md) contains relevant information on th
6969

7070
### Miscellaneous
7171
- [Assets Attribution](assets-attribution.md)
72+
- [bitcoin.conf Configuration File](bitcoin-conf.md)
7273
- [Files](files.md)
7374
- [Fuzz-testing](fuzzing.md)
7475
- [Reduce Traffic](reduce-traffic.md)

doc/bitcoin-conf.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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

Comments
 (0)