3.0.ipv8.overlay
Attributes
Classes
Module Contents
- class 3.0.ipv8.overlay.Settings
Bases:
types.SimpleNamespaceOverlay settings, extensible for Overlay subclasses.
- my_peer: 3.0.ipv8.types.Peer
The (private key) peer of this peer.
- endpoint: 3.0.ipv8.types.Endpoint
The endpoint to use for messaging.
- network: 3.0.ipv8.peerdiscovery.network.Network
The network graph backend.
- 3.0.ipv8.overlay.SettingsClass
- class 3.0.ipv8.overlay.Overlay(settings: SettingsClass)
Bases:
3.0.ipv8.messaging.interfaces.endpoint.EndpointListener,3.0.ipv8.taskmanager.TaskManager,Generic[SettingsClass]Interface for an Internet overlay.
- serializer
- crypto
- community_id
- my_peer
- logger
- network
- get_serializer() 3.0.ipv8.messaging.serialization.Serializer
Get a Serializer for this Overlay.
- abstract on_packet(packet: tuple[3.0.ipv8.types.Address, bytes]) None
Callback for when data is received on this endpoint.
- Parameters:
packet – the received packet, in (source, binary string) format.
- update_global_time(global_time: int) None
Increase the local global time if the given GLOBAL_TIME is larger.
- get_available_strategies() dict[str, type[3.0.ipv8.peerdiscovery.discovery.DiscoveryStrategy]]
Supply custom DiscoveryStrategies for use with this Overlay. This is used by the configuration system to allow for non-globally defined strategies.
- Returns:
a dictionary of names and DiscoveryStrategy subclass classes
- Return type:
{str: class<DiscoveryStrategy>}
- abstract walk_to(address: 3.0.ipv8.types.Address) None
Puncture the NAT of an address.
- Parameters:
address – the address to walk to (ip, port)
- abstract get_new_introduction(from_peer: 3.0.ipv8.types.Peer | None = None) None
Get a new IP address to walk to from a random, or selected peer.
- Parameters:
from_peer – the peer to ask for an introduction
- abstract get_peers() list[3.0.ipv8.types.Peer]
Get the peers for this specific overlay.
- Returns:
the peers in the Network that use this overlay
- abstract get_walkable_addresses() list[3.0.ipv8.types.Address]
Get the list of IPv4 addresses we can walk to on this overlay.
- get_peer_for_introduction(exclude: 3.0.ipv8.types.Peer | None = None) 3.0.ipv8.types.Peer | None
Get a peer for introduction.
- Param:
exclude: optionally specify a peer that is not considered eligible for introduction
- Returns:
a Peer to send an introduction request to, or None if there are no available