This commit is contained in:
Dobromir Popov
2025-09-07 15:03:47 +03:00
parent 00cda24e71
commit 2d2653551b
132 changed files with 34281 additions and 5 deletions

View File

@@ -0,0 +1,45 @@
#!/bin/sh
#
# Install the core CUDA_VER toolkit for Ubuntu 16.04.
# Requires the CUDA_VER environment variable to be set to the required version.
#
# Since this script updates environment variables, to execute correctly you must
# 'source' this script, rather than executing it in a sub-process.
#
# Taken from https://github.com/tmcdonell/travis-scripts.
set -e
CUDA_VER=9.2.148-1
if [ "$1" != "" ]; then
CUDA_VER=$1
fi
if [ "$CUDA_VER" = "8" ]; then
CUDA_VER=8.0.61-1
CUDA_PACKAGE=cuda-core
elif [ "$CUDA_VER" = "9" ]; then
CUDA_VER=9.2.148-1
elif [ "$CUDA_VER" = "9.1" ]; then
CUDA_VER=9.1.85-1
elif [ "$CUDA_VER" = "9.2" ]; then
CUDA_VER=9.2.148-1
elif [ "$CUDA_VER" = "10" ]; then
CUDA_VER=10.0.130-1
fi
if [ -z $CUDA_PACKAGE ]; then
CUDA_PACKAGE=cuda-nvcc
fi
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_${CUDA_VER}_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1604_${CUDA_VER}_amd64.deb
sudo apt-get update -qq
CUDA_APT=$(echo $CUDA_VER | sed 's/\.[0-9]\+\-[0-9]\+$//;s/\./-/')
sudo apt-get install -qy $CUDA_PACKAGE-$CUDA_APT cuda-cudart-dev-$CUDA_APT cuda-nvrtc-dev-$CUDA_APT
sudo apt-get clean
CUDA_APT=$(echo $CUDA_APT | sed 's/-/./')
CUDA_HOME=/usr/local/cuda-$CUDA_APT
PATH=${CUDA_HOME}/bin:${PATH}
export CUDA_HOME
export PATH

View File

@@ -0,0 +1,56 @@
#!/usr/bin/env sh
# This script downloads the CMake binary and installs it in $PREFIX directory
# (the cmake executable will be in $PREFIX/bin). By default $PREFIX is
# ~/.local but can we changes with --prefix <PREFIX> argument.
# This is mostly suitable for CIs, not end users.
set -e
VERSION=3.8.1
if [ "$1" = "--prefix" ]; then
PREFIX="$2"
else
PREFIX=~/.local
fi
OS=$(uname -s)
case $OS in
Linux) SHA256=10ca0e25b7159a03da0c1ec627e686562dc2a40aad5985fd2088eb684b08e491;;
Darwin) SHA256=cf8cf16eb1281127006507e69bbcfabec2ccbbc3dfb95888c39d578d037569f1;;
esac
BIN=$PREFIX/bin
if test -f $BIN/cmake && ($BIN/cmake --version | grep -q "$VERSION"); then
echo "CMake $VERSION already installed in $BIN"
else
FILE=cmake-$VERSION-$OS-x86_64.tar.gz
VERSION_SERIES=$(echo $VERSION | awk '{ string=substr($0, 1, 3); print string; }')
URL=https://cmake.org/files/v$VERSION_SERIES/$FILE
ERROR=0
TMPFILE=$(mktemp --tmpdir cmake-$VERSION-$OS-x86_64.XXXXXXXX.tar.gz)
echo "Downloading CMake ($URL)..."
curl -s "$URL" > "$TMPFILE"
if type -p sha256sum > /dev/null; then
SHASUM_TOOL="sha256sum"
else
SHASUM_TOOL="shasum -a256"
fi
SHASUM=$($SHASUM_TOOL "$TMPFILE")
if ! (echo "$SHASUM" | grep -q "$SHA256"); then
echo "Checksum mismatch!"
echo "Actual: $SHASUM"
echo "Expected: $SHA256"
exit 1
fi
mkdir -p "$PREFIX"
echo "Unpacking CMake to $PREFIX..."
tar xzf "$TMPFILE" -C "$PREFIX" --strip 1
rm $TMPFILE
fi

