Process management with pm2

It is recommended to set up additional process management with the new Lisk Core CLI. Any process management tool can be used to manage the Lisk Core node. We recommend using PM2 to manage the instance.

Setup

Install pm2 globally:

npm i -g pm2

PM2 config

Create a pm2 config, for example as shown below:

pm2.conf.json
{
  "name": "lisk-core",
  "script": "lisk-core start",
  "env": {
    "LISK_NETWORK": "testnet",
    "LISK_CONFIG_FILE": "custom-config.json"
  },
  "exec_interpreter": "node@12.22.7"
}
All available options for scripts and env can be found in lisk-core start --help.

Starting Lisk Core with PM2

Now start the node using the config:

pm2 start pm2.conf.json

Saving the app list to be restored at reboot

Once you have started Lisk Core, save the app list so it will respawn after reboot:

pm2 save

For more information, please refer to https://pm2.keymetrics.io/docs/usage/pm2-doc-single-page/