github.com/badrootd/celestia-core@v0.0.0-20240305091328-aa4207a4b25d/spec/p2p/v0.34/configuration.md (about)

     1  # CometBFT p2p configuration
     2  
     3  This document contains configurable parameters a node operator can use to tune the p2p behaviour.
     4  
     5  | Parameter| Default| Description |
     6  | --- | --- | ---|
     7  |   ListenAddress               |   "tcp://0.0.0.0:26656" |   Address to listen for incoming connections (0.0.0.0:0 means any interface, any port)  |
     8  |   ExternalAddress             |  ""                 |  Address to advertise to peers for them to dial |
     9  |   [Seeds](pex-protocol.md#seed-nodes) | empty               | Comma separated list of seed nodes to connect to (ID@host:port )|
    10  |   [Persistent peers](peer_manager.md#persistent-peers)            | empty               | Comma separated list of nodes to keep persistent connections to (ID@host:port )  |
    11  |	UPNP                        | false               | UPNP port forwarding enabled |
    12  |	[AddrBook](addressbook.md)                    | defaultAddrBookPath | Path do address book |
    13  |	AddrBookStrict              | true                | Set true for strict address routability rules and false for private or local networks |
    14  |	[MaxNumInboundPeers](switch.md#accepting-peers)          |  40 | Maximum number of inbound peers |
    15  |	[MaxNumOutboundPeers](peer_manager.md#ensure-peers)         |  10 |  Maximum number of outbound peers to connect to, excluding persistent peers |
    16  |   [UnconditionalPeers](switch.md#accepting-peers)          | empty                | These are IDs of the peers which are allowed to be (re)connected as both inbound or outbound regardless of whether the node reached `max_num_inbound_peers` or `max_num_outbound_peers` or not. |
    17  |   PersistentPeersMaxDialPeriod| 0 * time.Second      | Maximum pause when redialing a persistent peer (if zero, exponential backoff is used)    |
    18  |	FlushThrottleTimeout        |100 * time.Millisecond| Time to wait before flushing messages out on the connection |
    19  |	MaxPacketMsgPayloadSize     |  1024 | Maximum size of a message packet payload, in bytes |
    20  |	SendRate                    | 5120000 (5 mB/s) | Rate at which packets can be sent, in bytes/second  |
    21  |	RecvRate                    | 5120000 (5 mB/s) | Rate at which packets can be received, in bytes/second|
    22  |	[PexReactor](pex.md)                  |  true            | Set true to enable the peer-exchange reactor |
    23  |	SeedMode                    |       false      | Seed mode, in which node constantly crawls the network and looks for. Does not work if the peer-exchange reactor is disabled.  |
    24  |   PrivatePeerIDs              | empty            | Comma separated list of peer IDsthat we do not add to the address book or gossip to other peers. They stay private to us. |
    25  |	AllowDuplicateIP            | false            | Toggle to disable guard against peers connecting from the same ip.|
    26  |	[HandshakeTimeout](transport.md#connection-upgrade)            | 20 * time.Second | Timeout for handshake completion between peers |
    27  |	[DialTimeout](switch.md#dialing-peers)                 |  3 * time.Second | Timeout for dialing a peer |
    28  
    29  
    30  These parameters can be set using the `$CMTHOME/config/config.toml` file. A subset of them can also be changed via command line using the following command line flags:
    31  
    32  | Parameter | Flag| Example|
    33  | --- | --- | ---|
    34  | Listen address|  `p2p.laddr` |  "tcp://0.0.0.0:26656" |
    35  | Seed nodes | `p2p.seeds` | `--p2p.seeds “id100000000000000000000000000000000@1.2.3.4:26656,id200000000000000000000000000000000@2.3.4.5:4444”` |
    36  | Persistent peers | `p2p.persistent_peers` | `--p2p.persistent_peers “id100000000000000000000000000000000@1.2.3.4:26656,id200000000000000000000000000000000@2.3.4.5:26656”` |
    37  | Unconditional peers | `p2p.unconditional_peer_ids` | `--p2p.unconditional_peer_ids “id100000000000000000000000000000000,id200000000000000000000000000000000”` |
    38   | UPNP  | `p2p.upnp` | `--p2p.upnp` |
    39   | PexReactor | `p2p.pex` | `--p2p.pex` |
    40   | Seed mode | `p2p.seed_mode` | `--p2p.seed_mode` |
    41   | Private peer ids | `p2p.private_peer_ids` | `--p2p.private_peer_ids “id100000000000000000000000000000000,id200000000000000000000000000000000”` |
    42  
    43   **Note on persistent peers**  
    44  
    45   If `persistent_peers_max_dial_period` is set greater than zero, the
    46  pause between each dial to each persistent peer will not exceed `persistent_peers_max_dial_period`
    47  during exponential backoff and we keep trying again without giving up.
    48  
    49  If `seeds` and `persistent_peers` intersect,
    50  the user will be warned that seeds may auto-close connections
    51  and that the node may not be able to keep the connection persistent.