libp2p / libp2p/rust-libp2p

misc: add a `PeerStore` behaviour

Open
#4,103 8 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

difficulty:moderate help wanted
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:

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.