Struct tari_comms_dht::DhtConfig[][src]

pub struct DhtConfig {
    pub database_url: DbConnectionUrl,
    pub outbound_buffer_size: usize,
    pub num_neighbouring_nodes: usize,
    pub num_random_nodes: usize,
    pub broadcast_factor: usize,
    pub propagation_factor: usize,
    pub saf_msg_storage_capacity: usize,
    pub saf_num_closest_nodes: usize,
    pub saf_max_returned_messages: usize,
    pub saf_low_priority_msg_storage_ttl: Duration,
    pub saf_high_priority_msg_storage_ttl: Duration,
    pub saf_max_message_size: usize,
    pub saf_auto_request: bool,
    pub saf_minimum_request_period: Duration,
    pub msg_hash_cache_capacity: usize,
    pub msg_hash_cache_ttl: Duration,
    pub discovery_request_timeout: Duration,
    pub auto_join: bool,
    pub join_cooldown_interval: Duration,
    pub connectivity_update_interval: Duration,
    pub connectivity_random_pool_refresh: Duration,
    pub network: Network,
    pub network_discovery: NetworkDiscoveryConfig,
    pub short_ban_duration: Duration,
    pub allow_test_addresses: bool,
}

Fields

database_url: DbConnectionUrl

The DbConnectionUrl for the Dht database. Default: In-memory database

outbound_buffer_size: usize

The size of the buffer (channel) which holds pending outbound message requests. Default: 20

num_neighbouring_nodes: usize

The maximum number of peer nodes that a message has to be closer to, to be considered a neighbour Default: DEFAULT_NUM_NEIGHBOURING_NODES

num_random_nodes: usize

Number of random peers to include Default: DEFAULT_NUM_RANDOM_NODES

broadcast_factor: usize

Send to this many peers when using the broadcast strategy Default: 8

propagation_factor: usize

Send to this many peers when using the propagate strategy Default: 4

saf_msg_storage_capacity: usize

The maximum number of messages that can be stored using the Store-and-forward middleware. Default: 10_000

saf_num_closest_nodes: usize

A request to retrieve stored messages will be ignored if the requesting node is not within one of this nodes n closest nodes. Default 8

saf_max_returned_messages: usize

The maximum number of messages to return from a store and forward retrieval request. Default: 100

saf_low_priority_msg_storage_ttl: Duration

The time-to-live duration used for storage of low priority messages by the Store-and-forward middleware. Default: 6 hours

saf_high_priority_msg_storage_ttl: Duration

The time-to-live duration used for storage of high priority messages by the Store-and-forward middleware. Default: 3 days

saf_max_message_size: usize

The limit on the message size to store in SAF storage in bytes. Default 500 KiB

saf_auto_request: bool

When true, store and forward messages are requested from peers on connect (Default: true)

saf_minimum_request_period: Duration

The minimum period used to request SAF messages from a peer. When requesting SAF messages, it will request messages since the DHT last went offline, but this may be a small amount of time, so minimum_request_period can be used so that messages aren't missed.

msg_hash_cache_capacity: usize

The max capacity of the message hash cache Default: 10000

msg_hash_cache_ttl: Duration

The time-to-live for items in the message hash cache Default: 300s (5 mins)

discovery_request_timeout: Duration

The duration to wait for a peer discovery to complete before giving up. Default: 2 minutes

auto_join: bool

Set to true to automatically broadcast a join message when ready, otherwise false. Default: false

join_cooldown_interval: Duration

The minimum time between sending a Join message to the network. Joins are only sent when the node establishes enough connections to the network as determined by comms ConnectivityManager. If a join was sent and then state change happens again after this period, another join will be sent. Default: 10 minutes

connectivity_update_interval: Duration

The interval to update the neighbouring and random pools, if necessary. Default: 2 minutes

connectivity_random_pool_refresh: Duration

The interval to change the random pool peers. Default: 2 hours

network: Network

The active Network. Default: TestNet

network_discovery: NetworkDiscoveryConfig

Network discovery config

short_ban_duration: Durationallow_test_addresses: bool

This allows the use of test addresses in the network.

Implementations

impl DhtConfig[src]

pub fn default_testnet() -> Self[src]

pub fn default_mainnet() -> Self[src]

pub fn default_local_test() -> Self[src]

Trait Implementations

impl Clone for DhtConfig[src]

impl Debug for DhtConfig[src]

impl Default for DhtConfig[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T, U> Cast<U> for T where
    U: FromCast<T>, 

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

impl<'a, T> DefaultFeatures<'a> for T where
    T: 'a + Clone + Send + Sync

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

impl<T> FromBits<T> for T

impl<T> FromCast<T> for T

impl<T> InitializableFromZeroed for T where
    T: Default

impl<T> Instrument for T[src]

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

impl<T, U> IntoBits<U> for T where
    U: FromBits<T>, 

impl<T> IntoSql for T[src]

impl<'a, T> NonSyncFeatures<'a> for T where
    T: 'a + Clone

impl<T> SafeBorrow<T> for T where
    T: ?Sized

impl<T> Same<T> for T

type Output = T

Should always be Self

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<V, T> VZip<V> for T where
    V: MultiLane<T>,