How to Use Lisk Commander to Manage Lisk Core

This guide outlines the Lisk Commander 2.2.0 capabilities to install and manage Lisk Core instances.

Lisk Commander, our command-line interface (CLI) is an integral part of the Lisk SDK. We’re constantly adding new functionalities to help with anything from node management to voting for delegates. Today, we will show you how to use the new commands introduced in Lisk Commander 2.2.0 to install and manage multiple Lisk Core instances.

Note: Until now, installation and management of Lisk Core was done solely through "installLisk.sh" and "lisk.sh" scripts. Those scripts will be eventually removed and Lisk Commander will be responsible for both installation and management of Lisk Core. Installation made by Lisk Commander can’t be managed by Lisk Scripts and vice-versa.

By Manu Gowda

08 Aug 2019

Lisk Commander 2.2.0 Guide_Blog.png

Lisk Commander is available for Linux and macOS

First, you will need to download Lisk Commander. Lisk Commander requires a 64bit Linux (Ubuntu 16.04 LTS or 18.04 LTS) or macOS (High Sierra or Mojave) machine. Lisk Commander must be run as a non-privileged user. Here is an example of how you can install Lisk Commander on Linux and Mac:

Example of standalone Lisk Commander installation (Linux)

Example of standalone Lisk Commander installation (macOS)

Lisk Commander 2.2.0 introduces 8 commands to manage Lisk Core

With this release, we’ve added the following commands for a more convenient developer experience:

File name
1lisk core:restart _<instance>_
File name
1lisk core:start _<instance>_
File name
1lisk core:status _<instance>_
File name
1lisk core:stop _<instance>_
File name
1lisk core:uninstall _<instance>_
File name
1lisk core:upgrade _<instance>_

Lisk Commander Tutorial_0.gif

lisk core:install ""

Lisk Commander can install Lisk Core starting with version 2.0.0. This allows you to install Lisk Core, download the snapshot, insert the snapshot into the database and start the freshly installed node. By default, this will fetch the latest public release of Lisk Core and download the "mainnet" snapshot. Extra options are provided to install a custom build of Lisk Core or specify a different network like "testnet". It is also possible to install multiple versions or networks on the same machine with the

File name
1install
command. This command installs an instance of Lisk Core.

For example, the command "lisk core:install lisk-mainnet" installs the latest Lisk Core software for Mainnet by default. In order to install a different version for different Lisk Network, you need to specify the version and network option e.g. by typing in:

File name
1lisk core:install --network=testnet lisk-testnet

This installs the Lisk Core 2.0.0-rc.0 for Testnet.

How to run Lisk Core and sync blockchain from scratch

To run Lisk Core without using the snapshot you can use the option

File name
1--no-snapshot
. This will make the node synchronize with the network from scratch. However, if you want to use custom snapshot — you can specify
File name
1--snapshot-url
parameter.

How to run Lisk Core using custom URL for binary

For the binary release, you need to make sure the .tar file has the proper format: "2.0.0-Linux-x8664.tar.gz". You also need to have the checksum for the TAR file with the format "2.0.0-Linux-x86_64.tar.gz.SHA256" for the Commander to check the integrity of the binary. You can refer to our binary release for the file naming convention. Once your custom Lisk Core binary is ready, you can upload it to _Amazon S3, Digital Ocean spaces or any other file server and use the custom URL with "--release-url" parameter.

lisk core:logs

Monitoring the logs of a node is an important feature that needs to be part of the command set. This command streams logs of a Lisk Core instance. For checking logs of a particular Lisk Core instance, specify the instance name (the same you used during the installation), for example:

File name
1lisk core:logs lisk-mainnet

lisk core:restart

The restart command stops and starts the Lisk Core, cache and database processes. Use it by typing in for example:

File name
1lisk core:restart lisk-mainnet

lisk core:start

Running

File name
1lisk core:install
will also start the application by default. However, it is possible to explicitly start and stop the application. This command starts the Lisk Core, cache, and the database process of an instance. Use it by typing in:

File name
1lisk core:start lisk-mainnet

lisk core:stop

This stops Lisk Core, cache, and database process of an instance after you type in:

File name
1lisk core:stop lisk-mainnet

lisk core:status

Use this command to find out the status of all Lisk Core instances. If you want to know the status of a specific instance, add its name after the command, for example:

File name
1lisk core:status lisk-mainnet

lisk core:uninstall

Uninstall command stops the running Lisk Core, cache and database processes. It also unregisters from the PM2 process manager and removes the data from the backup directory. You can use it by typing in:

File name
1lisk core:uninstall lisk-mainnet

How to manage custom config per instance using Lisk Commander

Sometimes you will need to manually edit the configuration files of a Lisk Core instance, for example in order to enable forging, change log level or any other config parameter. For this purpose, run "lisk core:status lisk-mainnet" command, which displays the "installationPath" of the instance. The config specific to the instance (in this example: "lisk-mainnet") will be present in the root of the "installationPath". After adjusting the config to your needs you can just run lisk core:restart lisk-mainnet to apply the changes.

We hope you will like our new version of Lisk Commander, if you have any feedback or feature request — join us on Discord or open an issue on the lisk-sdk GitHub repository.