[][src]Struct substrate_service::config::NetworkConfiguration

pub struct NetworkConfiguration {
    pub config_path: Option<String>,
    pub net_config_path: Option<String>,
    pub listen_addresses: Vec<Multiaddr>,
    pub public_addresses: Vec<Multiaddr>,
    pub boot_nodes: Vec<String>,
    pub node_key: NodeKeyConfig,
    pub in_peers: u32,
    pub out_peers: u32,
    pub reserved_nodes: Vec<String>,
    pub non_reserved_mode: NonReservedPeerMode,
    pub client_version: String,
    pub node_name: String,
    pub transport: TransportConfig,
}

Network service configuration.

Fields

config_path: Option<String>

Directory path to store general network configuration. None means nothing will be saved.

net_config_path: Option<String>

Directory path to store network-specific configuration. None means nothing will be saved.

listen_addresses: Vec<Multiaddr>

Multiaddresses to listen for incoming connections.

public_addresses: Vec<Multiaddr>

Multiaddresses to advertise. Detected automatically if empty.

boot_nodes: Vec<String>

List of initial node addresses

node_key: NodeKeyConfig

The node key configuration, which determines the node's network identity keypair.

in_peers: u32

Maximum allowed number of incoming connections.

out_peers: u32

Number of outgoing connections we're trying to maintain.

reserved_nodes: Vec<String>

List of reserved node addresses.

non_reserved_mode: NonReservedPeerMode

The non-reserved peer mode.

client_version: String

Client identifier. Sent over the wire for debugging purposes.

node_name: String

Name of the node. Sent over the wire for debugging purposes.

transport: TransportConfig

Configuration for the transport layer.

Methods

impl NetworkConfiguration[src]

pub fn new() -> NetworkConfiguration[src]

Create a new instance of default settings.

pub fn new_local() -> NetworkConfiguration[src]

Create new default configuration for localhost-only connection with random port (useful for testing)

pub fn new_memory() -> NetworkConfiguration[src]

Create new default configuration for localhost-only connection with random port (useful for testing)

Trait Implementations

impl Default for NetworkConfiguration[src]

impl Clone for NetworkConfiguration[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Unpin for NetworkConfiguration

impl Send for NetworkConfiguration

impl Sync for NetworkConfiguration

impl UnwindSafe for NetworkConfiguration

impl RefUnwindSafe for NetworkConfiguration

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    Outer: AsRef<T> + AsMut<T> + From<T>,
    T: From<Outer>, 
[src]

fn from_ref(outer: &Outer) -> &T[src]

Get a reference to the inner from the outer.

fn from_mut(outer: &mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> Clear for T where
    T: InitializableFromZeroed + ?Sized
[src]

impl<T> InitializableFromZeroed for T where
    T: Default
[src]

impl<T> Erased for T[src]

impl<T, S> UniqueSaturatedInto<T> for S where
    S: TryInto<T>,
    T: Bounded
[src]

impl<T> CheckedConversion for T[src]

fn checked_from<T>(t: T) -> Option<Self> where
    Self: TryFrom<T>, 
[src]

Convert from a value of T into an equivalent instance of Option<Self>. Read more

fn checked_into<T>(self) -> Option<T> where
    Self: TryInto<T>, 
[src]

Consume self to return Some equivalent value of Option<T>. Read more

impl<T> SaturatedConversion for T[src]

fn saturated_from<T>(t: T) -> Self where
    Self: UniqueSaturatedFrom<T>, 
[src]

Convert from a value of T into an equivalent instance of Self. Read more

fn saturated_into<T>(self) -> T where
    Self: UniqueSaturatedInto<T>, 
[src]

Consume self to return an equivalent value of T. Read more

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]

impl<T> Erased for T[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<T> Typeable for T where
    T: Any
[src]

fn get_type(&self) -> TypeId[src]

Get the TypeId of this object.