Skip to content

Conversation

@ashutosh-src
Copy link
Contributor

@ashutosh-src ashutosh-src commented Dec 3, 2025

  1. Add P2P Conceptual guide
  2. Add P2P Procedural/How-to guide

@ashutosh-src ashutosh-src self-assigned this Dec 3, 2025
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 3, 2025

Deploying docs-source-network with  Cloudflare Pages  Cloudflare Pages

Latest commit: b3aa6c6
Status: ✅  Deploy successful!
Preview URL: https://0b02e9e1.docs-source-network.pages.dev
Branch Preview URL: https://p2p-guide-revamp.docs-source-network.pages.dev

View logs

@ashutosh-src ashutosh-src requested a review from jsimnz December 5, 2025 18:30
Copy link
Member

@jsimnz jsimnz left a comment

Choose a reason for hiding this comment

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

Some small fixups on the guide

To retrieve your node's Peer ID using HTTP:

```bash
curl -H "Accept: application/json" http://localhost:9181/api/p2p/info
Copy link
Member

Choose a reason for hiding this comment

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

replace with defradb client p2p info

Example:

```bash
defradb client p2p document add bafybeihz5k3c2jzx7m4x5v6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f3
Copy link
Member

Choose a reason for hiding this comment

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

The bafybeihz5k3c2jzx7m4x5v6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f3 is a CID formatted string.
You can replace with bae-619ea0d2-35ba-5e8c-ac4d-2b769937213b

Comment on lines +153 to +177
```bash
curl -X POST http://localhost:9181/api/p2p/replicators \
-H "Content-Type: application/json" \
-d '{
"Info": {
"ID": "<peer_id>",
"Addrs": ["<peer_address>"]
},
"Collections": ["<collection_name>"]
}'
```

Example:

```bash
curl -X POST http://localhost:9181/api/p2p/replicators \
-H "Content-Type: application/json" \
-d '{
"Info": {
"ID": "12D3KooWEFCQ1iGMobsmNTPXb758kJkFc7XieQyGKpsuMxeDktz4",
"Addrs": ["/ip4/192.168.1.100/tcp/9171"]
},
"Collections": ["Books"]
}'
```
Copy link
Member

Choose a reason for hiding this comment

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

We can omit these curl methods for now. In the future, we can have every snippet have their curl vs CLI variation

Use the P2P info endpoint to see your current peer connections:

```bash
curl http://localhost:9181/api/p2p/info
Copy link
Member

Choose a reason for hiding this comment

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

Same note above about this CLI example

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.

4 participants