-
Notifications
You must be signed in to change notification settings - Fork 5
Peer to Peer Guide Revamp #195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Deploying docs-source-network with
|
| 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 |
7d24e64 to
3074235
Compare
jsimnz
left a comment
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
| ```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"] | ||
| }' | ||
| ``` |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
Uh oh!
There was an error while loading. Please reload this page.