|
4 | 4 | Configuration |
5 | 5 | #################### |
6 | 6 |
|
7 | | -CodeChain can be configured with either CLI options or a config file. When it comes to which options take precedence, it goes from CLI, user's own config.toml file, and config.dev.toml in that order. |
| 7 | +.. toctree:: |
| 8 | + :maxdepth: 2 |
8 | 9 |
|
9 | | -CLI options can be listed by running the command ``$codechain --help``. By using the CLI options, or custom config files, the user can overwrite config.dev.toml's configurations. |
10 | | - |
11 | | -Config File |
12 | | -=========== |
13 | | -The default preset ``config.dev.toml`` file can be located in ``codechain/config/presets/config.dev.toml``. |
14 | | - |
15 | | -Config files can be customized by the user and its location can be designated by using the CLI command ``--config``. Custom config files created by the user must have the proper custom path. |
16 | | - |
17 | | -Default config.dev.toml |
18 | | -======================= |
19 | | -The following represents the default configuration values of ``config.dev.toml``. |
20 | | -:: |
21 | | - |
22 | | - [codechain] |
23 | | - quiet = false |
24 | | - db_path = "db" |
25 | | - keys_path = "keys" |
26 | | - chain = "solo" |
27 | | - secret_key = "0x0000000000000000000000000000000000000000000000000000000000000001" |
28 | | - |
29 | | - [mining] |
30 | | - |
31 | | - [network] |
32 | | - disable = false |
33 | | - port = 3485 |
34 | | - max_peers = 30 |
35 | | - min_peers = 10 |
36 | | - bootstrap_addresses = [] |
37 | | - sync = true |
38 | | - parcel_relay = true |
39 | | - discovery = true |
40 | | - discovery_type = "unstructured" |
41 | | - discovery_refresh = 60000 |
42 | | - discovery_bucket_size = 10 |
43 | | - |
44 | | - [rpc] |
45 | | - disable = false |
46 | | - port = 8080 |
47 | | - |
48 | | - [ipc] |
49 | | - disable = false |
50 | | - path = "/tmp/jsonrpc.ipc" |
51 | | - |
52 | | - [snapshot] |
53 | | - disable = false |
54 | | - path = "snapshot" |
55 | | - |
56 | | -CodeChain is set to use the Solo consensus algorithm by default. Tendermint is not suitable for solo testing purposes, since it requires a minimum of 4 users to function properly. |
57 | | - |
58 | | -In order to test CodeChain alone, you may want to change chain to Solo. To do this, use ``--chain solo``. |
59 | | - |
60 | | -CLI Options for CodeChain client |
61 | | -================================ |
62 | | - ``--config=[PATH]`` |
63 | | - Specify the certain config file path that you want to use to configure CodeChain to your needs. |
64 | | - |
65 | | - ``--port=[PORT]`` |
66 | | - Listen for connections on PORT. (default: 3485) |
67 | | - |
68 | | - ``--bootstrap-addresses=[BOOTSTRAP_ADDRESSES]`` |
69 | | - Bootstrap addresses to connect. |
70 | | - |
71 | | - ``--no-network`` |
72 | | - Do not open network socket. |
73 | | - |
74 | | - ``--min-peers=[NUM]`` |
75 | | - Set the minimum number of connections the user would like. (default: 10) |
76 | | - |
77 | | - ``--max-peers=[NUM]`` |
78 | | - Set the maximum number of connections the user would like. (default: 30) |
79 | | - |
80 | | - ``--instance-id=[ID]`` |
81 | | - Specify instance id for logging. Used when running multiple instances of CodeChain. |
82 | | - |
83 | | - ``--quiet`` |
84 | | - Do not show any synchronization information in the console. |
85 | | - |
86 | | - ``--chain=[CHAIN]`` |
87 | | - Set the blockchain type out of solo, solo_authority, tendermint or a path to chain spec file. (default: solo) |
88 | | - |
89 | | - ``--db-path=[PATH]`` |
90 | | - Specify the database directory path. |
91 | | - |
92 | | - ``--keys-path=[PATH]`` |
93 | | - Specify the path for JSON key files to be found. |
94 | | - |
95 | | - ``snapshot-path=[PATH]`` |
96 | | - Specify the snapshot directory path. |
97 | | - |
98 | | - ``--no-sync`` |
99 | | - Do not run block sync extension. |
100 | | - |
101 | | - ``--no-parcel-relay`` |
102 | | - Do not relay parcels. |
103 | | - |
104 | | - ``--jsonrpc-port=[PORT]`` |
105 | | - Listen for rpc connections on PORT. (default: 8080) |
106 | | - |
107 | | - ``--no-ipc`` |
108 | | - Do not run JSON-RPC over IPC service. |
109 | | - |
110 | | - ``--ipc-path=[PATH]`` |
111 | | - Specify custom path for JSON-RPC over IPC service |
112 | | - |
113 | | - ``--no-jsonrpc`` |
114 | | - Do not run jsonrpc. |
115 | | - |
116 | | - ``--secret-key=[KEY]`` |
117 | | - Secret key used by node. |
118 | | - |
119 | | - ``--author=[ADDRESS]`` |
120 | | - Specify the block's author (aka "coinbase") address for sending block rewards from |
121 | | - sealed blocks. |
122 | | - |
123 | | - ``--engine-signer=[ADDRESS]`` |
124 | | - Specify the address which should be used to sign consensus messages and |
125 | | - issue blocks. |
126 | | - |
127 | | - ``--mem-pool-mem-limit=[MB]`` |
128 | | - Maximum amount of memory that can be used by the mem pool. Setting this parameter to 0 disables limiting. |
129 | | - |
130 | | - ``--mem-pool-size=[LIMIT]`` |
131 | | - Maximum amount of parcels in the queue (waiting to be included in next block). |
132 | | - |
133 | | - ``notify-work=[URLS]`` |
134 | | - URLs to which work package notifications are pushed. |
135 | | - |
136 | | - ``force-sealing`` |
137 | | - Force the node to author new blocks as if it were always sealing/mining. |
138 | | - |
139 | | - ``reseal-min-period=[MS]`` |
140 | | - Specify the minimum time between reseals from incoming parcels. MS is time measured in milliseconds. |
141 | | - |
142 | | - ``reseal-max-period=[MS]`` |
143 | | - Specify the maximum time since last block to enable force-sealing. MS is time measured in milliseconds. |
144 | | - |
145 | | - ``work-queue-size=[ITEMS]`` |
146 | | - Specify the number of historical work packages which are kept cached lest a solution is found for them later. High values take more memory but result in fewer unusable solutions. |
147 | | - |
148 | | - ``--no-discovery`` |
149 | | - Do not use discovery. No automated peer finding. |
150 | | - |
151 | | - ``--discovery="kademlia" | "unstructured"`` |
152 | | - Decides which p2p discovery extension to use. Options are `kademlia <https://github.com/CodeChain-io/codechain/wiki/Kademlia-Extension>`_ and unstructured. |
153 | | - In a testing environment, an unstructured p2p network is desirable because it is |
154 | | - more than sufficient when there are a few users. |
155 | | - (default: unstructured) |
156 | | - |
157 | | - ``--discovery-bucket-size=[NUM]`` |
158 | | - Bucket size for discovery. Choose how many addresses to exchange at a time |
159 | | - during discovery. |
160 | | - |
161 | | - ``--discovery-refresh=[ms]`` |
162 | | - Refresh timeout of discovery (ms). It may conflict with:`` --no-discovery``. |
163 | | - |
164 | | - ``--no-snapshot`` |
165 | | - Disable snapshots |
166 | | - |
167 | | -Logging |
168 | | -======= |
169 | | -For logging, run the following to configure: |
170 | | -``$ RUST_LOG=<level> codechain`` |
171 | | - |
172 | | -Log Levels |
173 | | ----------- |
174 | | -CodeChain currently offers five different ``<level>``. They are error, warn, info, debug, and trace. |
175 | | - |
176 | | -For example, the log level will be set to debug, if you run the following: |
177 | | - |
178 | | -``$ RUST_LOG="debug" codechain`` |
179 | | - |
180 | | -* The **error** level represents an event where something can be dangerous, but can still run. In the case in which it cannot run anymore, it must crash ASAP instead of logging. |
181 | | - |
182 | | -* The **warn** level represents an event which can be potentially dangerous. |
183 | | - |
184 | | -* The **info** level represents an event which is not dangerous, but can be useful information for users. |
185 | | - |
186 | | -* The **debug** level represents an event that is useful for developers, but not for users. |
187 | | - |
188 | | -* The **trace** level is used for tracing. |
189 | | - |
190 | | -Log Targets |
191 | | ------------ |
192 | | - |
193 | | -Log levels can be set differently for each log targets. For example, you can run the following to set ``tx``'s log level as ``trace`` and ``parcel``'s |
194 | | -log level as ``info`` with the following code: |
195 | | - |
196 | | -``$ RUST_LOG="tx=trace,parcel=info" codechain`` |
197 | | - |
198 | | -The possible log targets are as follows: |
199 | | -:: |
200 | | - |
201 | | - "blockchain" |
202 | | - "client" |
203 | | - "discovery" |
204 | | - "engine" |
205 | | - "external_parcel" |
206 | | - "io" |
207 | | - "mem_pool" |
208 | | - "miner" |
209 | | - "net" |
210 | | - "netapi" |
211 | | - "own_parcel" |
212 | | - "poa" |
213 | | - "shutdown" |
214 | | - "snapshot" |
215 | | - "solo_authoirty" |
216 | | - "spec" |
217 | | - "state" |
218 | | - "state_db" |
219 | | - "stratum" |
220 | | - "sync" |
221 | | - "test_script" |
222 | | - "trie" |
223 | | - "tx" |
| 10 | + how-to-configure |
| 11 | + logging |
0 commit comments