pub struct Config {Show 22 fields
pub version: Version,
pub enable_monitor: bool,
pub handshake_timeout: u64,
pub ping_interval: u64,
pub ping_timeout: u64,
pub max_connect_retries: usize,
pub bootstrap_peers: Vec<Endpoint>,
pub listen_endpoint: Option<Endpoint>,
pub peer_endpoints: Vec<Endpoint>,
pub inbound_slots: usize,
pub outbound_slots: usize,
pub discovery_port: Port,
pub seeding_interval: u64,
pub lookup_inbound_slots: usize,
pub lookup_outbound_slots: usize,
pub lookup_response_timeout: u64,
pub lookup_connection_lifespan: u64,
pub lookup_connect_retries: usize,
pub refresh_interval: u64,
pub refresh_response_timeout: u64,
pub refresh_connect_retries: usize,
pub enable_tls: bool,
}
Expand description
the Configuration for the P2P network.
Fields§
§version: Version
Represents the network version.
enable_monitor: bool
Enable monitor
handshake_timeout: u64
Timeout duration for the handshake with new peers, in seconds.
ping_interval: u64
Interval at which the ping protocol sends ping messages to a peer to maintain connections, in seconds.
ping_timeout: u64
Timeout duration for receiving the pong message corresponding to the sent ping message, in seconds.
max_connect_retries: usize
The maximum number of retries for outbound connection establishment.
bootstrap_peers: Vec<Endpoint>
A list of bootstrap peers for the seeding process.
listen_endpoint: Option<Endpoint>
An optional listening endpoint to accept incoming connections.
peer_endpoints: Vec<Endpoint>
A list of endpoints representing peers that the Discovery
will
manually connect to.
inbound_slots: usize
The number of available inbound slots for incoming connections.
outbound_slots: usize
The number of available outbound slots for outgoing connections.
discovery_port: Port
TCP/UDP port for lookup and refresh processes.
seeding_interval: u64
Time interval, in seconds, at which the Discovery restarts the seeding process.
lookup_inbound_slots: usize
The number of available inbound slots for incoming connections during the lookup process.
lookup_outbound_slots: usize
The number of available outbound slots for outgoing connections during the lookup process.
lookup_response_timeout: u64
Timeout duration for a peer response during the lookup process, in seconds.
lookup_connection_lifespan: u64
Maximum allowable time for a live connection with a peer during the lookup process, in seconds.
lookup_connect_retries: usize
The maximum number of retries for outbound connection establishment during the lookup process.
refresh_interval: u64
Interval at which the table refreshes its entries, in seconds.
refresh_response_timeout: u64
Timeout duration for a peer response during the table refresh process, in seconds.
refresh_connect_retries: usize
The maximum number of retries for outbound connection establishment during the refresh process.
enable_tls: bool
Enables TLS for all connections.