1.0.4 • Published 9 months ago

klayr-reg v1.0.4

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
9 months ago

Klayr-REG CLI

Klayr-REG is a command-line tool designed to make sidechain registration on Klayr fun again!

Features

  • Load configuration from command-line options, config file, or environment variables.
  • Prompt the user for missing options interactively.
  • Optionally authorize chain-connector plugin (CC).
  • Verbose mode for detailed logs.

Prerequisites

Ensure that you have the following installed:

  • Node.js (>= 14.x)
  • NPM (Node Package Manager)

Usage

Use Klayr-REG easily using npx:

npx klayr-reg [options]

Example:

npx klayr-reg --prompt-path --authorize-cc

Install Globally

To install Klayr-REG globally, execute following command:

npm install -g klayr-reg

Once installed globally, you can use the klayr-reg command without npx.

Options

Below is a list of all available options and their corresponding environment variables:

OptionDescriptionEnvironment Variable
-v, --verboseVerbose mode for more detailed logsKLAYR_REG_VERBOSE
-c, --config <path>Config file pathKLAYR_REG_CONFIG
--side-name <name>Sidechain name for registrationKLAYR_REG_SIDECHAIN_NAME
--keys <path>Path to sidechain validators keysKLAYR_REG_SIDECHAIN_KEYS
--main-ipc <path>Mainchain IPC pathKLAYR_REG_MAINCHAIN_IPC
--main-ws <url>Mainchain WebSocket URLKLAYR_REG_MAINCHAIN_WS
--side-ipc <path>Sidechain IPC pathKLAYR_REG_SIDECHAIN_IPC
--side-ws <url>Sidechain WebSocket URLKLAYR_REG_SIDECHAIN_WS
--authorize-ccAuthorize chain-connector pluginKLAYR_REG_AUTHORIZE_CC
--cc-pass <password>CC password for both mainchain and sidechainKLAYR_REG_CC_PASSWORD
--main-cc-pass <password>CC password for mainchainKLAYR_REG_MAINCHAIN_CC_PASSWORD
--side-cc-pass <password>CC password for sidechainKLAYR_REG_SIDECHAIN_CC_PASSWORD
--relayer-phrase <phrase>Relayer phrase for both chainsKLAYR_REG_RELAYER_PHRASE
--main-relayer-phrase <phrase>Relayer phrase for mainchainKLAYR_REG_MAINCHAIN_RELAYER_PHRASE
--side-relayer-phrase <phrase>Relayer phrase for sidechainKLAYR_REG_SIDECHAIN_RELAYER_PHRASE
--prompt-pathPrompt to set phrase pathKLAYR_REG_PROMPT_PATH
--phrase-path <path>Phrase path for both chainsKLAYR_REG_PHRASE_PATH
--main-phrase-path <path>Phrase path for mainchainKLAYR_REG_MAINCHAIN_PHRASE_PATH
--side-phrase-path <path>Phrase path for sidechainKLAYR_REG_SIDECHAIN_PHRASE_PATH
--register-mainchain-fee <fee>Custom registerMainchain transaction feeKLAYR_REG_REGISTER_MAINCHAIN_FEE
--register-sidechain-fee <fee>Custom registerSidechain transaction feeKLAYR_REG_REGISTER_SIDECHAIN_FEE

Configuration with .env

You can also use a .env file to store the options. For example:

KLAYR_REG_SIDECHAIN_NAME=mySidechain
KLAYR_REG_MAINCHAIN_IPC=/path/to/mainchain/folder
KLAYR_REG_SIDECHAIN_IPC=/path/to/sidechain/folder
KLAYR_REG_SIDECHAIN_KEYS=/path/to/validators_keys.json
KLAYR_REG_AUTHORIZE_CC=true
KLAYR_REG_CC_PASSWORD=myCCPassword

Interactive Mode

If any of the required options are missing, the CLI will prompt you for input interactively. For example, if no sidechain name is provided, it will ask for one.

Verbose Mode

For more detailed logs, use the --verbose flag:

npx klayr-reg --verbose

Build From Source

To build Klayr-REG CLI from source, clone the repository, install dependencies, and install globally:

git clone https://github.com/swaptoshi/klayr-reg
cd klayr-reg
npm install
npm install -g .

Once installed globally, you can use the klayr-reg command.

License

This project is licensed under the Apache 2.0 License.

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago