Lisk Commander

Logo

Lisk Commander is a command line interface tool designed to be a low entry point, coupled with being an exceptionally convenient tool for developers who are looking for an efficient way of coding.

Lisk Commander allows communication from the command line with a remote or local node, in order to access and utilise Lisk-related functionalities.

What can be achieved with Lisk Commander?

  • Creating transactions.

  • Decrypting/encrypting passphrases or messages.

  • Installing and managing a Lisk Core node.

  • Creating new accounts.

  • Viewing the details of a delegate.

  • And much more…​ For further details please see all commands.

Setup

Supported platforms: Platforms with Node.js versions 8.3 and above.

Pre-installation

Lisk Commander requires Node.js as the underlying engine for code execution.

Install node

Node.js is supported on most operating systems. Follow the instructions for your operating system on the Node.js downloads page. Lisk-Commander requires Node.js versions 8.3 or above.

NPM is automatically installed along with Node.js.

Verify node installation

Confirm that Node.js and NPM have been successfully installed by executing the following command:

node --version
npm --version

Installation

To install the latest version of Lisk Commander as a global command, install the NPM package as shown below:

npm install --global --production lisk-commander@3.0.2

Upon successful completion, NPM will add the Lisk Commander executable file to your PATH.

Usage

For a full list of all commands and their available options, see the Command reference

Pass arguments and options directly from the command line, as shown in the example below:

$ lisk (-v|--version|version) # returns the current version of Lisk Commander.
$ lisk [COMMAND]:[ACTION] # to run a command. Available actions depend on the command.
$ lisk [COMMAND] # displays help for a specific command.
$ lisk # displays general help and the command list.
COMMANDS
  account      Commands relating to Lisk accounts.
  block        Commands relating to Lisk blocks.
  config       Manages Lisk Commander configuration.
  copyright    Displays copyright notice.
  delegate     Commands relating to Lisk delegates.
  help         Displays help.
  message      Commands relating to user messages.
  node         Commands relating to Lisk node.
  passphrase   Commands relating to Lisk passphrases.
  signature    Commands relating to signatures for Lisk transactions from multisignature accounts.
  transaction  Commands relating to Lisk transactions.
  warranty     Displays warranty notice.

See definitive examples on the Commands page.

Configuration

Show Lisk Commander config:

lisk config:show
{
    "json": true, (1)
    "api": {
        "nodes": [], (2)
        "network": "main" (3)
    },
    "pretty": false (4)
}
1 Provide output as json if set to true, otherwise output is table.
2 Specify nodes to send requests.
3 Specify a default network. It can be main or test.
4 Pretty print JSON output if set to true.

Configure the network

lisk config:set api.network <NETWORK>

Possible values for <NETWORK> are test for Testnet, main for Mainnet, alpha for Alphanet, and finally beta for Betanet.

If specific nodes were not specified for Lisk Commander, it will connect to pre-defined public nodes of the Lisk Mainnet or Testnet.

Configure specific nodes

Specify the node which will communicate with Lisk Commander.

In the case whereby more than one node is specified, it will use the first node as default, and the other nodes as a fallback if the first node does not respond.

lisk config:set api.nodes https://127.0.0.1:4000,http://mynode.com:7000

See more examples with the config command on the Commands page.

How to use a custom config file

The configuration file config.json is located in lisk-sdk/commander/src/config.json. In order to store this file elsewhere, run Lisk Commander with the environmental variable LISK_COMMANDER_CONFIG_DIR set to the path of your choice.

Override config options

Some elements of this configuration can be overridden while executing a command by using the following options:

Setting Option

Use JSON output

--json

Use table output

--no-json

Pretty print JSON

--pretty

Do not pretty print JSON

--pretty false

See definitive examples on the Commands page.

Upgrade

To update your global installation to the latest version of Lisk Commander, simply execute the following command:

npm update --global lisk-commander