pub struct Config {Show 25 fields
pub keypair: Keypair,
pub listen_on: Vec<Multiaddr>,
pub listen_on_fallback_to_random_port: bool,
pub timeout: Duration,
pub identify: Config,
pub kademlia: Config,
pub gossipsub: Option<Config>,
pub yamux_config: Config,
pub allow_non_global_addresses_in_dht: bool,
pub initial_random_query_interval: Duration,
pub known_peers_registry: Box<dyn KnownPeersRegistry>,
pub request_response_protocols: Vec<Box<dyn RequestHandler>>,
pub reserved_peers: Vec<Multiaddr>,
pub max_established_incoming_connections: u32,
pub max_established_outgoing_connections: u32,
pub max_pending_incoming_connections: u32,
pub max_pending_outgoing_connections: u32,
pub temporary_bans_cache_size: u32,
pub temporary_ban_backoff: ExponentialBackoff,
pub libp2p_metrics: Option<Metrics>,
pub metrics: Option<SubspaceMetrics>,
pub protocol_version: String,
pub bootstrap_addresses: Vec<Multiaddr>,
pub kademlia_mode: KademliaMode,
pub external_addresses: Vec<Multiaddr>,
}Expand description
Node configuration.
Fields§
§keypair: KeypairIdentity keypair of a node used for authenticated connections.
listen_on: Vec<Multiaddr>List of [Multiaddr] on which to listen for incoming connections.
listen_on_fallback_to_random_port: boolFallback to random port if specified (or default) port is already occupied.
timeout: DurationAdds a timeout to the setup and protocol upgrade process for all inbound and outbound connections established through the transport.
identify: ConfigThe configuration for the Identify behaviour.
kademlia: ConfigThe configuration for the Kademlia behaviour.
gossipsub: Option<Config>The configuration for the Gossip behaviour.
yamux_config: ConfigYamux multiplexing configuration.
allow_non_global_addresses_in_dht: boolShould non-global addresses be added to the DHT?
initial_random_query_interval: DurationHow frequently should random queries be done using Kademlia DHT to populate routing table.
known_peers_registry: Box<dyn KnownPeersRegistry>A reference to the NetworkingParametersRegistry implementation.
request_response_protocols: Vec<Box<dyn RequestHandler>>The configuration for the RequestResponsesBehaviour protocol.
reserved_peers: Vec<Multiaddr>Defines set of peers with a permanent connection (and reconnection if necessary).
max_established_incoming_connections: u32Established incoming swarm connection limit.
max_established_outgoing_connections: u32Established outgoing swarm connection limit.
max_pending_incoming_connections: u32Pending incoming swarm connection limit.
max_pending_outgoing_connections: u32Pending outgoing swarm connection limit.
temporary_bans_cache_size: u32How many temporarily banned unreachable peers to keep in memory.
temporary_ban_backoff: ExponentialBackoffBackoff policy for temporary banning of unreachable peers.
libp2p_metrics: Option<Metrics>Optional libp2p prometheus metrics. None will disable metrics gathering.
metrics: Option<SubspaceMetrics>Internal prometheus metrics. None will disable metrics gathering.
protocol_version: StringDefines protocol version for the network peers. Affects network partition.
bootstrap_addresses: Vec<Multiaddr>Addresses to bootstrap Kademlia network
kademlia_mode: KademliaModeKademlia mode. The default value is set to Static(Client). The peer won’t add its address to other peers` Kademlia routing table. Changing this behaviour implies that a peer can provide pieces to others.
external_addresses: Vec<Multiaddr>Known external addresses to the local peer. The addresses will be added on the swarm start and enable peer to notify others about its reachable address.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl !RefUnwindSafe for Config
impl Send for Config
impl !Sync for Config
impl Unpin for Config
impl !UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more