3.0.ipv8.bootstrapping.udpbroadcast.bootstrapper

Attributes

Classes

Module Contents

3.0.ipv8.bootstrapping.udpbroadcast.bootstrapper.PROTOCOL_VERSION = b'\x00\x00'
3.0.ipv8.bootstrapping.udpbroadcast.bootstrapper.MAGIC = b'IPv8'
3.0.ipv8.bootstrapping.udpbroadcast.bootstrapper.HDR_ANNOUNCE
class 3.0.ipv8.bootstrapping.udpbroadcast.bootstrapper.BroadcastBootstrapEndpoint(overlay: 3.0.ipv8.types.Community)

Bases: asyncio.DatagramProtocol

Endpoint that opens a broadcast socket.

_socket: socket.socket | None = None
_transport: asyncio.BaseTransport | None = None
overlay
logger
async open() bool

Open the broadcast socket.

send(socket_address: 3.0.ipv8.types.Address, data: bytes) None

Attempt to send data to the given socket address and silently fail.

datagram_received(data: bytes, addr: 3.0.ipv8.types.Address) None

We received data on our broadcast socket.

Note that we do not use the broadcast socket but the overlay socket to send a reply.

close() None

Close this endpoint.

class 3.0.ipv8.bootstrapping.udpbroadcast.bootstrapper.UDPBroadcastBootstrapper(bootstrap_timeout: float = 30.0)

Bases: 3.0.ipv8.bootstrapping.bootstrapper_interface.Bootstrapper

Bootstrapper that finds peers by iterating over ALL 65k ports of the local broadcast address.

endpoint: BroadcastBootstrapEndpoint | None = None
overlay: 3.0.ipv8.types.Community | None = None
bootstrap_timeout
last_bootstrap: float = 0
async initialize(overlay: 3.0.ipv8.types.Community) bool

Initialize this bootstrapper for the given overlay.

beacon(service_prefix: bytes) None

Try to find a listener (fire and forget).

async get_addresses(overlay: 3.0.ipv8.types.Community, timeout: float) collections.abc.Iterable[3.0.ipv8.types.Address]

Attempt to find addresses. This method will never return addresses immediately.

keep_alive(overlay: 3.0.ipv8.types.Community) None

Send a “keep alive” message.

blacklist() collections.abc.Iterable[3.0.ipv8.types.Address]

Get the blacklisted addresses.

unload() None

Stop this bootstrapper.