Mainsail Core - CLI Commands
Mainsail 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 Core and a list of available CLI commands by typing the following in your terminal:
mainsail
Deploy
Before you can start using the core process, you need to deploy the configuration.
For Local Devnet use:
mainsail config:publish --network=devnet --reset
For Public Testnet use:
SNAP=$(curl -s -L -H "Accept: application/vnd.github+json" "https://api.github.com/repos/ArkEcosystem/mainsail-network-config/contents/testnet/mainsail/" | grep compressed | grep download_url | awk '{ print $2 }' | tr -d ",")
mainsail config:publish:custom --app=https://raw.githubusercontent.com/ArkEcosystem/mainsail-network-config/main/testnet/mainsail/app.json --crypto=https://raw.githubusercontent.com/ArkEcosystem/mainsail-network-config/main/testnet/mainsail/crypto.json --peers=https://raw.githubusercontent.com/ArkEcosystem/mainsail-network-config/main/testnet/mainsail/peers.json --snapshot=${SNAP} --reset
Configure validator
You can set your node as a validator with the following command. This command will ask you for a validator mnemonic and will enable forging on your node. Validator should be registered on the network using the validator registration transaction, before you can start forging. Use the same mnemonic you used to register your validator's BLS12-381 public key.
mainsail config:forger:bip39
Core
This series will describe the core process commands. The 'core' process will run Mainsail node a single process. You can start the core process with the following command:
mainsail core:start
- Run
mainsail core:statusto ensure that the core to check the status of your process.
You can view your core process logs with the following command:
mainsail core:log
- Check the logs to ensure that the process has started correctly
If your core process isn't running, then an error should be displayed. You
can check the status of your core process with mainsail core:status
You can restart your core process with the following command:
mainsail core:restart
- Check your
corelogs to ensure that the process has restarted successfully
You can stop your core process with the following command.
mainsail core:stop
You can run the core process in foreground with the following command
mainsail core:run
- Exit the process and ensure that it has stopped from running with
mainsail core:stop
You can set environment variables, like DB credentials with the following command:
mainsail env:set --key=MAINSAIL_DB_USERNAME --value="DB_USER"
mainsail env:set --key=MAINSAIL_DB_PASSWORD --value="DB_PASSWORD"
mainsail env:set --key=MAINSAIL_DB_DATABASE --value="DB_NAME"
mainsail env:set --key=MAINSAIL_API_SYNC_ENABLED --value=true