forked from ethereum-mining/ethminer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testpools.bash
executable file
·192 lines (174 loc) · 9.07 KB
/
testpools.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
#!/usr/bin/env bash
## vim:set ft=bash ts=4 sw=4 et:
#
# Testscript to test ethminer multiple pools/hosts/syntaxes
# Put this script in the bin directory of ethminer 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 "./ethminer" could be still a wrapper script
export ETH_WALLET="0x9E431042fAA3224837e9BEDEcc5F4858cf0390B9"
export WORKERNAME="pooltester"
export EMAIL="[email protected]"
export USERNAME="aminer"
export WORKERPWD="x"
export BTC_WALLET="3C4FURwL4oAaEUuCLYmNPUEKQSPR1FAJ3m"
POOLS=""
#2miners.com
POOLS="$POOLS stratum+tcp://[email protected]:2020"
#dwarfpool.org
POOLS="$POOLS stratum+tcp://[email protected]:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum+tcp://[email protected]:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum+tcp://[email protected]:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum+tcp://[email protected]:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum+tcp://[email protected]:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum+tcp://[email protected]:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum+tcp://[email protected]:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum+tcp://[email protected]:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum+tcp://[email protected]:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum+tcp://[email protected]:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum+tcp://[email protected]:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum+tcp://[email protected]:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum+tcp://[email protected]:8008/WORKERNAME/EMAIL"
POOLS="$POOLS stratum+tcp://[email protected]:8008"
POOLS="$POOLS stratum+tcp://[email protected]:8008"
POOLS="$POOLS stratum+tcp://[email protected]:8008"
POOLS="$POOLS stratum+tcp://[email protected]:8008"
POOLS="$POOLS stratum+tcp://[email protected]:8008"
POOLS="$POOLS stratum+tcp://[email protected]:8008"
POOLS="$POOLS stratum+tcp://[email protected]:8008"
POOLS="$POOLS stratum+tcp://[email protected]:8008"
POOLS="$POOLS stratum+tcp://[email protected]:8008"
POOLS="$POOLS stratum+tcp://[email protected]:8008"
POOLS="$POOLS stratum+tcp://[email protected]:8008"
POOLS="$POOLS stratum+tcp://[email protected]:8008"
POOLS="$POOLS stratum+tcp://[email protected]:8008"
#ethermine.org
POOLS="$POOLS stratum+tcp://[email protected]:4444"
POOLS="$POOLS stratum+tcp://[email protected]:4444"
POOLS="$POOLS stratum+tcp://[email protected]:4444"
POOLS="$POOLS stratum+tcp://[email protected]:4444"
#ethermine.org-ssl
POOLS="$POOLS stratum+ssl://[email protected]:5555"
POOLS="$POOLS stratum+ssl://[email protected]:5555"
POOLS="$POOLS stratum+ssl://[email protected]:5555"
POOLS="$POOLS stratum+ssl://[email protected]:5555"
#ethpool.org
POOLS="$POOLS stratum+tcp://[email protected]:3333"
POOLS="$POOLS stratum+tcp://[email protected]:3333"
POOLS="$POOLS stratum+tcp://[email protected]:3333"
#f2pool.com
POOLS="$POOLS stratum+tcp://[email protected]:8008"
#miningpoolhub.com
POOLS="$POOLS stratum+tcp://USERNAME.WORKERNAME:[email protected]:20535"
POOLS="$POOLS stratum+tcp://USERNAME.WORKERNAME:[email protected]:20535"
POOLS="$POOLS stratum+tcp://USERNAME.WORKERNAME:[email protected]:20535"
#nanopool.org
POOLS="$POOLS stratum+tcp://[email protected]:9999/WORKERNAME/EMAIL"
POOLS="$POOLS stratum+tcp://[email protected]:9999/WORKERNAME/EMAIL"
POOLS="$POOLS stratum+tcp://[email protected]:9999/WORKERNAME/EMAIL"
POOLS="$POOLS stratum+tcp://[email protected]:9999/WORKERNAME/EMAIL"
POOLS="$POOLS stratum+tcp://[email protected]:9999/WORKERNAME/EMAIL"
POOLS="$POOLS stratum+tcp://[email protected]:9999"
POOLS="$POOLS stratum+tcp://[email protected]:9999"
POOLS="$POOLS stratum+tcp://[email protected]:9999"
POOLS="$POOLS stratum+tcp://[email protected]:9999"
POOLS="$POOLS stratum+tcp://[email protected]:9999"
#nicehash.com
POOLS="$POOLS stratum+tcp://[email protected]:3353"
POOLS="$POOLS stratum+tcp://[email protected]:3353"
POOLS="$POOLS stratum+tcp://[email protected]:3353"
POOLS="$POOLS stratum+tcp://[email protected]:3353"
POOLS="$POOLS stratum+tcp://[email protected]:3353"
POOLS="$POOLS stratum+tcp://[email protected]:3353"
POOLS="$POOLS stratum+tcp://[email protected]:3353"
POOLS="$POOLS stratum+tcp://[email protected]:3353"
POOLS="$POOLS stratum+tcp://[email protected]:3353"
POOLS="$POOLS stratum+tcp://[email protected]:3353"
POOLS="$POOLS stratum+tcp://[email protected]:3353"
POOLS="$POOLS stratum+tcp://[email protected]:3353"
#pool.sexy
POOLS="$POOLS stratum+tcp://[email protected]:10002"
#sparkpool.com
POOLS="$POOLS stratum+tcp://[email protected]:3333"
POOLS="$POOLS stratum+tcp://[email protected]:3333"
POOLS="$POOLS stratum+tcp://[email protected]:3333"
POOLS="$POOLS stratum+tcp://[email protected]:3333"
POOLS="$POOLS stratum+tcp://[email protected]:3333"
POOLS="$POOLS stratum+tcp://[email protected]:3333"
POOLS="$POOLS stratum+tcp://[email protected]:3333"
# whalesburg
POOLS="$POOLS stratum+tcp://[email protected]: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
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 "./ethminer -v 9 --exit -P $pool $@"
./ethminer -v 9 --exit -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