pub struct BootstrapManager { /* private fields */ }Expand description
Bootstrap peer manager
Implementations§
Source§impl BootstrapManager
impl BootstrapManager
Sourcepub fn new(config: BootstrapConfig) -> Self
pub fn new(config: BootstrapConfig) -> Self
Create a new bootstrap manager
Sourcepub fn add_peers_from_strings(&self, addrs: &[String])
pub fn add_peers_from_strings(&self, addrs: &[String])
Add multiple bootstrap peers from strings
Sourcepub fn add_default_peers(&self)
pub fn add_default_peers(&self)
Add default IPFS bootstrap peers
Sourcepub fn get_peers_to_dial(&self) -> Vec<Multiaddr>
pub fn get_peers_to_dial(&self) -> Vec<Multiaddr>
Get peers that should be dialed
Sourcepub fn record_dial_attempt(&self, addr: &Multiaddr)
pub fn record_dial_attempt(&self, addr: &Multiaddr)
Record a dial attempt
Sourcepub fn record_connection_success(&self, addr: &Multiaddr, peer_id: PeerId)
pub fn record_connection_success(&self, addr: &Multiaddr, peer_id: PeerId)
Record a successful connection
Sourcepub fn record_connection_failure(&self, addr: &Multiaddr)
pub fn record_connection_failure(&self, addr: &Multiaddr)
Record a connection failure
Sourcepub fn record_disconnection(&self, peer_id: &PeerId)
pub fn record_disconnection(&self, peer_id: &PeerId)
Record peer disconnection
Sourcepub fn has_sufficient_connections(&self, min_peers: usize) -> bool
pub fn has_sufficient_connections(&self, min_peers: usize) -> bool
Check if we have enough bootstrap connections
Sourcepub fn connected_count(&self) -> usize
pub fn connected_count(&self) -> usize
Get number of connected bootstrap peers
Sourcepub fn stats(&self) -> BootstrapStats
pub fn stats(&self) -> BootstrapStats
Get bootstrap statistics
Sourcepub fn reset_circuit_breaker(&self, addr: &Multiaddr)
pub fn reset_circuit_breaker(&self, addr: &Multiaddr)
Reset a peer’s circuit breaker (for manual intervention)
Sourcepub fn reset_all_circuit_breakers(&self)
pub fn reset_all_circuit_breakers(&self)
Reset all circuit breakers
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BootstrapManager
impl !RefUnwindSafe for BootstrapManager
impl Send for BootstrapManager
impl Sync for BootstrapManager
impl Unpin for BootstrapManager
impl !UnwindSafe for BootstrapManager
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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