Module initialize

Source
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§

CrawlerAction 🔒
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 over peerset_tx.
crawl 🔒
Try to get more peers using candidates, then queue a connection attempt using demand_tx. If there were no new peers and should_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 resulting peer::Clients through the peerset_tx channel.
dial 🔒
Try to connect to candidate using outbound_connector. Uses outbound_connection_tracker to track the active connection count.
init
Initialize a peer set, using a network config, inbound_service, and latest_chain_tip.
limit_initial_peers 🔒
Limit the number of initial_peers addresses entries to the configured peerset_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 to address_book_updater.

Type Aliases§

DiscoveredPeer 🔒
A successful outbound peer connection attempt or inbound connection handshake.