[][src]Struct crust::Config

pub struct Config {
    pub hard_coded_contacts: Vec<SocketAddr>,
    pub tcp_acceptor_port: Option<u16>,
    pub force_acceptor_port_in_ext_ep: bool,
    pub service_discovery_port: Option<u16>,
    pub service_discovery_listener_port: Option<u16>,
    pub bootstrap_cache_name: Option<String>,
    pub whitelisted_node_ips: Option<HashSet<IpAddr>>,
    pub whitelisted_client_ips: Option<HashSet<IpAddr>>,
    pub network_name: Option<String>,
    pub dev: Option<DevConfig>,
}

Crust configuration settings

Fields

hard_coded_contacts: Vec<SocketAddr>

Direct contacts one should connect to

tcp_acceptor_port: Option<u16>

Port for TCP acceptor

force_acceptor_port_in_ext_ep: bool

Force usage of tcp_acceptor_port as our router mapped port. Normally if there is a port forwarding, crust will find out what the external world sees our local tcp acceptor endpoint as and include this information in our connection info that we share with others. However there are routers/firewalls in the wild which behave differently when a port is forwarded. They allow inbound connection through the forwarded port, but all outbound connections through the forwarded port get remapped to some ephemeral port. This prevents crust from knowing what the world sees our tcp_acceptor_port as because outbound connections get remapped although the port had been forwarded. In such scenarios, the user can specify this value as true, which will force crust to add the above tcp_acceptor_port to one of our externally reachable endpoint.

service_discovery_port: Option<u16>

Port for service discovery on local network. This port is used to broadcast messages to.

service_discovery_listener_port: Option<u16>

You can configure service discovery server to listen on a separate port. This becomes useful when you want to run multiple instances of Crust on the same machine. By default it will use the same as service_discovery_port value.

bootstrap_cache_name: Option<String>

File for bootstrap cache

whitelisted_node_ips: Option<HashSet<IpAddr>>

Whitelisted nodes who are allowed to bootstrap off us or to connect to us

whitelisted_client_ips: Option<HashSet<IpAddr>>

Whitelisted clients who are allowed to bootstrap off us

network_name: Option<String>

Network ID

This is a mechanism to prevent nodes from different decentralized networks to connect to each other (issue #209)

dev: Option<DevConfig>

Optional developer configuration

Trait Implementations

impl Eq for Config[src]

impl PartialEq<Config> for Config[src]

impl Clone for Config[src]

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

Performs copy-assignment from source. Read more

impl Default for Config[src]

impl Debug for Config[src]

impl Serialize for Config[src]

impl<'de> Deserialize<'de> for Config[src]

Auto Trait Implementations

impl Send for Config

impl Sync for Config

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

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

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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> DebugAny for T where
    T: Any + Debug

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> UnsafeAny for T where
    T: Any