From 08337387611da111e5da2f5c3c2e5b640146ea8e Mon Sep 17 00:00:00 2001 From: aidan46 <47111423+aidan46@users.noreply.github.com> Date: Tue, 21 Jan 2025 11:35:19 +0100 Subject: [PATCH] docs: Update docs to include p2p Peer ID and keys (#686) --- docs/src/storage-provider-cli/client/index.md | 11 +++++++++++ docs/src/storage-provider-cli/server.md | 18 +++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/docs/src/storage-provider-cli/client/index.md b/docs/src/storage-provider-cli/client/index.md index 518b990f2..b97cdd087 100644 --- a/docs/src/storage-provider-cli/client/index.md +++ b/docs/src/storage-provider-cli/client/index.md @@ -114,3 +114,14 @@ $ SIGNED_DEAL='{ $ polka-storage-provider-client publish-deal "$SIGNED_DEAL" 0 ``` + +## `generate-peer-id` + +The `generate-peer-id` command generates a Peer ID from an ed25519 public key in PEM file format. + +To generate an ed25519 keypair check the [Polka Storage Provider server documentation](../server.md#p2p-key-generation). + +```bash +$ polka-storage-provider-client generate-peer-id --pubkey +12D3KooWCYTvmMFvMgo4CKNMaCTJQhUv7BN1TB3xrSPZJ6FVErmH +``` \ No newline at end of file diff --git a/docs/src/storage-provider-cli/server.md b/docs/src/storage-provider-cli/server.md index e3febfde7..973d2b50c 100644 --- a/docs/src/storage-provider-cli/server.md +++ b/docs/src/storage-provider-cli/server.md @@ -1,7 +1,23 @@ # Polka Storage Provider — Server -This chapter covers the available CLI options for the Polka Storage Provider server. +This chapter covers the Polka Storage Provider server. +## P2P Key generation + +The Polka Storage Provider server runs a p2p node that is used to map Peer ID's to Multi-addresses. +The server can run either a bootstrap node, used to aid in discovery, +or a registration node, which registers to a bootstrap node with their Peer ID to Multi-address mapping. +For both of these node types, the server needs an ed25519 private key. +The ed25519 public key is used to create a Peer ID using the [Polka Storage Provider client](./client/index.md#generate-peer-id). + +To generate the ed25519 keypair use the following command: + +```bash +openssl genpkey -algorithm ED25519 -out -outpubkey +``` + + +## CLI Options ### `--sr25519-key`