Run the Go Validator as a Linux Service
Set up the AutoBattle Go validator to run continuously as a systemd service — it will automatically start on boot, restart if it crashes, and run every 10 minutes to catch every validation window.
Create a home directory for the validator and download the pre-built amd64 binary.
mkdir -p ~/autobattle cd ~/autobattle curl -sL https://autobattle.online/shell/validate_linux_amd64 -o validate chmod +x validate
Verify it works before proceeding:
./validate --help
Save your key in a plain file so the service can read it without it appearing in process listings. Get your key from your profile page.
echo "YOUR_API_KEY" > ~/autobattle/api_key chmod 600 ~/autobattle/api_key
The service will call this script every 10 minutes. It reads the key file and runs the validator.
cat > ~/autobattle/run.sh <<'EOF' #!/usr/bin/env bash set -euo pipefail KEY=$(cat ~/autobattle/api_key) exec ~/autobattle/validate --key "$KEY" EOF chmod +x ~/autobattle/run.sh
Two unit files are needed: a service (what to run) and a timer (when to run it). Copy and paste both blocks below. Replace YOUR_USERNAME with your actual Linux username (whoami).
Service file — /etc/systemd/system/autobattle-validator.service
[Unit] Description=AutoBattle cohort validator After=network-online.target Wants=network-online.target [Service] Type=oneshot User=YOUR_USERNAME ExecStart=/home/YOUR_USERNAME/autobattle/run.sh StandardOutput=journal StandardError=journal [Install] WantedBy=multi-user.target
Timer file — /etc/systemd/system/autobattle-validator.timer
[Unit] Description=Run AutoBattle validator every 10 minutes Requires=autobattle-validator.service [Timer] OnBootSec=2min OnUnitActiveSec=10min AccuracySec=30s [Install] WantedBy=timers.target
Write the files (requires sudo):
sudo nano /etc/systemd/system/autobattle-validator.service sudo nano /etc/systemd/system/autobattle-validator.timer
sudo systemctl daemon-reload sudo systemctl enable --now autobattle-validator.timer
The validator will run once 2 minutes after boot, then every 10 minutes automatically.
Run it manually right now to verify:
sudo systemctl start autobattle-validator.service
View the output:
journalctl -u autobattle-validator.service -n 50 --no-pager
Check the timer schedule:
systemctl list-timers autobattle-validator.timer
The validator checks for a newer version on every run. If an update is available it downloads the new binary, replaces itself, and continues — no action needed on your part.
You can confirm the running version at any time:
~/autobattle/validate --version
Useful commands
sudo systemctl stop autobattle-validator.timer— pause the validator temporarilysudo systemctl disable autobattle-validator.timer— stop it running on bootjournalctl -u autobattle-validator.service -f— follow live outputjournalctl -u autobattle-validator.service --since today— today's log
chmod +x ~/autobattle/validate if the service fails to start.