Lisk Commander

Logo

Lisk Commander is a command line interface tool designed to be a low entry point, and also the most 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 utilize 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.js

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.js installation

How to confirm that Node.js and NPM have been successfully installed:

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@4.0.0

Upon successful completion, NPM will add the Lisk Commander executable 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.
  network-identifier    Commands relating to the network identifier.
  node                  Commands relating to Lisk node.
  passphrase            Commands relating to Lisk passphrases.
  transaction           Commands relating to Lisk transactions.
  warranty              Displays warranty notice.

See actual examples on the Commands page.

Configuration

How to show the Lisk Commander config:

lisk config:show
{
    "json": true, (1)
    "api": {
        "nodes": [], (2)
        "network": "main" (3)
    },
    "pretty": true (4)
}
1 Provides 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, and 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 the default, and the remaining 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 actual examples on the Commands page.

Upgrade

How to update your global installation to the latest version of Lisk Commander:

npm update --global lisk-commander