Struct ckb_app_config::NetworkConfig [−][src]
pub struct NetworkConfig {Show 20 fields
pub whitelist_only: bool,
pub max_peers: u32,
pub max_outbound_peers: u32,
pub path: PathBuf,
pub dns_seeds: Vec<String>,
pub discovery_local_address: bool,
pub discovery_announce_check_interval_secs: Option<u64>,
pub ping_interval_secs: u64,
pub ping_timeout_secs: u64,
pub connect_outbound_interval_secs: u64,
pub listen_addresses: Vec<Multiaddr>,
pub public_addresses: Vec<Multiaddr>,
pub bootnodes: Vec<Multiaddr>,
pub whitelist_peers: Vec<Multiaddr>,
pub upnp: bool,
pub bootnode_mode: bool,
pub support_protocols: Vec<SupportProtocol>,
pub max_send_buffer: Option<usize>,
pub reuse_port_on_linux: bool,
pub sync: SyncConfig,
}Expand description
Network config options.
Fields
whitelist_only: boolOnly connect to whitelist peers.
max_peers: u32Maximum number of allowed connected peers.
The node will evict connections when the number exceeds this limit.
max_outbound_peers: u32Maximum number of outbound peers.
When node A connects to B, B is the outbound peer of A.
path: PathBufNetwork data storage directory path.
dns_seeds: Vec<String>A list of DNS servers to discover peers.
discovery_local_address: boolWhether to probe and store local addresses.
discovery_announce_check_interval_secs: Option<u64>The interval between discovery announce message checking.
ping_interval_secs: u64Interval between pings in seconds.
A node pings peer regularly to see whether the connection is alive.
ping_timeout_secs: u64The ping timeout in seconds.
If a peer does not respond to ping before the timeout, it is evicted.
connect_outbound_interval_secs: u64The interval between trials to connect more outbound peers.
listen_addresses: Vec<Multiaddr>Listen addresses.
public_addresses: Vec<Multiaddr>Public addresses.
Set this if this is different from listen_addresses.
bootnodes: Vec<Multiaddr>A list of peers used to boot the node discovery.
Bootnodes are used to bootstrap the discovery when local peer storage is empty.
whitelist_peers: Vec<Multiaddr>A list of peers added in the whitelist.
When whitelist_only is enabled, the node will only connect to peers in this list.
upnp: boolEnable UPNP when the router supports it.
bootnode_mode: boolEnable bootnode mode.
It is recommended to enable this when this server is intended to be used as a node in the
bootnodes.
support_protocols: Vec<SupportProtocol>Supported protocols list
max_send_buffer: Option<usize>Max send buffer size in bytes.
reuse_port_on_linux: boolNetwork use reuse port or not
sync: SyncConfigChain synchronization config options.
Implementations
Gets the network secret key path.
Gets the peer store path.
Creates missing directories.
Gets maximum inbound peers.
Gets maximum outbound peers.
Gets maximum send buffer size.
Reads the private key from file or generates one if the file does not exist.
Gets the list of whitelist peers.
Checks whether the outbound peer service should be enabled.
Checks whether the DNS seeding service should be enabled.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Config
impl UnwindSafe for Config
Blanket Implementations
Mutably borrows from an owned value. Read more