Expand description
A peer set whose size is dynamically determined by resource constraints.
The PeerSet implementation is adapted from the one in tower::Balance.
Modulesยง
- recent_
by_ ๐ip - A set of IPs from recent connection attempts.
Enumsยง
- Crawler
Action ๐ - An action that the peer crawler can take.
Functionsยง
- accept_
inbound_ ๐connections - Listens for peer connections on
addr, then sets up each connection as a Zcash peer. - accept_
inbound_ ๐handshake - Set up a new inbound connection as a Zcash peer.
- add_
initial_ ๐peers - Use the provided
outbound_connectorto connect to the configured DNS seeder and disk cache initial peers, then send the resulting peer connections overpeerset_tx. - crawl ๐
- Try to get more peers using
candidates, then queue a connection attempt usingdemand_tx. If there were no new peers andshould_always_dialis false, the connection attempt is skipped. - crawl_
and_ ๐dial - Given a channel
demand_rxthat signals a need for new peers, try to find and connect to new peers, and send the resultingpeer::Clients through thepeerset_txchannel. - dial ๐
- Try to connect to
candidateusingoutbound_connector. Usesoutbound_connection_trackerto track the active connection count. - init
- Initialize a peer set, using a network
config,inbound_service, andlatest_chain_tip. - limit_
initial_ ๐peers - Limit the number of
initial_peersaddresses entries to the configuredpeerset_initial_target_size. - open_
listener ๐ - Open a peer connection listener on
config.listen_addr, returning the opened [TcpListener], and the address it is bound to. - report_
failed ๐ - Mark
addras a failed peer toaddress_book_updater.
Type Aliasesยง
- Discovered
Peer ๐ - A successful outbound peer connection attempt or inbound connection handshake.