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. Host management for the P2P network.
Hosts is the main interface managing the registry and container.
Filters addresses before storing and publishes events on host/channel changes.
HostRegistry maps peer addresses to their current HostState.
HostContainer stores the hostlists (Grey, White, Gold, Black, Dark) behind a
single lock for atomic cross-list operations.
ยงHost Colors
Grey: Recently received hosts pending refinement.White: Hosts that passed refinement successfully.Gold: Hosts weโve connected to in OutboundSession.Black: Hostile hosts, blocked for the program duration.Dark: Hosts with unsupported transports. Shared with peers but not used locally. Cleared daily to avoid propagating stale entries.
Structsยง
- Host
Container - Container for all hostlists. Uses a single lock for atomic cross-list operations.
- Hosts
- Main interface for host management.
Enumsยง
Constantsยง
- BLACKLIST_
MAX_ ๐LEN - DARKLIST_
MAX_ ๐LEN - GREYLIST_
MAX_ ๐LEN - LOCAL_
HOST_ STRS - REGISTRY_
PRUNE_ ๐AGE_ SECS - How long a host can remain in Free state before being pruned from the registry. 24 hours is appropriate for long-running daemons.
- WHITELIST_
MAX_ ๐LEN
Traitsยง
- Unstable
Feature ๐Ip