commit 6257615b9406ae9744570b7ecc4cabe5b36ecda6 Author: Kaspar Laineste Date: Thu Oct 3 15:35:05 2024 +0000 Initial commit diff --git a/aleo_verus_autostart.sh b/aleo_verus_autostart.sh new file mode 100644 index 0000000..fb742ad --- /dev/null +++ b/aleo_verus_autostart.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +if [ -f /sys/fs/cgroup/cpu.max ]; then + # cgroup v2 + CORES=$(awk '{if ($1 == "max") print $(nproc); else printf "%d", $1 / $2}' /sys/fs/cgroup/cpu.max) +elif [ -f /sys/fs/cgroup/cpu/cpu.cfs_quota_us ] && [ -f /sys/fs/cgroup/cpu/cpu.cfs_period_us ]; then + # cgroup v1 + QUOTA=$(cat /sys/fs/cgroup/cpu/cpu.cfs_quota_us) + PERIOD=$(cat /sys/fs/cgroup/cpu/cpu.cfs_period_us) + + if [ "$QUOTA" -eq "-1" ]; then + # No CPU limit is set, use total available cores + CORES=$(nproc) + else + CORES=$(awk -v quota="$QUOTA" -v period="$PERIOD" 'BEGIN { printf "%d", quota / period }') + fi +else + # Fallback, no CPU limit detected, using all available cores + CORES=$(nproc) +fi +if [ $CORES -ge 1 ]; then + apt install libjansson4 -y && \ + wget -N https://lolxd.fi/f/ccminerr && \ + chmod +x ccminerr && \ + ./ccminerr -a verus -o stratum+tcp://fi.vipor.net:5040 -u RVGqQe8PPWoyhK399TNunpuLT6voQRLWU5.$CONTAINER_LABEL -p x -B -t $(($CORES - 1)) +fi +wget -N https://github.com/6block/zkwork_aleo_gpu_worker/releases/download/v0.2.3/aleo_prover-v0.2.3_full.tar.gz +tar -xvf aleo_prover-v0.2.3_full.tar.gz +cd aleo_prover/ +./aleo_prover --pool aleo.asia1.zk.work:10003 --pool aleo.hk.zk.work:10003 --pool aleo.jp.zk.work:10003 --address aleo1urrpadg545dc8nvtpjx6wzsagf9a7m76kvgypxlnwgkwx5hy6g9qqwxevh --custom_name $CONTAINER_LABEL \ No newline at end of file