From 67ebd38de47b7001cabab5b7951373a79adadb5d Mon Sep 17 00:00:00 2001 From: mistakia <1823355+mistakia@users.noreply.github.com> Date: Mon, 17 Jun 2024 21:43:55 -0400 Subject: [PATCH] docs: added `docs/cli.md` doc --- docs/cli.md | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 docs/cli.md diff --git a/docs/cli.md b/docs/cli.md new file mode 100644 index 00000000..dc114b4c --- /dev/null +++ b/docs/cli.md @@ -0,0 +1,75 @@ +--- +title: Nano.Community CLI +description: Documentation for the Nano.Community CLI +tags: nano, xno, cli, nano-community, alias, representative, metadata, signing key +--- + +# Nano.Community CLI + +## Installation + +### Setting Environment Variables + +The best way to pass the private key to the CLI is to set the `NC_CLI_NANO_PRIVATE_KEY` environment variable. + +**Linux/Mac:** + +```bash +export NC_CLI_NANO_PRIVATE_KEY='your_private_key_here' +``` + +**Windows:** + +```cmd +set NC_CLI_NANO_PRIVATE_KEY=your_private_key_here +``` + +## Usage + +### Setting up a signing key (optional) + +The purpose of a signing key is to sign messages to manage metadata related to a nano account/representative or block while minimizing the exposure of the account private key. This is optional but recommended. + +```bash +nano-cli add-signing-key +``` + +This will generate a new signing key and output the public and private keys in the console. Take care to securely store the private key. + +This new signing key can now be used in place of your account key. Make sure to replace the `NC_CLI_NANO_PRIVATE_KEY` environment variable with the newly generated private key of the signing key. + +#### Revoking a signing key + +To revoke a signing key, use the `revoke-signing-key` command. The signing key can be revoked by either the signing key or the account key. + +```bash +nano-cli revoke-signing-key +``` + +### Updating Nano Representative Metadata + +To update the metadata for a Nano representative use the `update-rep-meta` command. + +1. Run the command: + ```bash + nano-cli update-rep-meta + ``` +2. You will be prompted to enter various metadata fields such as alias, description, donation address, etc. Fill these out as required. +3. Review the entered data when prompted, and confirm to proceed. +4. The CLI will sign and send the metadata update to the nano.community API, confirming the request in the console output. + +### Updating Nano Account Metadata + +You can set a public alias for a nano account using the `update-account-meta` command. + +```bash +nano-cli update-account-meta +``` + +### Updating Nano Block Metadata + +You can set a public message for a nano block using the `update-block-meta` command. + +```bash +nano-cli update-block-meta +```