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

chore: Add CLI description to docs #239

Merged
merged 2 commits into from
Apr 4, 2024
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
1 change: 1 addition & 0 deletions docs/general/Arhitecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

## Components

- **[CLI commands](/docs/general/CLI.md)** - overview of CLI commands
MakMuftic marked this conversation as resolved.
Show resolved Hide resolved
- **[Fees](/docs/general/Fees.md)** - high-level overview of handling fees
- **[Relayers](/docs/Home.md)** - relayer technical documentation
- **[Topology Map](/docs/general/Topology.md)** - overview of topology map usage
Expand Down
67 changes: 67 additions & 0 deletions docs/general/CLI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Sygma Relayer CLI Guide

### Introduction

This guide details specific Command Line Interface (CLI) commands for the Sygma relayer, focusing on functionalities provided in the `topology`, `peer`, and `utils` modules.

## Topology commands

### Encrypt Topology Command (topology)

#### Usage:
`./sygma-relayer topology encrypt --path [path] --encryption-key [key]`

#### Description:
Encrypt the provided topology with AES CTR. Outputs IV and ciphertext in hex.

#### Flags:
- `--path`: Path to JSON file with network topology.
- `--encryption-key`: Password to encrypt topology.

### Test Topology Command (topology)

#### Usage:
`./sygma-relayer topology test --url [url] --decryption-key [key] --hash [hash]`

#### Description:
Test if the provided URL contains a topology that can be decrypted with the provided password and parsed accordingly.

#### Flags:
- `--decryption-key`: Password to decrypt topology.
- `--url`: URL to fetch topology.
- `--hash`: Hash of the topology.

## Libp2p (peer) commands

### Generate Key Command (peer)

#### Usage:
`./sygma-relayer peer gen-key`

#### Description:
Generate a libp2p identity key using RSA with a key length of 2048 bits.

### Peer Info Command (peer)

#### Usage:
`./sygma-relayer peer info --private-key [key]`

#### Description:
Calculate a libp2p peer ID from the provided base64 encoded libp2p private key.

#### Flags:
- `--private-key`: Base64 encoded libp2p private key.

## Other util commands

### Derivate SS58 Command (utils)

#### Usage:
`./sygma-relayer utils derivateSS58 --privateKey [key] --networkID [id]`

#### Description:
Print an SS58 formatted address (Polkadot) for a given PrivateKey in hex.

#### Flags:
- `--privateKey`: Hex encoded private key.
- `--networkID`: Network ID for a checksum, as per the registry.
1 change: 1 addition & 0 deletions docs/general/Topology.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Topology should be encrypted with AES using CTR mode.
IPFS should return hex formatted IV + data. To help you there are 2 utility CLI described below.

## Utility CLI
For more details on all CLI commands you can check out [CLI commands page](/docs/general/CLI.md).

`./relayer topology encrypt --path ./topology.json --encryptionKey 123`
This command will encrypt provided topology and output corresponding hash and encrypted toplogy in hex representation (iv + data)
Expand Down
Loading