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.


  • 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.


  • HostState 🔒
    HostState is a set of mutually exclusive states that can be Insert, Refine, Move, Connect, Suspend or Connected. The state is None when the corresponding host has been removed from the HostRegistry.


Type Aliases§

  • 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