#311 - Document relevant parts of libp2p#673
Conversation
There was a problem hiding this comment.
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.mdpage describing key libp2p concepts relevant to Hivemind. - Link the new page from
docs/index.rstso 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.
|
|
||
| ## 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. |
There was a problem hiding this comment.
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.
| 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. |
| 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). |
There was a problem hiding this comment.
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/....
| 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). |
| Example of a multiaddr: | ||
| `/ip4/192.168.1.10/tcp/8000/p2p/QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N` | ||
|
|
There was a problem hiding this comment.
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.
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:
p2pd) and how Hivemind interacts with it via RPCIt also includes links to upstream libp2p documentation for further reference.
Let me know if anything should be expanded or clarified.