Skip to content

Commit f538c18

Browse files
committed
Add docs for config file [skip ci]
1 parent 9065ff8 commit f538c18

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

docs/config_file.rst

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

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Contents
2222
webui_tutorial
2323
spec
2424
smart_contracts
25+
config_file
2526
changelog
2627
glossary
2728
Raiden Codebase Documentation <./_build/generated/modules>

0 commit comments

Comments
 (0)