Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions doc/bitcoin-conf.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@ Network specific options can be:
- placed into sections with headers `[main]` (not `[mainnet]`), `[test]` (not `[testnet]`) or `[regtest]`;
- prefixed with a chain name; e.g., `regtest.maxmempool=100`.

Network specific options take precedence over non-network specific options.
If multiple values for the same option are found with the same precedence, the
first one is generally chosen.

This means that given the following configuration, `regtest.rpcport` is set to `3000`:

```
regtest=1
rpcport=2000
regtest.rpcport=3000
[regtest]
rpcport=4000
```
Copy link
Member

@jonatack jonatack Jul 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you decide that comments in the example configuration are a good idea, here is one (entirely optional) version for your consideration:

regtest=1
rpcport=2000          # Non-network specific `rpcport` option
regtest.rpcport=3000  # 1st network specific `rpcport` option -> value chosen by the parser

[regtest]
rpcport=4000          # 2nd network specific `rpcport` option

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like adding comments would make this pretty noisy, however will leave this up to if anyone else thinks they should be added.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this PR has been merged now but I would have liked more comments here as @jonatack suggested. I didn't understand what was going on. I understand there is a trade-off between informing less experienced users and minimizing noise for more experienced users. Perhaps when the minimizing noise option is chosen a Bitcoin StackExchange page can be set up to include those comments. Resources like Jameson Lopp's Bitcoin Core config generator tool are useful too. Though whether you'd want to provide a link to these resources from within a config file or in a comment within the codebase I don't know...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's better to make a new PR at this point; replying on a deeply nested comment on a merged PR isn't going to make much of a difference

Though whether you'd want to provide a link to these resources from within a config file or in a comment within the codebase I don't know...

Would personally prefer to keep it more or less self-contained, external links might change and tend to go stale.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, understood. Thanks


## Configuration File Path

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.
Expand Down