Configuration with PM2

Table of Contents

Custom configuration

Lisk Service offers a set of Default Configurations, which can be customized as per the requirement. To create a custom configuration, it is recommended to copy the default configuration file and use the copy of the said file for customization.

Working directory: ./lisk-service/
cp ecosystem.config.js ecosystem.custom.config.js

Now it is possible to open the new file ecosystem.custom.config.js and adjust it as desired.

Lisk Service can be configured in various ways by setting environment variables.

All available configuration options are described in the Configuration reference.

Once customized, you can start Lisk Service with the custom ecosystem file by executing the following command:

Working directory: ./lisk-service/
pm2 start ecosystem.custom.config.js

Finally, if you want to use yarn start and yarn stop to start and stop Lisk Service with the custom configuration, don’t forget to update the scripts in package.json:

Working directory: ./lisk-service/
{
  //[...]
  "scripts": {
    "start": "pm2 start ecosystem.custom.config.js",
    "stop": "pm2 delete ecosystem.custom.config.js",
  //[...]
  }
}

Additional commands for managing Lisk Service with PM2 are described on the PM2 commands page.