mirror of
https://github.com/tendermint/tendermint.git
synced 2026-06-01 03:46:22 +00:00
This improves the prototype peer manager by: * Exporting `PeerManager`, making it accessible by e.g. reactors. * Replacing `Router.SubscribePeerUpdates()` with `PeerManager.Subscribe()`. * Tracking address/peer connection statistics, and retrying dial failures with exponential backoff. * Prioritizing peers, with persistent peers configuration. * Limiting simultaneous connections. * Evicting peers and upgrading to higher-priority peers. * Tracking peer heights, as a workaround for legacy shared peer state APIs. This is getting to a point where we need to determine precise semantics and implement tests, so we should figure out whether it's a reasonable abstraction that we want to use. The main questions are around the API model (i.e. synchronous method calls with the router polling the manager, vs. an event-driven model using channels, vs. the peer manager calling methods on the router to connect/disconnect peers), and who should have the responsibility of managing actual connections (currently the router, while the manager only tracks peer state).
p2p
The p2p package provides an abstraction around peer-to-peer communication.
Docs:
- Connection for details on how connections and multiplexing work
- Peer for details on peer ID, handshakes, and peer exchange
- Node for details about different types of nodes and how they should work
- Pex for details on peer discovery and exchange
- Config for details on some config option