misc: add a `PeerStore` behaviour
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.6k
- Forks
- 1.3k
- Avg merge
- 8h 47m
- Merged PRs (30d)
- 19
Description
Description
Other implementations have the concept of a PeerStore, should we add one to rust-libp2p too? I am thinking of a NetworkBehaviour implementation tracks currently connected peers and allows to add / remove addresses.
See related discussions:
- https://github.com/libp2p/rust-libp2p/pull/4101
- https://github.com/libp2p/rust-libp2p/issues/3633
- https://github.com/libp2p/rust-libp2p/discussions/2118
Motivation
Users should be able to query the connected peers in a simple way and add known addresses of peers that will contribute to establishing new connections.
Open questions
- Are the two topics connected-peers and adding new addresses related enough to merge them in one behaviour?
- Is storing addresses in-memory fine for now?
- Should we add a persistent address book as well? e.g. an SQL-based one?
Are you planning to do it yourself in a pull request?
No
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing pull request 4101, issue 3633, and discussion 2118 to understand the existing PeerStore proposals. Resolve whether connected-peer tracking and address storage belong in one NetworkBehaviour, and whether storage should be in-memory or persistent. Done requires an agreed scope and design before implementation can begin.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100