pub struct P2PConfig {Show 20 fields
pub laddr: String,
pub external_address: String,
pub seeds: Vec<String>,
pub persistent_peers: Vec<String>,
pub upnp: bool,
pub local_net: bool,
pub max_num_inbound_peers: u64,
pub max_num_outbound_peers: u64,
pub unconditional_peer_ids: Vec<String>,
pub persistent_peers_max_dial_period: Duration,
pub flush_throttle_timeout: Duration,
pub max_packet_msg_payload_size: u64,
pub send_rate: u64,
pub recv_rate: u64,
pub pex: bool,
pub seed_mode: bool,
pub private_peer_ids: Vec<String>,
pub allow_duplicate_ip: bool,
pub handshake_timeout: Duration,
pub dial_timeout: Duration,
}Fields§
§laddr: StringAddress to listen for incoming connections.
external_address: StringAddress to advertise to peers for them to dial If empty, will use the same port as the laddr, and will introspect on the listener or use UPnP to figure out the address. ip and port are required example: 159.89.10.97:26656
seeds: Vec<String>List of seeds
persistent_peers: Vec<String>List of persistent peers.
upnp: boolUPNP port forwarding
local_net: boolPrivate or local net.
max_num_inbound_peers: u64Maximum number of inbound peers
max_num_outbound_peers: u64Maximum number of outbound peers to connect to, excluding persistent peers
unconditional_peer_ids: Vec<String>List of node IDs, to which a connection will be (re)established ignoring any existing limits
persistent_peers_max_dial_period: DurationMaximum pause when redialing a persistent peer (if zero, exponential backoff is used)
flush_throttle_timeout: DurationTime to wait before flushing messages out on the connection
max_packet_msg_payload_size: u64Maximum size of a message packet payload, in bytes
send_rate: u64Rate at which packets can be sent, in bytes/second
recv_rate: u64Rate at which packets can be received, in bytes/second
pex: boolSet true to enable the peer-exchange reactor
seed_mode: boolSeed mode, in which node constantly crawls the network and looks for peers. If another node asks it for addresses, it responds and disconnects.
Does not work if the peer-exchange reactor is disabled.
private_peer_ids: Vec<String>Comma separated list of peer IDs to keep private (will not be gossiped to other peers)
allow_duplicate_ip: boolToggle to disable guard against peers connecting from the same ip.
handshake_timeout: DurationPeer connection configuration.
dial_timeout: Duration