Module darkfi::net::hosts

source ยท
Expand description

Hosts are a list of network addresses used when establishing outbound connections. Hosts are shared across the network through the address protocol. When attempting to connect, a node will loop through addresses in the hosts store until it finds ones to connect to.

Structsยง

  • A Container for managing Grey, White, Gold and Black hostlists. Exposes a common interface for writing to and querying hostlists.
  • Main parent class for the management and manipulation of hostlists. Keeps track of hosts and their current state via the HostRegistry, and stores hostlists and associated methods in the HostContainer. Also operates two publishers to notify other parts of the code base when new channels have been created or new hosts have been added to the hostlist.

Enumsยง

  • HostState ๐Ÿ”’
    HostState is a set of mutually exclusive states that can be Insert, Refine, Move, Connect, Suspend or Connected or Free.

Constantsยง

Type Aliasesยง

  • HostRegistry ๐Ÿ”’
    Keeps track of hosts and their current state. Prevents race conditions where multiple threads are simultaneously trying to change the state of a given host.
  • Atomic pointer to hosts object