pub struct NetworkConfig {
Show 14 fields pub enable_loopback: bool, pub port_reuse: bool, pub node_name: String, pub node_key: Keypair, pub psk: Option<[u8; 32]>, pub dns: Option<DnsConfig>, pub mdns: Option<MdnsConfig>, pub kad: Option<KadConfig>, pub ping: Option<PingConfig>, pub identify: Option<IdentifyConfig>, pub gossipsub: Option<GossipsubConfig>, pub broadcast: Option<BroadcastConfig>, pub bitswap: Option<BitswapConfig>, pub keep_alive: bool,
}
Expand description

Network configuration.

Fields§

§enable_loopback: bool

Enable adding loopback addresses to the address book. Should be enabled during testing and disabled in production.

§port_reuse: bool

Enable binding to the listen port number when dialling peers instead of using a random outgoing port. While this may allow stricter firewall confiuration or shorter peer lists when interacting with other IPFS implementations, it also opens up the possibility of TCP simultaneous open, which leads to spurious dial errors.

§node_name: String

Node name.

§node_key: Keypair

Node key.

§psk: Option<[u8; 32]>

Pre shared key.

§dns: Option<DnsConfig>

Dns config. If no dns config is provided the system defaults will be used.

§mdns: Option<MdnsConfig>

Mdns config.

§kad: Option<KadConfig>

Kad config.

§ping: Option<PingConfig>

Ping config.

§identify: Option<IdentifyConfig>

Identify config. Note that the node_name and node_key will overwrite the local_public_key and the agent_version.

§gossipsub: Option<GossipsubConfig>

Gossipsub config.

§broadcast: Option<BroadcastConfig>

Broadcast config.

§bitswap: Option<BitswapConfig>

Bitswap config.

§keep_alive: bool

Keep explicitly dialed and incoming connections open indefinitely

Implementations§

Creates a new network configuration.

Trait Implementations§

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Scrape the references from an impl Read. Read more
Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more