3.0.ipv8.bootstrapping.bootstrapper_interface
Classes
Module Contents
- class 3.0.ipv8.bootstrapping.bootstrapper_interface.Bootstrapper
Bases:
abc.ABCA script to connect to external bootstrapping resources, using external hardware.
- When not to crash:
Loading this module file when missing dependencies.
Initializing a subclass when the service is unavailable (return
False).Failing to retrieve peers for a service (return an empty iterable, e.g.
[]).
- When to crash:
Initializing this module subclass when missing dependencies.
- initialized = False
- abstract initialize(overlay: 3.0.ipv8.types.Community) asyncio.Future | collections.abc.Coroutine
Start connecting to this bootstrapping service. Don’t perform any network traffic in
__init__!You are encourages to implement this method as non-async to have faster bootstrapper inclusion.
- Parameters:
overlay – the network overlay to initialize for.
- Returns:
whether the initialization was successful.
- abstract get_addresses(overlay: 3.0.ipv8.types.Community, timeout: float) collections.abc.Iterable[3.0.ipv8.types.Address]
- Async:
Return some IPv8 addresses (if available) from this bootstrapping service. These addresses should be walkable (not blocked by a NAT or firewall).
- Parameters:
overlay – the network overlay to get peers for.
timeout – the maximum time we wish to wait until we get any result (i.e. an empty list).
- Returns:
the addresses for the given service_id.
- abstract keep_alive(overlay: 3.0.ipv8.types.Community) None
Periodically called to keep this bootstrap connection alive.
- Parameters:
overlay – the network overlay to keep alive.
- abstract blacklist() collections.abc.Iterable[3.0.ipv8.types.Address]
Returns the blacklisted addresses for this Bootstrapper.