skalenetwork / node-cli

A command line tool to setup, register and maintain your SKALE node. Written in Python.
https://skale.network
GNU Affero General Public License v3.0
20 stars 7 forks source link
skale-network

Node CLI

Build and publish Test Discord

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

Table of Contents

  1. Installation
  2. CLI usage
    2.1 Top level commands
    2.2 Node
    2.3 Wallet
    2.4 sChains
    2.5 Health
    2.6 SSL
    2.7 Logs
    2.8 Resources allocation
    2.9 Validate
  3. Sync CLI usage
    3.1 Top level commands
    3.2 Sync node commands
  4. Exit codes
  5. Development

Installation

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

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"

For Sync node version:

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`-sync >  /usr/local/bin/skale"
chmod +x /usr/local/bin/skale
skale --help

CLI usage

Top level commands

Info

Print build info

skale info

Version

Print version number

skale version

Options:

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

:warning: Please avoid re-initialization: First run skale node info to confirm current state of intialization.

skale node init [ENV_FILE]

Arguments:

You should specify the following environment variables:

Optional variables:

Node initialization from backup

Restore SKALE node on another machine

skale node restore [BACKUP_PATH] [ENV_FILE]

Arguments:

Node backup

Generate backup file to restore SKALE node on another machine

skale node backup [BACKUP_FOLDER_PATH] [ENV_FILE]

Arguments:

Node Registration

skale node register

Required arguments:

Optional arguments:

Node update

Update SKALE node on current machine

skale node update [ENV_FILEPATH]

Options:

Arguments:

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:

Node turn-on

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

skale node turn-on [ENV_FILEPATH]

Options:

Arguments:

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:

Switch off maintenance mode

skale node maintenance-off

Domain name

Set SKALE node domain name

skale node set-domain

Options:

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

Wallet setting

Set local wallet for the SKALE node

skale wallet set --private-key $ETH_PRIVATE_KEY

Send ETH tokens

Send ETH tokens from SKALE node wallet to specific address

skale wallet send [ADDRESS] [AMOUNT]

Arguments:

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:

SKALE Chain repair

Turn on repair mode for SKALE Chain

skale schains repair SCHAIN_NAME

Health commands

Prefix: skale health

SKALE containers

List all SKALE containers running on the connected node

skale health containers

Options:

sChains healthchecks

Show health check results for all SKALE Chains on the node

skale health schains

Options:

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

Admin API URL: [GET] /api/ssl/status

Upload certificates

Upload new SSL certificates

skale ssl upload
Options

Admin API URL: [GET] /api/ssl/upload

Check ssl certificate

Check ssl certificate be connecting to healthcheck ssl server

skale ssl check
Options

Logs commands

Prefix: skale logs

CLI Logs

Fetch node CLI logs:

skale logs cli

Options:

Dump Logs

Dump all logs from the connected node:

skale logs dump [PATH]

Optional arguments:

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_FILE]

Arguments:

Options:

Validate commands

Prefix: skale validate

Validate abi

Check whether ABI files contain valid JSON data

skale validate abi

Options:

Sync CLI usage

Top level commands sync

Info

Print build info

skale info

Version

Print version number

skale version

Options:

Sync node commands

Prefix: skale sync-node

Sync node initialization

Initialize full sync SKALE node on current machine

skale sync-node init [ENV_FILE]

Arguments:

You should specify the following environment variables:

Options:

Sync node update

Update full sync SKALE node on current machine

skale sync-node update [ENV_FILEPATH]

Options:

Arguments:

NOTE: You can just update a file with environment variables used during skale sync-node init.

Exit codes

Exit codes conventions for SKALE CLI tools

* - validator-cli only
** - node-cli only

Development

Setup repo

Install development dependencies

pip install -e .[dev]
Add flake8 git hook

In file .git/hooks/pre-commit add:

#!/bin/sh
flake8 .

Debugging

Run commands in dev mode:

ENV=dev python main.py YOUR_COMMAND

Setting up Travis

Required environment variables:

Contributing

If you have any questions please ask our development community on Discord.

Discord

License

License

Copyright (C) 2018-present SKALE Labs