latest.ipv8.dht.payload

Module Contents

Classes

PingRequestPayload

Payload to send ping messages with a given identifier nonce.

PingResponsePayload

Payload to respond to pings with a given identifier.

StoreRequestPayload

Payload for a token-holder to send a target certain values to store, with a given identifier nonce.

StoreResponsePayload

Response that the previously-given values have been stored.

FindRequestPayload

Attempt for our lan address to have the given target fetch values and nodes for us from a given starting offset,

FindResponsePayload

Response to a find request with the known values and nodes for the queried starting offset.

StorePeerRequestPayload

Request to another node to register our own node (id) as a server of the given target.

StorePeerResponsePayload

Confirmation that a node (id) has been stored as part of our tree.

ConnectPeerRequestPayload

Request for our lan address to be introduced to peers in the target range.

ConnectPeerResponsePayload

A response to a connection request, with the nodes that have been punctured (and are hopefully connectable).

StrPayload

Paylaod to pack bytes.

SignedStrPayload

Payload to pack bytes with a version and a public key.

NodePacker

Serialization packing format for DHT nodes.

class latest.ipv8.dht.payload.PingRequestPayload

Bases: latest.ipv8.messaging.lazy_payload.VariablePayloadWID

Payload to send ping messages with a given identifier nonce.

msg_id = 1
names = ['identifier']
format_list = ['I']
identifier: int
class latest.ipv8.dht.payload.PingResponsePayload

Bases: latest.ipv8.messaging.lazy_payload.VariablePayloadWID

Payload to respond to pings with a given identifier.

msg_id = 2
names = ['identifier']
format_list = ['I']
identifier: int
class latest.ipv8.dht.payload.StoreRequestPayload

Bases: latest.ipv8.messaging.lazy_payload.VariablePayloadWID

Payload for a token-holder to send a target certain values to store, with a given identifier nonce.

msg_id = 3
names = ['identifier', 'token', 'target', 'values']
format_list = ['I', '20s', '20s', 'varlenH-list']
identifier: int
token: bytes
target: bytes
values: list[bytes]
class latest.ipv8.dht.payload.StoreResponsePayload

Bases: latest.ipv8.messaging.lazy_payload.VariablePayloadWID

Response that the previously-given values have been stored.

msg_id = 4
names = ['identifier']
format_list = ['I']
identifier: int
class latest.ipv8.dht.payload.FindRequestPayload

Bases: latest.ipv8.messaging.lazy_payload.VariablePayloadWID

Attempt for our lan address to have the given target fetch values and nodes for us from a given starting offset, potentially with a request to force new node connections even if some are already known.

msg_id = 5
names = ['identifier', 'lan_address', 'target', 'offset', 'force_nodes']
format_list = ['I', 'ip_address', '20s', 'I', '?']
identifier: int
lan_address: latest.ipv8.types.Address
target: bytes
offset: int
force_nodes: bool
class latest.ipv8.dht.payload.FindResponsePayload

Bases: latest.ipv8.messaging.lazy_payload.VariablePayloadWID

Response to a find request with the known values and nodes for the queried starting offset.

msg_id = 6
names = ['identifier', 'token', 'values', 'nodes']
format_list = ['I', '20s', 'varlenH-list', 'node-list']
identifier: int
token: bytes
values: list[bytes]
nodes: list[latest.ipv8.dht.routing.Node]
class latest.ipv8.dht.payload.StorePeerRequestPayload

Bases: latest.ipv8.messaging.lazy_payload.VariablePayloadWID

Request to another node to register our own node (id) as a server of the given target.

msg_id = 7
names = ['identifier', 'token', 'target']
format_list = ['I', '20s', '20s']
identifier: int
token: bytes
target: bytes
class latest.ipv8.dht.payload.StorePeerResponsePayload

Bases: latest.ipv8.messaging.lazy_payload.VariablePayloadWID

Confirmation that a node (id) has been stored as part of our tree.

msg_id = 8
names = ['identifier']
format_list = ['I']
identifier: int
class latest.ipv8.dht.payload.ConnectPeerRequestPayload

Bases: latest.ipv8.messaging.lazy_payload.VariablePayloadWID

Request for our lan address to be introduced to peers in the target range.

msg_id = 9
names = ['identifier', 'lan_address', 'target']
format_list = ['I', 'ip_address', '20s']
identifier: int
lan_address: latest.ipv8.types.Address
target: bytes
class latest.ipv8.dht.payload.ConnectPeerResponsePayload

Bases: latest.ipv8.messaging.lazy_payload.VariablePayloadWID

A response to a connection request, with the nodes that have been punctured (and are hopefully connectable).

msg_id = 10
names = ['identifier', 'nodes']
format_list = ['I', 'node-list']
identifier: int
nodes: list[latest.ipv8.dht.routing.Node]
class latest.ipv8.dht.payload.StrPayload

Bases: latest.ipv8.messaging.lazy_payload.VariablePayload

Paylaod to pack bytes.

names = ['data']
format_list = ['raw']
data: bytes
class latest.ipv8.dht.payload.SignedStrPayload

Bases: latest.ipv8.messaging.lazy_payload.VariablePayload

Payload to pack bytes with a version and a public key.

names = ['data', 'version', 'public_key']
format_list = ['varlenH', 'I', 'varlenH']
data: bytes
version: int
public_key: bytes
class latest.ipv8.dht.payload.NodePacker(serializer: latest.ipv8.messaging.serialization.Serializer)

Bases: latest.ipv8.messaging.serialization.Packer

Serialization packing format for DHT nodes.

pack(node: latest.ipv8.dht.routing.Node) bytes

Pack the given node to bytes.

unpack(data: bytes, offset: int, unpack_list: list, *args: object) int

Unpack the node format from the given offset in the data and add the unpacked object to the list.