|
| 1 | +Raiden Config File |
| 2 | +################## |
| 3 | + |
| 4 | +Raiden supports reading configuration parameters from a configuration file. |
| 5 | + |
| 6 | +Location |
| 7 | +-------- |
| 8 | + |
| 9 | +The default location is ``<datadir>/config.toml`` (where datadir defaults to ``~/.raiden``). |
| 10 | + |
| 11 | +It is possible to override the ``datadir`` in the config file but please be aware that at that point |
| 12 | +the config file will already have been loaded from the default location and therefore won't be |
| 13 | +re-read from the 'new' datadir. |
| 14 | + |
| 15 | +Precedence |
| 16 | +---------- |
| 17 | + |
| 18 | +The precedence order in which configuration option values are applied is as follows (high to low): |
| 19 | + |
| 20 | +#. Option given on the command line |
| 21 | +#. Option read from the config file |
| 22 | +#. Option default value (as seen in the output of ``raiden --help``) |
| 23 | + |
| 24 | + |
| 25 | +Format |
| 26 | +------ |
| 27 | + |
| 28 | +The config file uses the `TOML`_ format. |
| 29 | + |
| 30 | +Option names may be quoted unless they contain punctuation in which case they must be. |
| 31 | +Values except numbers must always be quoted. Both single or double quotes are acceptable. |
| 32 | + |
| 33 | +Lines *starting* with a ``#`` are comments. |
| 34 | + |
| 35 | +.. _TOML: https://github.com/toml-lang/toml |
| 36 | + |
| 37 | + |
| 38 | +Parameter Naming |
| 39 | +---------------- |
| 40 | + |
| 41 | +All parameters that can be given as command line options are also settable in the config file. |
| 42 | +The name corresponds to the long option name without the leading double dash (``--``). For example |
| 43 | +the CLI option ``--password-file`` would be called ``password-file`` inside the config file. |
| 44 | + |
| 45 | +The only option deviating from this scheme is the `logging configuration`_ which is explained |
| 46 | +below. |
| 47 | + |
| 48 | + |
| 49 | +Logging Configuration |
| 50 | +--------------------- |
| 51 | + |
| 52 | +Raiden allows configuration of the logging system using a concise syntax on the command line. |
| 53 | +Inside the configuration file this is split out into a somewhat more expanded syntax. |
| 54 | + |
| 55 | +The logging configuration is placed inside a section called ``[log-config]`` which each following |
| 56 | +lines key representing the logger name and the value the log level. |
| 57 | + |
| 58 | +Example:: |
| 59 | + |
| 60 | + # CLI: |
| 61 | + --log-config ':debug,raiden.network:info' |
| 62 | + |
| 63 | + # Config file equivalent: |
| 64 | + [log-config] |
| 65 | + "" = "debug" |
| 66 | + "raiden.network" = "info" |
0 commit comments