Skip to content

#311 - Document relevant parts of libp2p#673

Open
richardnguyen0715 wants to merge 1 commit into
learning-at-home:masterfrom
richardnguyen0715:issues-about-docs
Open

#311 - Document relevant parts of libp2p#673
richardnguyen0715 wants to merge 1 commit into
learning-at-home:masterfrom
richardnguyen0715:issues-about-docs

Conversation

@richardnguyen0715
Copy link
Copy Markdown

Closes #311

This PR adds a new documentation page describing how Hivemind uses libp2p for networking.

The document introduces key libp2p concepts relevant to Hivemind, including:

  • Multiaddrs and how a single peer can expose multiple endpoints
  • Connection deduplication based on peer ID
  • The role of the libp2p daemon (p2pd) and how Hivemind interacts with it via RPC

It also includes links to upstream libp2p documentation for further reference.

Let me know if anything should be expanded or clarified.

Copilot AI review requested due to automatic review settings April 12, 2026 13:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new user-facing documentation page explaining how Hivemind leverages libp2p concepts (multiaddrs, peer IDs, connection deduplication) and how it integrates with a p2pd daemon, and wires this page into the Sphinx docs table of contents.

Changes:

  • Add a new docs/user/libp2p.md page describing key libp2p concepts relevant to Hivemind.
  • Link the new page from docs/index.rst so it appears in the rendered documentation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
docs/user/libp2p.md New documentation page covering multiaddrs, connection deduplication, and the p2pd daemon integration.
docs/index.rst Adds the new user/libp2p page to the Sphinx toctree.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/user/libp2p.md

## The P2P Daemon

Hivemind uses the [Go implementation of the libp2p daemon](https://github.com/libp2p/go-libp2p-daemon). Rather than implementing libp2p directly in Python, Hivemind communicates with a background `p2pd` process via an RPC interface. This prevents many concurrency issues in Python and leverages a highly optimized Go networking stack.
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The link for the libp2p daemon points to libp2p/go-libp2p-daemon, but this repo builds/downloads p2pd from the learning-at-home/go-libp2p-daemon fork (see README/setup.py). Please update the link (and, if relevant, note that Hivemind uses a forked daemon/version) to avoid sending contributors to the wrong codebase.

Suggested change
Hivemind uses the [Go implementation of the libp2p daemon](https://github.com/libp2p/go-libp2p-daemon). Rather than implementing libp2p directly in Python, Hivemind communicates with a background `p2pd` process via an RPC interface. This prevents many concurrency issues in Python and leverages a highly optimized Go networking stack.
Hivemind uses a forked [Go implementation of the libp2p daemon](https://github.com/learning-at-home/go-libp2p-daemon). Rather than implementing libp2p directly in Python, Hivemind communicates with a background `p2pd` process via an RPC interface. This prevents many concurrency issues in Python and leverages a highly optimized Go networking stack.

Copilot uses AI. Check for mistakes.
Comment thread docs/user/libp2p.md
Example of a multiaddr:
`/ip4/192.168.1.10/tcp/8000/p2p/QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N`

A single peer (`p2p/Qm...`) might be accessible through multiple distinct multiaddrs (e.g., an internal IPv4 address, a public IPv4 address, or via different transport protocols).
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor correctness/consistency: the peer-id suffix in a multiaddr is written as /p2p/<peerId> (with a leading slash). p2p/Qm... might be confusing given the example above uses .../p2p/....

Suggested change
A single peer (`p2p/Qm...`) might be accessible through multiple distinct multiaddrs (e.g., an internal IPv4 address, a public IPv4 address, or via different transport protocols).
A single peer (`/p2p/Qm...`) might be accessible through multiple distinct multiaddrs (e.g., an internal IPv4 address, a public IPv4 address, or via different transport protocols).

Copilot uses AI. Check for mistakes.
Comment thread docs/user/libp2p.md
Comment on lines +11 to +13
Example of a multiaddr:
`/ip4/192.168.1.10/tcp/8000/p2p/QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N`

Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with other docs pages (e.g., docs/user/dht.md) and to keep long multiaddrs readable/wrappable, consider rendering the multiaddr example as a fenced code block (e.g., shell ... ), instead of inline code.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document relevant parts of libp2p

2 participants