turboflakes / crunch

Crunch is a command-line interface (CLI) and Matrix Bot to claim staking rewards every Era for Substrate-based chains
https://turboflakes.io
Apache License 2.0
63 stars 22 forks source link

Run the tool as systemd service #1

Closed TomaszWaszczyk closed 2 years ago

TomaszWaszczyk commented 2 years ago

I try to run the tool as a systemd service, here is my try:

[Unit]
Description=Kusama Autopayout

[Service]
ExecStart=/home/tw/crunch-bot/crunch rewards --seed-path '/home/tw/crunch-bot/.private.seed' --disable-matrix
Restart=always
RestartSec=15

[Install]
WantedBy=multi-user.target

What I do wrong? How to pass also config file? Where I do mistake?

paulormart commented 2 years ago

Hi @TomaszWaszczyk

For example, create your config file here:

touch /home/tw/crunch-bot/.env

and than in the service file add it with the flag --config-path straight after the crunch command:

Unit]
Description=Kusama Autopayout

[Service]
ExecStart=/home/tw/crunch-bot/crunch --config-path /home/tw/crunch-bot/.env rewards era --seed-path '/home/tw/crunch-bot/.private.seed' --disable-matrix
Restart=always
RestartSec=15

[Install]
WantedBy=multi-user.target

let me know if you have any issues.

TomaszWaszczyk commented 2 years ago

Thanks! Seems to work.