209
zano/scripts/testpools.bash Normal file
View File

@@ -0,0 +1,209 @@
#!/usr/bin/env bash
## vim:set ft=bash ts=4 sw=4 et:
#
# Testscript to test progminer multiple pools/hosts/syntaxes
# Put this script in the bin directory of progminer and start running
#
# Run each host 30 times (having a sleep time of 5 sec) which
# means we run one host max 150sec and wait for one of the following
# statements in the output:
# * Accepted ==> Poolconnection works
# * Error ==> Poolconnection fails
# * Terminated ==> Poolconnection fails
# If we don't get any of them within the runtime connection is unconfirmed
# As Andrea Lanfranchi wrote a lot of the current startum protocol
# implementation and pool handling parts we can honor by using his
# donation wallet adresses
# export some vars as "./progminer" could be still a wrapper script
export ETH_WALLET="0x9E431042fAA3224837e9BEDEcc5F4858cf0390B9"
export WORKERNAME="pooltester"
export EMAIL="andrea.lanfranchi%40gmail.com"
export USERNAME="aminer"
export WORKERPWD="x"
export BTC_WALLET="3C4FURwL4oAaEUuCLYmNPUEKQSPR1FAJ3m"
POOLS=""
#2miners.com
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eth.2miners.com:2020"
#dwarfpool.org
POOLS="$POOLS stratum1+tcp://ETH_WALLET@eth-ar.dwarfpool.com:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum1+tcp://ETH_WALLET@eth-asia.dwarfpool.com:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum1+tcp://ETH_WALLET@eth-au.dwarfpool.com:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum1+tcp://ETH_WALLET@eth-br.dwarfpool.com:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum1+tcp://ETH_WALLET@eth-cn.dwarfpool.com:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum1+tcp://ETH_WALLET@eth-cn2.dwarfpool.com:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum1+tcp://ETH_WALLET@eth-eu.dwarfpool.com:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum1+tcp://ETH_WALLET@eth-hk.dwarfpool.com:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum1+tcp://ETH_WALLET@eth-sg.dwarfpool.com:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum1+tcp://ETH_WALLET@eth-ru.dwarfpool.com:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum1+tcp://ETH_WALLET@eth-ru2.dwarfpool.com:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum1+tcp://ETH_WALLET@eth-us.dwarfpool.com:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum1+tcp://ETH_WALLET@eth-us2.dwarfpool.com:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eth-ar.dwarfpool.com:8008"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eth-asia.dwarfpool.com:8008"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eth-au.dwarfpool.com:8008"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eth-br.dwarfpool.com:8008"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eth-cn.dwarfpool.com:8008"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eth-cn2.dwarfpool.com:8008"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eth-eu.dwarfpool.com:8008"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eth-hk.dwarfpool.com:8008"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eth-sg.dwarfpool.com:8008"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eth-ru.dwarfpool.com:8008"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eth-ru2.dwarfpool.com:8008"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eth-us.dwarfpool.com:8008"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eth-us2.dwarfpool.com:8008"
#ethermine.org
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@asia1.ethermine.org:4444"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eu1.ethermine.org:4444"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@us1.ethermine.org:4444"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@us2.ethermine.org:4444"
#ethermine.org-ssl
POOLS="$POOLS stratum1+ssl://ETH_WALLET.WORKERNAME@asia1.ethermine.org:5555"
POOLS="$POOLS stratum1+ssl://ETH_WALLET.WORKERNAME@eu1.ethermine.org:5555"
POOLS="$POOLS stratum1+ssl://ETH_WALLET.WORKERNAME@us1.ethermine.org:5555"
POOLS="$POOLS stratum1+ssl://ETH_WALLET.WORKERNAME@us2.ethermine.org:5555"
#ethpool.org
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@asia1.ethpool.org:3333"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eu1.ethpool.org:3333"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@us1.ethpool.org:3333"
#f2pool.com
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eth.f2pool.com:8008"
#miningpoolhub.com
POOLS="$POOLS stratum2+tcp://USERNAME%2eWORKERNAME:WORKERPWD@asia.ethash-hub.miningpoolhub.com:20535"
POOLS="$POOLS stratum2+tcp://USERNAME%2eWORKERNAME:WORKERPWD@europe.ethash-hub.miningpoolhub.com:20535"
POOLS="$POOLS stratum2+tcp://USERNAME%2eWORKERNAME:WORKERPWD@us-east.ethash-hub.miningpoolhub.com:20535"
#miningpoolhub.com-ssl - see issue 1629 - seems not working
#POOLS="$POOLS stratum2+ssl://USERNAME%2eWORKERNAME:WORKERPWD@asia.ethash-hub.miningpoolhub.com:20535"
#POOLS="$POOLS stratum2+ssl://USERNAME%2eWORKERNAME:WORKERPWD@europe.ethash-hub.miningpoolhub.com:20535"
#POOLS="$POOLS stratum2+ssl://USERNAME%2eWORKERNAME:WORKERPWD@us-east.ethash-hub.miningpoolhub.com:20535"
#nanopool.org
POOLS="$POOLS stratum1+tcp://ETH_WALLET@eth-asia1.nanopool.org:9999/WORKERNAME/EMAIL"
POOLS="$POOLS stratum1+tcp://ETH_WALLET@eth-eu1.nanopool.org:9999/WORKERNAME/EMAIL"
POOLS="$POOLS stratum1+tcp://ETH_WALLET@eth-eu2.nanopool.org:9999/WORKERNAME/EMAIL"
POOLS="$POOLS stratum1+tcp://ETH_WALLET@eth-us-east1.nanopool.org:9999/WORKERNAME/EMAIL"
POOLS="$POOLS stratum1+tcp://ETH_WALLET@eth-us-west1.nanopool.org:9999/WORKERNAME/EMAIL"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eth-asia1.nanopool.org:9999"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eth-eu1.nanopool.org:9999"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eth-eu2.nanopool.org:9999"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eth-us-east1.nanopool.org:9999"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eth-us-west1.nanopool.org:9999"
#nicehash.com
POOLS="$POOLS stratum2+tcp://BTC_WALLET@daggerhashimoto.br.nicehash.com:3353"
POOLS="$POOLS stratum2+tcp://BTC_WALLET@daggerhashimoto.eu.nicehash.com:3353"
POOLS="$POOLS stratum2+tcp://BTC_WALLET@daggerhashimoto.hk.nicehash.com:3353"
POOLS="$POOLS stratum2+tcp://BTC_WALLET@daggerhashimoto.in.nicehash.com:3353"
POOLS="$POOLS stratum2+tcp://BTC_WALLET@daggerhashimoto.jp.nicehash.com:3353"
POOLS="$POOLS stratum2+tcp://BTC_WALLET@daggerhashimoto.usa.nicehash.com:3353"
POOLS="$POOLS stratum2+tcp://BTC_WALLET.WORKERNAME@daggerhashimoto.br.nicehash.com:3353"
POOLS="$POOLS stratum2+tcp://BTC_WALLET.WORKERNAME@daggerhashimoto.eu.nicehash.com:3353"
POOLS="$POOLS stratum2+tcp://BTC_WALLET.WORKERNAME@daggerhashimoto.hk.nicehash.com:3353"
POOLS="$POOLS stratum2+tcp://BTC_WALLET.WORKERNAME@daggerhashimoto.in.nicehash.com:3353"
POOLS="$POOLS stratum2+tcp://BTC_WALLET.WORKERNAME@daggerhashimoto.jp.nicehash.com:3353"
POOLS="$POOLS stratum2+tcp://BTC_WALLET.WORKERNAME@daggerhashimoto.usa.nicehash.com:3353"
#sparkpool.com
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@cn.sparkpool.com:3333"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@eu.sparkpool.com:3333"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@jp.sparkpool.com:3333"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@kr.sparkpool.com:3333"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@na-east.sparkpool.com:3333"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@na-west.sparkpool.com:3333"
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@tw.sparkpool.com:3333"
# whalesburg
POOLS="$POOLS stratum1+tcp://ETH_WALLET.WORKERNAME@proxy.pool.whalesburg.com:8082"
# check if any parameter and give a hint to specify -G, -U or -X
if [[ "x" == "x$1" ]]; then
self=$(basename $0)
echo "One of -G, -U or -X must be specified"
exit 2
fi
# replace explicit stratum version with autodetect version
if [[ 1 == 0 ]]; then
p=""
for pool in $POOLS; do
v=$pool
v=$(echo "${v/stratum2+tcp/stratum}")
v=$(echo "${v/stratum1+tcp/stratum}")
v=$(echo "${v/stratum+tcp/stratum}")
v=$(echo "${v/stratum2+ssl/stratums}")
v=$(echo "${v/stratum1+ssl/stratums}")
v=$(echo "${v/stratum+ssl/stratums}")
p="$p $v"
done
POOLS=$p
fi
error_cnt=0
for pool in $POOLS; do
rm -f log.txt
current_test_pattern=$pool
# replace placeholders in the pattern with our values
pool=$(echo "${pool/ETH_WALLET/$ETH_WALLET}")
pool=$(echo "${pool/WORKERNAME/$WORKERNAME}")
pool=$(echo "${pool/EMAIL/$EMAIL}")
pool=$(echo "${pool/USERNAME/$USERNAME}")
pool=$(echo "${pool/WORKERPWD/$WORKERPWD}")
pool=$(echo "${pool/BTC_WALLET/$BTC_WALLET}")
echo "Testing=$current_test_pattern"
echo "./progminer -v 1 --exit --report-hashrate -P $pool $@"
echo "./progminer -v 1 --exit --report-hashrate -P $pool $@" > log.txt
./progminer -v 1 --exit --report-hashrate -P $pool $@ >> log.txt 2>&1 &
pid=$!
#echo "PID=$pid"
exit_due_log=0
for ((i=0; i<30; i++)) do
sleep 5 # 30 * 5sec = 150sec max total running time per host
l=$(grep "Accepted" log.txt | wc -l)
if [[ $l != 0 ]]; then
echo "OK: $current_test_pattern"
exit_due_log=1
break
fi
l=$(grep "Error" log.txt | wc -l)
if [[ $l != 0 ]]; then
cp -a log.txt error${error_cnt}.txt
error_cnt=$((error_cnt+1))
echo "ERROR (Error): $current_test_pattern"
exit_due_log=1
break
fi
l=$(grep "Terminated" log.txt | wc -l)
if [[ $l != 0 ]]; then
cp -a log.txt error${error_cnt}.txt
error_cnt=$((error_cnt+1))
echo "ERROR (Terminated): $current_test_pattern"
exit_due_log=1
break
fi
done
kill -2 $pid
wait $pid
if [[ $exit_due_log != 1 ]]; then # seems we've not submitted any share within our mining time - treat as error
cp -a log.txt error${error_cnt}.txt
error_cnt=$((error_cnt+1))
echo "WARNING - UNCONFIRMED STATUS: No share submitted while running: $current_test_pattern"
echo " Fix this by increase runtime or hashrate!"
fi
sleep 1
done
if [[ $error_cnt == 0 ]]; then
echo "SUCCESS: All tests done!"
else
echo "ERROR: $error_cnt test(s) failed!"
exit 1
fi
exit 0