Expand description
§Node
Datastructures and functions related to representing members of the network and how to connect to them.
The functionality is split into two core areas:
-
Address: The kademlia-like routing details for finding a node in the decentralized routing system.
-
Connection: How to establish a connection to a node using direct TCP/UDP connections. In the future this will have to be modularized further to allow for different transport layers and protocol. (TODO: Integrate into proxy / indirect system).
In addition each node also contains other fields like timestamps and (in the future) a cache of recent messages.
Structs§
- Address
- Routing address based on kademlia keys. Poly1305 public keys are used as the actual addresses, on which distance metrics are implemented.
- Center
- Config for self / this node, currently as part of the Node module, might get restructured into a dedicated module in the future, should it increase in scope. It has to be created before all other nodes and stored in the interface.
- Link
- Since the term Connection is already used to represent an acitve connection between two nodes the information on how to establish this connection are grouped under the term “Link”. Next to the two obvious once, which are currently locked to TCP/IP like values, the public IP addr and the port, there are also two internal fields that represent wheather a node is actually reachable. A simlpe boolean value is used to store the status and a counter will be increased on every attempt, which is supposed to happen periodically until the node has been reached or the number of attempts exceeds a set maximum.
- Node
- Represents a singe Node in the system. It simply stores the (optional) connection details, the routing Address and a timestamp. This does not represent the actual connection to any node, simply information on how to connect to it (both directly and indirectly). The data will get populated over time through a dedicated lookup thread.
Traits§
- ToAddress
- Since sometimes the user has to interact with Addresses directly, it might be easier to use a trait object, so that a number of different types can be used to create Addresses.