dash/doc/dash-conf.md
fanquake 48075b81f6 Merge #16448: doc: add note on precedence of options in bitcoin.conf
fa2f991fa23fcc2c96d48fc3dd7faa41c959e8ae doc: add note on precedence of options in bitcoin.conf (Torkel Rogstad)

Pull request description:

  This was a good addition to the docs, but the PR was closed. So I've cherry-picked the commit and fixed up Russ's comments as well as the linter issue.

ACKs for top commit:
  laanwj:
    ACK fa2f991fa23fcc2c96d48fc3dd7faa41c959e8ae
  hebasto:
    ACK fa2f991fa23fcc2c96d48fc3dd7faa41c959e8ae, I have reviewed the code and it looks OK, I agree it can be merged.
  jamesob:
    ACK fa2f991fa2
  jonatack:
    ACK fa2f991fa23fcc2c96d48fc3dd7faa41c959e8ae
  ryanofsky:
    ACK fa2f991fa23fcc2c96d48fc3dd7faa41c959e8ae. Only suggested changes since previous review.

Tree-SHA512: d8e7bac19e85ad32205652c3c3036766c611cae52e6e3e8af66a2da054659d914dc153d0cf4ace9c0fa7b41f2a8d74d0edd8d83fe7e984b93d70c01a388cf8ec
2021-07-12 18:42:39 -05:00

2.2 KiB

dash.conf Configuration File

The configuration file is used by dashd, dash-qt and dash-cli.

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.

Configuration File Format

The configuration file is a plain text file and consists of option=value entries, one per line. Leading and trailing whitespaces are removed.

In contrast to the command-line usage:

  • an option must be specified without leading -;
  • a value of the given option is mandatory; e.g., testnet=1 (for chain selection options), noconnect=1 (for negated options).

Blank lines

Blank lines are allowed and ignored by the parser.

Comments

A comment starts with a number sign (#) and extends to the end of the line. All comments are ignored by the parser.

Comments may appear in two ways:

  • on their own on an otherwise empty line (preferable);
  • after an option=value entry.

Network specific options

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

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 dash.conf and it is located in the Dash data directory, but both the dash data directory and the configuration file path may be changed using the -datadir and -conf command-line options.

The includeconf=<file> option in the dash.conf file can be used to include additional configuration files.