Node CLI

SKALE Node CLI, part of the SKALE suite of validator tools, is the command line to setup, register and maintain your SKALE node.

Installation

Prerequisites

Ensure that the following package is installed: docker, docker-compose (1.27.4+)

Download the executable

VERSION_NUM={put the version number here} && sudo -E bash -c "curl -L https://github.com/skalenetwork/node-cli/releases/download/$VERSION_NUM/skale-$VERSION_NUM-`uname -s`-`uname -m` >  /usr/local/bin/skale"

Apply executable permissions to the downloaded binary:

chmod +x /usr/local/bin/skale

Test the installation

skale --help

CLI usage

Top level commands

Info

Print build info

skale info

Version

Print version number

skale version

Options:

  • --short - prints version only, without additional text.

Node commands

Prefix: skale node

Node information

Get base info about SKALE node

skale node info

Options:

-f/--format json/text - optional

Node initialization

Initialize a SKALE node on current machine

Please avoid re-initialization: First run skale node info to confirm current state of initialization.
skale node init [ENV_FILEPATH]

Arguments:

  • ENV_FILEPATH - path to .env file (required parameters are listed in the skale init command)

You should specify the following environment variables:

  • SGX_SERVER_URL - SGX server URL

  • DISK_MOUNTPOINT - disk mount point for storing sChains data

  • DOCKER_LVMPY_STREAM - stream of docker-lvmpy to use

  • CONTAINER_CONFIGS_STREAM - stream of skale-node to use

  • ENDPOINT - RPC endpoint of the node in the network where SKALE Manager is deployed

  • IMA_ENDPOINT - same as ENDPOINT

  • MANAGER_CONTRACTS_ABI_URL - URL to SKALE Manager contracts ABI and addresses

  • IMA_CONTRACTS_ABI_URL - URL to IMA contracts ABI and addresses

  • FILEBEAT_URL - URL to the Filebeat log server (provided by SKALE Core team)

Optional variables:

  • TG_API_KEY - Telegram API key

  • TG_CHAT_ID - Telegram chat ID

  • MONITORING_CONTAINERS - will enable monitoring containers (cadvisor, node-exporter)

Node initialization from backup

Restore SKALE node on another machine

skale node restore [BACKUP_PATH] [ENV_FILEPATH]

Arguments:

  • BACKUP_PATH - path to the archive with backup data generated by skale node backup command

  • ENV_FILEPATH - path to .env file (required parameters are listed in the skale init command)

Node backup

Generate backup file to restore SKALE node on another machine

skale node backup [BACKUP_FOLDER_PATH]

Arguments:

  • BACKUP_FOLDER_PATH - path to the folder where the backup tarball will be saved

Node signature

Generate node signature that is used to link node to a specific validator

skale node signature [VALIDATOR_ID]

Arguments:

  • VALIDATOR_ID - id of the validator

Node Registration

skale node register

Required arguments:

  • --ip - public IP for RPC connections and consensus

  • --domain/-d - SKALE node domain name

  • --name - SKALE node name

Optional arguments:

  • --port - public port - beginning of the port range for node SKALE Chains (default: 10000)

Node update

Update SKALE node on current machine

skale node update [ENV_FILEPATH]

Options:

  • --yes - remove without additional confirmation

Arguments:

  • ENV_FILEPATH - path to env file where parameters are defined

You can also specify a file with environment variables which will update parameters in env file used during skale node init.

Node turn-off

Turn-off SKALE node on current machine and optionally set it to the maintenance mode

skale node turn-off

Options:

  • --maintenance-on - set SKALE node into maintenance mode before turning off

  • --yes - remove without additional confirmation

Node turn-on

Turn on SKALE node on current machine and optionally disable maintenance mode

skale node turn-on [ENV_FILEPATH]

Options:

  • --maintenance-off - turn off maintenance mode after turning on the node

  • --yes - remove without additional confirmation

Arguments:

  • ENV_FILEPATH - path to env file where parameters are defined

You can also specify a file with environment variables which will update parameters in env file used during skale node init.

Node maintenance

Set SKALE node into maintenance mode

skale node maintenance-on

Options:

  • --yes - set without additional confirmation

Switch off maintenance mode

skale node maintenance-off

Domain name

Set SKALE node domain name

skale node set-domain

Options:

  • --domain/-d - SKALE node domain name

  • --yes - set without additional confirmation

Wallet commands

Prefix: skale wallet

Commands related to Ethereum wallet associated with SKALE node

Wallet information

skale wallet info

Options:

-f/--format json/text - optional

Send ETH tokens

Send ETH tokens from SKALE node wallet to specific address

skale wallet send [ADDRESS] [AMOUNT]

Arguments:

  • ADDRESS - Ethereum receiver address

  • AMOUNT - Amount of ETH tokens to send

Optional arguments:

--yes - Send without additional confirmation

sChain commands

Prefix: skale schains

SKALE Chain list

List of SKALE Chains served by connected node

skale schains ls

SKALE Chain configuration

skale schains config SCHAIN_NAME

SKALE Chain DKG status

List DKG status for each SKALE Chain on the node

skale schains dkg

SKALE Chain info

Show information about SKALE Chain on node

skale schains info SCHAIN_NAME

Options:

  • --json - Show info in JSON format

SKALE Chain repair

Turn on repair mode for SKALE Chain

skale schains repair SCHAIN_NAME

Options:

  • --yes - run repair without additional confirmation

Health commands

Prefix: skale health

SKALE containers

List all SKALE containers running on the connected node

skale health containers

Options:

  • -a/--all - list all containers (by default - only running)

sChains healthchecks

Show health check results for all SKALE Chains on the node

skale health schains

Options:

  • --json - Show data in JSON format

SGX

Status of the SGX server. Returns the SGX server URL and connection status.

$ skale health sgx

SGX server status:
┌────────────────┬────────────────────────────┐
│ SGX server URL │ https://0.0.0.0:1026/      │
├────────────────┼────────────────────────────┤
│ Status         │ CONNECTED                  │
└────────────────┴────────────────────────────┘

SSL commands

Prefix: skale ssl

SSL Status

Status of the SSL certificates on the node

skale ssl status

Upload certificates

Upload new SSL certificates

skale ssl upload
Options
  • -c/--cert-path - Path to the certificate file

  • -k/--key-path - Path to the key file

  • -f/--force - Overwrite existing certificates

Logs commands

Prefix: skale logs

CLI Logs

Fetch node CLI logs:

skale logs cli

Options:

  • --debug - show debug logs; more detailed output

Dump Logs

Dump all logs from the connected node:

skale logs dump [PATH]

Optional arguments:

  • --container, -c - Dump logs only from specified container

Resources allocation commands

Prefix: skale resources-allocation

Show allocation file

Show resources allocation file:

skale resources-allocation show

Generate/update

Generate/update allocation file:

skale resources-allocation generate [ENV_FILEPATH]

Arguments:

  • ENV_FILEPATH - path to .env file (required parameters are listed in the skale init command)

Options:

  • --yes - generate without additional confirmation

  • -f/--force - rewrite allocation file if it exists

Validate commands

Prefix: skale validate

Validate abi

Check whether ABI files contain valid JSON data

skale validate abi

Options:

  • --json - show validation result in json format

Exit codes

Exit codes conventions for SKALE CLI tools

  • 0 - Everything is OK

  • 1 - General error exit code

  • 3 - Bad API response

  • 4 - Script execution error

  • 7 - Bad user error

  • 8 - Node state error