Mainsail API - CLI Commands

Mainsail-API comes packaged with a robust command line interface (CLI) which is an essential tool that enables any node operator to update, manage, or monitor their node installation without the need for external programs.

View the installed version of Mainsail API and a list of available CLI commands by typing the following in your terminal:

mainsail-api

Deploy

Before you can start using the api process, you need to deploy the configuration. You can deploy the configuration with the following command:

mainsail-api config:publish --reset

Api

This series will describe the api process commands. The 'api' process will run Mainsail API node a single process. You can start the api process with the following command:

mainsail-api api:start
  • Run mainsail-api api:status to ensure that the core to check the status of your process.

You can view your api process logs with the following command:

mainsail-api api:log
  • Check the logs to ensure that the process has started correctly

You can restart your api process with the following command:

mainsail-api api:restart
  • Check your api logs to ensure that the process has restarted successfully

You can stop your api process with the following command.

mainsail-api api:stop

You can run the api process in foreground with the following command:

mainsail-api api:run
  • Exit the process and ensure that it has stopped from running with mainsail-api api:stop

You can set environment variables, like DB credentials with the following command:

mainsail-api env:set --key=MAINSAIL_DB_USERNAME --value="DB_USER"
mainsail-api env:set --key=MAINSAIL_DB_PASSWORD --value="DB_PASSWORD"
mainsail-api env:set --key=MAINSAIL_DB_DATABASE --value="DB_NAME"