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_connector
to 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_dial
is false, the connection attempt is skipped. - crawl_
and_ ๐dial - Given a channel
demand_rx
that signals a need for new peers, try to find and connect to new peers, and send the resultingpeer::Client
s through thepeerset_tx
channel. - dial ๐
- Try to connect to
candidate
usingoutbound_connector
. Usesoutbound_connection_tracker
to 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_peers
addresses 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
addr
as a failed peer toaddress_book_updater
.
Type Aliasesยง
- Discovered
Peer ๐ - A successful outbound peer connection attempt or inbound connection handshake.