3.0.ipv8.peerdiscovery.churn

Classes

Module Contents

class 3.0.ipv8.peerdiscovery.churn.RandomChurn(overlay: 3.0.ipv8.types.Overlay, sample_size: int = 8, ping_interval: float = 10.0, inactive_time: float = 27.5, drop_time: float = 57.5)

Bases: 3.0.ipv8.peerdiscovery.discovery.DiscoveryStrategy[3.0.ipv8.types.Overlay]

Select random peers, ping them if inactive, remove them if unresponsive.

_pinged: dict[3.0.ipv8.types.Address, float]
sample_size
ping_interval
inactive_time
drop_time
should_drop(peer: 3.0.ipv8.types.Peer) bool

Have we passed the time before we consider this peer to be unreachable.

is_inactive(peer: 3.0.ipv8.types.Peer) bool

Have we passed the time before we consider this peer to be inactive.

take_step() None

Select a new (set of) peer(s) to investigate liveness for.