libp2p_peer_store/
lib.rs

1//! Implementation of peer store that stores address information
2//! about foreign peers.
3//!
4//! ## Important Discrepancies
5//! - **PeerStore is a local**: The peer store itself doesn't facilitate any information exchange
6//!   between peers. You will need other protocols like `libp2p-kad` to share addresses you know
7//!   across the network.
8//! - **PeerStore is a standalone**: Other protocols cannot expect the existence of PeerStore, and
9//!   need to be manually hooked up to PeerStore in order to obtain information it provides.
10//!
11//! ## Usage
12//! Compose [`Behaviour`] with other [`NetworkBehaviour`](libp2p_swarm::NetworkBehaviour),
13//! and the PeerStore will automatically track addresses from
14//! [`FromSwarm::NewExternalAddrOfPeer`](libp2p_swarm::FromSwarm)
15//! and provide addresses when dialing peers(require `extend_addresses_through_behaviour` in
16//! [`DialOpts`](libp2p_swarm::dial_opts::DialOpts) when dialing).  
17//! Other protocols need to be manually hooked up to obtain information from
18//! or provide information to PeerStore.
19
20mod behaviour;
21pub mod memory_store;
22mod store;
23
24pub use behaviour::{Behaviour, Event};
25pub use store::Store;