#!/usr/bin/env bash
# SKN CRB Direct Miner v1.0.0 (connects straight to the pool - no proxy needed) - Linux
#
# Edit the settings below before running. This PC needs real internet access
# (it talks to cereblix.sinarlink.com directly) - there is NO gateway/proxy
# PC involved, unlike CRB Lab Miner.

CRB_ADDRESS=crb1YOUR_ADDRESS_HERE
WORKER=my-pc
THREADS=4
MODE=pplns   # pplns or solo

NODE_URL=https://cereblix.sinarlink.com/api
if [ "$MODE" = "solo" ]; then
  NODE_URL=https://cereblix.sinarlink.com/api/solo
fi

cd "$(dirname "$0")"
chmod +x ./skn-crb-engine-linux-amd64
echo "SKN CRB Direct Miner v1.0.0"
while true; do
  ./skn-crb-engine-linux-amd64 -node "$NODE_URL" -addr "$CRB_ADDRESS" -worker "$WORKER" -threads "$THREADS" -mode "$MODE"
  echo "Miner exited, restarting in 5 seconds..."
  sleep 5
done
