Skip to content

Commit

Permalink
chore: Add CLI description to docs (#239)
Browse files Browse the repository at this point in the history
Co-authored-by: MakMuftic <makmuftic@chainsafe.io>
  • Loading branch information
MakMuftic and MakMuftic authored Apr 4, 2024
1 parent 8d18d3c commit 9fb9d17
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
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
- **[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

0 comments on commit 9fb9d17

Please sign in to comment.