You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Understanding your configuration files and how to use them
2
2
3
-
####The topology.json file
3
+
## The topology.json file
4
4
5
5
Tells your node to which nodes in the network it should talk to. A minimal version of this file looks like this:
6
6
@@ -21,23 +21,25 @@ Tells your node to which nodes in the network it should talk to. A minimal versi
21
21
22
22
Your __block-producing__ node must __ONLY__ talk to your __relay nodes__, and the relay nodes should talk to other relay nodes in the network. Go to https://explorer.cardano.org/relays/topology.json to find out IP addresses and ports of peers. The `topology.json` found at this link is updated once a week.
23
23
24
-
####The P2P topology.json file
24
+
## The P2P topology.json file
25
25
26
26
The P2P topology file specifies how to obtain the _root peers_ (or _bootstrapping
27
-
peers_). These are root peers for the gossip which is a future enhancement of
28
-
`ouroboros-network`.
29
-
30
-
*_local roots_: the node will try, in a best effort way, to have specified
31
-
number of hot connections towards each local root peer group (by hot we mean
32
-
connections taking active role in the consensus algorithm). Local roots
33
-
should include local relays or local block producer node, all any other peers
34
-
with which the node shall keep a connection;
27
+
peers_).
28
+
29
+
* The term _local roots_ refers to a group of peer nodes with which a node will aim to
30
+
maintain a specific number of active, or "hot" connections. These hot connections are
31
+
those that play an active role in the consensus algorithm. Conversely, "warm"
32
+
connections refer to those not yet actively participating in the consensus algorithm.
33
+
34
+
Local roots should comprise local relays or a local block producer node, and any other
35
+
peers that the node needs to maintain a connection with. These connections are
36
+
typically kept private.
35
37
*_public roots_: additional bootstrapping nodes. They are either read from
36
38
the configuration file directly, or from the chain. The configured ones
37
39
will be used to pass a recent snapshot of peers need before the node caches up
38
40
with the recent enough chain to construct root peers by itself.
39
41
40
-
The node does not guarantee to have a connection with each public root or,
42
+
The node does not guarantee to have a connection with each public root,
41
43
unlike for local ones, but by being present in the set it gets a chance to have
42
44
an outbound connection towards that peer.
43
45
@@ -98,12 +100,31 @@ A minimal version of this file looks like this:
98
100
99
101
* Local roots groups shall be non-overlapping.
100
102
103
+
* The advertise parameter instructs a node about the acceptability of sharing its address
104
+
through Peer Sharing (which we'll explain in more detail in a subsequent section). In
105
+
essence, if a node has activated Peer Sharing, it can receive requests from other nodes
106
+
seeking peers. However, it will only disclose those peers for which it has both local
107
+
and remote permissions.
108
+
109
+
Local permission corresponds to the value of the advertise parameter. On the other
110
+
hand, 'remote permission' is tied to the `PeerSharing` value associated with the
111
+
remote address, which is ascertained after the initial handshake between nodes.
112
+
113
+
* Local roots should not be greater than the `TargetNumberOfKnownPeers`.
114
+
If they are they will get clamped to the limit.
115
+
101
116
Your __block-producing__ node must __ONLY__ talk to your __relay nodes__, and the relay node should talk to other relay nodes in the network.
102
117
103
-
You __can__ tell the node that the topology configuration file changed by sending a SIGHUP
104
-
signal to the `cardano-node` process, e.g. `pkill -HUP cardano-node`. After receiving the
105
-
signal, `cardano-node` will re-read the file and restart all DNS resolution. Please
106
-
**note** that this only applies to the topology configuration file!
118
+
You have the option to notify the node of any changes to the topology configuration file
119
+
by sending a SIGHUP signal to the `cardano-node` process. This can be done, for example,
120
+
with the command `pkill -HUP cardano-node`. Upon receiving the signal, the `cardano-node`
121
+
will re-read the configuration file and restart all DNS resolutions.
122
+
123
+
Please be aware that this procedure is specific to the topology configuration file, not
124
+
the node configuration file. Additionally, the SIGHUP signal will prompt the system to
125
+
re-read the block forging credentials file paths and attempt to fetch them to initiate
126
+
block forging. If this process fails, block forging will be disabled. To re-enable block
127
+
forging, ensure that the necessary files are present.
107
128
108
129
One can disable ledger peers by setting the `useLedgerAfterSlot` to a negative
109
130
value.
@@ -119,7 +140,7 @@ node will connect to relays registered on the chain, and churn through them by
119
140
randomly picking new peers (weighted by stake distribution) and forgetting 20%
120
141
least performing ones.
121
142
122
-
####The genesis.json file
143
+
## The genesis.json file
123
144
124
145
The genesis file is generated with the `cardano-cli` by reading a `genesis.spec.json` file, which is out of scope for this document.
125
146
But it is important because it is used to set:
@@ -237,23 +258,23 @@ Here is a brief description of each parameter. You can learn more in the [spec](
237
258
| securityParam | Security parameter k |
238
259
239
260
240
-
####The config.json file
261
+
## The config.json file
241
262
242
263
The default `config.json` file that we downloaded is shown below.
243
264
244
265
This file has __4__ sections that allow you to have full control on what your node does and how the information is presented.
245
266
246
267
__NOTE Due to how the config.json file is generated, fields on the real file are shown in a different (less coherent) order. Here we present them in a more structured way__
247
268
248
-
####Basic Node Configuration.
269
+
### Basic Node Configuration.
249
270
250
271
First section relates the basic node configuration parameters. Make sure you have to `TPraos`as the protocol, the correct path to the `mainnet-shelley-genesis.json` file, `RequiresMagic`for its use in a testnet.
251
272
252
273
"Protocol": "TPraos",
253
274
"GenesisFile": "mainnet-shelley-genesis.json",
254
275
"RequiresNetworkMagic": "RequiresMagic",
255
276
256
-
####Update parameters
277
+
### Update parameters
257
278
258
279
This protocol version number gets used by block producing nodes as part of the system for agreeing on and synchronising protocol updates. You just need to be aware of the latest version supported by the network. You don't need to change anything here.
259
280
@@ -262,7 +283,7 @@ This protocol version number gets used by block producing nodes as part of the s
262
283
"LastKnownBlockVersion-Minor": 0,
263
284
264
285
265
-
####Tracing
286
+
### Tracing
266
287
267
288
`Tracers` tell your node what information you are interested in when logging. Like switches that you can turn ON or OFF according the type and quantity of information that you are interesetd in. This provides fairly coarse grained control, but it is relatively efficient at filtering out unwanted trace output.
268
289
@@ -347,7 +368,7 @@ Also enable the EKG backend if you want to use the EKG or Prometheus monitoring
347
368
},
348
369
```
349
370
350
-
####Fine grained logging control
371
+
### Fine grained logging control
351
372
352
373
It is also possible to have more fine grained control over filtering of trace output, and to match and route trace output to particular backends. This is less efficient than the coarse trace filters above but provides much more precise control. `options`:
353
374
@@ -370,3 +391,174 @@ It is also possible to have more fine grained control over filtering of trace ou
370
391
}
371
392
}
372
393
```
394
+
395
+
### Peer-to-Peer Parameters & Tracers
396
+
397
+
To run a node in P2P mode set `EnableP2P` to `true` (_the default is `False`_) in the
398
+
configuration file. You will also need to specify the topology in a new format which is
399
+
described above.
400
+
401
+
There are a few new tracers and configuration options which you can set (listed below by
402
+
component):
403
+
404
+
#### Outbound Governor
405
+
406
+
The outbound governor is responsible for satisfying targets of root peers, known (_cold_,
407
+
_warm_ and _hot_), established (_warm_ & _hot_) and active peers (synonym for _hot_ peers)
408
+
and local root peers. The primary way to configure them is by setting the following
409
+
options:
410
+
411
+
*`TargetNumberOfRootPeers` (_default value: `100`_) - a minimal number of root peers
412
+
(unlike other targets this one is one sided, e.g. a node might have more root peers
413
+
*`TargetNumberOfKnownPeers` (_default value: `100`_) - a target of known peers (must be
414
+
larger or equal to `TargetNumberOfRootPeers`)
415
+
*`TargetNumberOfEstablishedPeers` (_default value: `50`_) - a target of all established
416
+
peers (including local roots, ledger peers)
417
+
*`TargetNumberOfActivePeers` (_default value: `20`_) - a target for _hot_ peers which
418
+
engage in the consensus protocol
419
+
420
+
Let us note two more targets. In the topology file you may include local root peers.
421
+
This is a list of groups of peers, each group comes with its own valency. The outbound
422
+
governor will maintain a connection with every local root peer, and will enforce that at
423
+
least the specified number of them (the valency) are _hot_. Thus the
424
+
`TargetNumberOfKnownPeers` , `TargetNumberOfEstablishedPeers` and
425
+
`TargetNumberOfActivePeers` must be large enough to accommodate local root peers.
426
+
427
+
The following traces can be enabled:
428
+
429
+
*`TracePeerSelection` (_by default on_) - tracks selection of upstream peers done by the
430
+
_outbound-governor_. **Warm peers** are ones with which we have an open connection but
431
+
don't engage in consensus protocol, **hot peers** are peers which engage in consensus
432
+
protocol (via `chain-sync`, `block-fetch` and `tx-submission` mini-protocols), **cold
433
+
peers** are ones which we know about but the node doesn't have an established
434
+
connection. Note that the notions of _hot_, _warm_ and _cold_ are only related to usage
435
+
of initiator sides of mini-protocols in a connection (which can be either inbound or
436
+
outbound).
437
+
*`TracePeerSelectionCounters` (_by default on_) - traces how many cold / warm / hot /
438
+
local root peers the node has, it's also available via ekg.
439
+
*`TracePeerStateActions` (_by default on_) - includes traces from a component which
440
+
executes peer promotion / demotions between cold / warm & hot states.
441
+
*`TracePublicRootPeers` (_by default off_) - traces information about root / ledger peers
442
+
(e.g. ip addresses or dns names of ledger peers, dns resolution)
443
+
*`DebugPeerSelectionInitiator` and `DebugPeerSelectionInitiatorResponder` (_by default
444
+
off_) - a debug tracers which log the information about current state of the _outbound
0 commit comments