From 7aee4d9cf5bc021b13007438784942ab8d611f7c Mon Sep 17 00:00:00 2001 From: MakMuftic Date: Wed, 29 Nov 2023 11:32:11 +0100 Subject: [PATCH] add CLI description to docs --- docs/general/Arhitecture.md | 1 + docs/general/CLI.md | 67 +++++++++++++++++++++++++++++++++++++ docs/general/Topology.md | 1 + 3 files changed, 69 insertions(+) create mode 100644 docs/general/CLI.md diff --git a/docs/general/Arhitecture.md b/docs/general/Arhitecture.md index 2054ec7e..ef5a10cb 100644 --- a/docs/general/Arhitecture.md +++ b/docs/general/Arhitecture.md @@ -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 diff --git a/docs/general/CLI.md b/docs/general/CLI.md new file mode 100644 index 00000000..bafeea3f --- /dev/null +++ b/docs/general/CLI.md @@ -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. diff --git a/docs/general/Topology.md b/docs/general/Topology.md index 829a717d..bdd1a41c 100644 --- a/docs/general/Topology.md +++ b/docs/general/Topology.md @@ -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)