Skip to content
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

docs: Update docs to include p2p Peer ID and keys #686

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/src/storage-provider-cli/client/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <PUBLIC_KEY_PATH>
12D3KooWCYTvmMFvMgo4CKNMaCTJQhUv7BN1TB3xrSPZJ6FVErmH
```
jmg-duarte marked this conversation as resolved.
Show resolved Hide resolved
18 changes: 17 additions & 1 deletion docs/src/storage-provider-cli/server.md
Original file line number Diff line number Diff line change
@@ -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 <PRIVATE_KEY_PATH> -outpubkey <PUBLIC_KEY_PATH>
```


## CLI Options
<!-- Sadly, tables will not cut it here, since the text is just too big for the table. -->

### `--sr25519-key`
Expand Down
Loading