# Struct ethcore_network::NetworkConfiguration [−] [src]

    pub struct NetworkConfiguration {
        pub config_path: Option<String>,
        pub net_config_path: Option<String>,
        pub listen_address: Option<SocketAddr>,
        pub public_address: Option<SocketAddr>,
        pub udp_port: Option<u16>,
        pub nat_enabled: bool,
        pub discovery_enabled: bool,
        pub boot_nodes: Vec<String>,
        pub use_secret: Option<Secret>,
        pub min_peers: u32,
        pub max_peers: u32,
        pub max_handshakes: u32,
        pub reserved_protocols: HashMap<ProtocolId, u32>,
        pub reserved_nodes: Vec<String>,
        pub non_reserved_mode: NonReservedPeerMode,
        pub allow_ips: AllowIP,
    }

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_address: Option<SocketAddr>`

IP address to listen for incoming connections. Listen to all connections by default

`public_address: Option<SocketAddr>`

IP address to advertise. Detected automatically if none.

`udp_port: Option<u16>`

Port for UDP connections, same as TCP by default

`nat_enabled: bool`

Enable NAT configuration

`discovery_enabled: bool`

Enable discovery

`boot_nodes: Vec<String>`

List of initial node addresses

`use_secret: Option<Secret>`

Use provided node key instead of default

`min_peers: u32`

Minimum number of connected peers to maintain

`max_peers: u32`

Maximum allowed number of peers

`max_handshakes: u32`

Maximum handshakes

`reserved_protocols: HashMap<ProtocolId, u32>`

Reserved protocols. Peers with <key> protocol get additional <value> connection slots.

`reserved_nodes: Vec<String>`

List of reserved node addresses.

`non_reserved_mode: NonReservedPeerMode`

The non-reserved peer mode.

`allow_ips: AllowIP`

IP filter

## Methods

### `impl NetworkConfiguration`
[src]

#### `fn new() -> Self`

Create a new instance of default settings.

#### `fn new_with_port(port: u16) -> NetworkConfiguration`

Create new default configuration with sepcified listen port.

#### `fn new_local() -> NetworkConfiguration`

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

## Trait Implementations

### `impl Debug for NetworkConfiguration`
[src]

#### `fn fmt(&self, __arg_0: &mut Formatter) -> Result`

Formats the value using the given formatter.

### `impl PartialEq for NetworkConfiguration`
[src]

#### `fn eq(&self, __arg_0: &NetworkConfiguration) -> bool`

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, __arg_0: &NetworkConfiguration) -> bool`

This method tests for `!=`.

### `impl Clone for NetworkConfiguration`
[src]

#### `fn clone(&self) -> NetworkConfiguration`

Returns a copy of the value. Read more

#### `fn clone_from(&mut self, source: &Self)`
1.0.0

Performs copy-assignment from `source`. Read more

### `impl Default for NetworkConfiguration`
[src]

#### `fn default() -> Self`

Returns the "default value" for a type. Read more

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)