As mining is a task meant to run continuously it is recommended to run orax-cli mine
using a process manager/supervisor. We will see here how to use systemd for running your miner.
# Download the orax-cli binarywget -O orax-cli https://oraxpool.s3.ca-central-1.amazonaws.com/orax-cli/orax-cli-linux-amd64# Or the ARM version# wget -O orax-cli https://oraxpool.s3.ca-central-1.amazonaws.com/orax-cli/orax-cli-linux-arm64chmod +x orax-clisudo mv orax-cli /usr/local/bin/orax-cli# Register your minerorax-cli register
Create a systemd unit file sudo nano /lib/systemd/system/orax.service
with the following content while replacing the root user with your current user at the line User=root
.
/lib/systemd/system/orax.service[Unit]Description=Orax miner[Service]Type=simpleUser=rootExecStart=/usr/local/bin/orax-cli mineRestart=on-failureRestartSec=5s[Install]WantedBy=multi-user.target
Now load, enable and start Orax miner unit:
sudo systemctl daemon-reloadsudo systemctl enable oraxsudo systemctl start oraxsudo systemctl status orax
To read the logs, use journalctl
:
journalctl -u orax.service --output cat# To follow the logs:journalctl -u orax.service --output cat -n 80 -f