Module zebra_network::peer_set::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§

  • A set of IPs from recent connection attempts.

Enums§

Functions§

  • Listens for peer connections on addr, then sets up each connection as a Zcash peer.
  • Set up a new inbound connection as a Zcash peer.
  • 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.
  • 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.
  • Initialize a peer set, using a network config, inbound_service, and latest_chain_tip.
  • Limit the number of initial_peers addresses entries to the configured peerset_initial_target_size.
  • Open a peer connection listener on config.listen_addr, returning the opened [TcpListener], and the address it is bound to.
  • Mark addr as a failed peer to address_book_updater.

Type Aliases§

  • A successful outbound peer connection attempt or inbound connection handshake.