pub struct PromiscuousStrategyConfig {
pub network_quality_open_threshold: f64,
pub network_quality_close_threshold: f64,
pub minimum_peer_pings: u32,
pub initial_delay: Duration,
pub new_channel_stake: HoprBalance,
pub minimum_safe_balance: HoprBalance,
pub max_channels: Option<usize>,
pub enforce_max_channels: bool,
}Expand description
Configuration of PromiscuousStrategy.
Fields§
§network_quality_open_threshold: f64A quality threshold between 0 and 1 used to determine whether the strategy should open channel with the peer.
Default is 0.9
network_quality_close_threshold: f64A quality threshold between 0 and 1 used to determine whether the strategy should close channel with the peer. If set to 0, no channels will be closed.
Default is 0.2
minimum_peer_pings: u32Number of heartbeats sent to the peer before it is considered for selection.
Default is 50.
initial_delay: DurationInitial delay from startup before the strategy starts taking decisions.
Default is 5 minutes.
new_channel_stake: HoprBalanceA stake of tokens that should be allocated to a channel opened by the strategy.
Default is 10 wxHOPR
minimum_safe_balance: HoprBalanceMinimum token balance of the node’s Safe. When reached, the strategy will not open any new channels.
Default is 1000 wxHOPR
max_channels: Option<usize>The maximum number of opened channels the strategy should maintain.
Defaults to square-root of the sampled network size, the minimum is 10.
enforce_max_channels: boolIf set, the strategy will aggressively close channels
(even with peers above the network_quality_close_threshold)
if the number of opened outgoing channels (regardless if opened by the strategy or manually) exceeds the
max_channels limit.
Default is true.
Trait Implementations§
Source§impl Clone for PromiscuousStrategyConfig
impl Clone for PromiscuousStrategyConfig
Source§fn clone(&self) -> PromiscuousStrategyConfig
fn clone(&self) -> PromiscuousStrategyConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PromiscuousStrategyConfig
impl Debug for PromiscuousStrategyConfig
Source§impl Default for PromiscuousStrategyConfig
impl Default for PromiscuousStrategyConfig
Source§fn default() -> Self
fn default() -> Self
Return PromiscuousStrategyConfig { network_quality_open_threshold: default_network_quality_open_threshold(), network_quality_close_threshold: default_network_quality_close_threshold(), minimum_peer_pings: default_minimum_pings(), initial_delay: default_initial_delay(), new_channel_stake: default_new_channel_stake(), minimum_safe_balance: default_min_safe_balance(), max_channels: Default::default(), enforce_max_channels: true }
Source§impl<'de> Deserialize<'de> for PromiscuousStrategyConfig
impl<'de> Deserialize<'de> for PromiscuousStrategyConfig
Source§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>,
Source§impl Validate for PromiscuousStrategyConfig
impl Validate for PromiscuousStrategyConfig
impl StructuralPartialEq for PromiscuousStrategyConfig
Auto Trait Implementations§
impl Freeze for PromiscuousStrategyConfig
impl RefUnwindSafe for PromiscuousStrategyConfig
impl Send for PromiscuousStrategyConfig
impl Sync for PromiscuousStrategyConfig
impl Unpin for PromiscuousStrategyConfig
impl UnwindSafe for PromiscuousStrategyConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more