github.com/badrootd/nibiru-cometbft@v0.37.5-0.20240307173500-2a75559eee9b/spec/p2p/implementation/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 | [AddrBook](./addressbook.md) | defaultAddrBookPath | Path do address book | 12 | AddrBookStrict | true | Set true for strict address routability rules and false for private or local networks | 13 | [MaxNumInboundPeers](./switch.md#accepting-peers) | 40 | Maximum number of inbound peers | 14 | [MaxNumOutboundPeers](./peer_manager.md#ensure-peers) | 10 | Maximum number of outbound peers to connect to, excluding persistent peers | 15 | [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. | 16 | PersistentPeersMaxDialPeriod| 0 * time.Second | Maximum pause when redialing a persistent peer (if zero, exponential backoff is used) | 17 | FlushThrottleTimeout |100 * time.Millisecond| Time to wait before flushing messages out on the connection | 18 | MaxPacketMsgPayloadSize | 1024 | Maximum size of a message packet payload, in bytes | 19 | SendRate | 5120000 (5 mB/s) | Rate at which packets can be sent, in bytes/second | 20 | RecvRate | 5120000 (5 mB/s) | Rate at which packets can be received, in bytes/second| 21 | [PexReactor](./pex.md) | true | Set true to enable the peer-exchange reactor | 22 | SeedMode | false | Seed mode, in which node constantly crawls the network and looks for. Does not work if the peer-exchange reactor is disabled. | 23 | 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. | 24 | AllowDuplicateIP | false | Toggle to disable guard against peers connecting from the same ip.| 25 | [HandshakeTimeout](./transport.md#connection-upgrade) | 20 * time.Second | Timeout for handshake completion between peers | 26 | [DialTimeout](./switch.md#dialing-peers) | 3 * time.Second | Timeout for dialing a peer | 27 28 29 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: 30 31 | Parameter | Flag | Example | 32 | --- | --- | --- | 33 | Listen address| `p2p.laddr` | "tcp://0.0.0.0:26656" | 34 | Seed nodes | `p2p.seeds` | `--p2p.seeds “id100000000000000000000000000000000@1.2.3.4:26656,id200000000000000000000000000000000@2.3.4.5:4444”` | 35 | Persistent peers | `p2p.persistent_peers` | `--p2p.persistent_peers “id100000000000000000000000000000000@1.2.3.4:26656,id200000000000000000000000000000000@2.3.4.5:26656”` | 36 | Unconditional peers | `p2p.unconditional_peer_ids` | `--p2p.unconditional_peer_ids “id100000000000000000000000000000000,id200000000000000000000000000000000”` | 37 | PexReactor | `p2p.pex` | `--p2p.pex` | 38 | Seed mode | `p2p.seed_mode` | `--p2p.seed_mode` | 39 | Private peer ids | `p2p.private_peer_ids` | `--p2p.private_peer_ids “id100000000000000000000000000000000,id200000000000000000000000000000000”` | 40 41 **Note on persistent peers** 42 43 If `persistent_peers_max_dial_period` is set greater than zero, the 44 pause between each dial to each persistent peer will not exceed `persistent_peers_max_dial_period` 45 during exponential backoff and we keep trying again without giving up. 46 47 If `seeds` and `persistent_peers` intersect, 48 the user will be warned that seeds may auto-close connections 49 and that the node may not be able to keep the connection persistent.