Module protocol

Source

Structs§

AckMessage
An acknowledge message sent back to the sender of a packet in response to a return receipt being required by a given packet Ack messages contain the packet’s common, derived id that identifies which message the packet was derived from, the packet number of the packet being acknowledged and src a byte representation of a socket address.
Message
A message struct contains a header and message data
MessageKey
A tuple struct containing a byte representation of a 256 bit key
Packet
Packet contains a common id derived from the message n is the packet number, total_n is the total number of packets generated by the message, bytes is a hexadecimal string representaiton of the MessageData broken down into packet(s) ret is a 0 or 1 representing a return receipt.

Enums§

Header
Headers to identify and route messages to the proper component Request, Response, Gossip and Ack allows for easy routing once the packets have been received and aggregated into a message
KadMessage
A message for the Kademlia DHT protocol 3 different variants, Request, Response, and Kill

Traits§

Packetize
A trait implemented on objects that need to be sent across the network, whether kademlia, gossip, or some other protocol
Protocol

Functions§

packetize
A function that returns a vector of n Packet(s) based on the size of the MessageData passed to it.

Type Aliases§

AddressBytes
InnerKey
MessageData
Nodes
Packets
Peer
There are many instances where a byte representation of a given struct or enu is passed through a function or used for something To make it easier to distinguish what the byte vector is intending to represent, we have some custom types used instead of passsing in a Vec alone.
RPCBytes
RequestBytes
ResponseBytes
ReturnReceipt
StoreKey
Value