-
Notifications
You must be signed in to change notification settings - Fork 23
/
0miner
390 lines (350 loc) · 13.8 KB
/
0miner
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
#!/bin/bash
##########################################################################
##########################################################################
################# nvOC v0019-3.0 - Community Release #################
######### Based on the original nvOC v0019-1.4 by fullzero ##########
##########################################################################
##########################################################################
# 0miner for nvOC v0019-3.0
# DEV Mod Log:
# v=0001 : papampi: Initial Release
#
# v=0002 : papampi:
# fix lbc
# v=0003 : papampi:
# More NiceHash, MINER_PWD failsafe,
# COIN_EXTENSION_ARGUMENTS for ethminer and genoil
# v=0004 : damNmad:
# New Coins LUX, SUMO, DSR
# v=0005 : papampi:
# New Coin ELLA, XVG, GBX, CRC
# v=0006 : papampi:
# EQUIHASH_MINER, bminer, ETHASH_MINER
# v=0007 : papampi:
# Nicehash bug fixes
# v=0008 : papampi:
# Move all miners to "${NVOC}"/miners/
# v=0009 : papampi
# Pool Wallet Address Format
# v=0010 : papampi
# New Claymore Dual Mining
# v=0011 : damNmad
# Added BTCP
# v=0012 : Falcon
# Added CCMINER_OPTS, added RavenCoin (RVN)
# v=0013 : papampi
# Changed EWBF HCD
# v=0014 : papampi
# Code cleanup, NEOSCRYPT_MINER, LYRA2V2_MINER, SKUNK_MINER, SKEIN_MINER
# v=0015 : LukePicci
# Relocate nvOC to arbitrary install directory
# v=0016 : papampi
# Prevent running 2 miners
# v=0017 : sizzlephizzle
# Unification of EQUIHASH & ETHASH mining by ALGO.
# v=0018 : papampi, sizzlephizzle
# Algo Unification for all algorithms
# v=0019 : papampi
# Crytponight Heavy
# v=0020 : papampi
# ZHASH, PHI1612, PHI2 Algos and Z_EWBF
# v=0021 : LuKePicci
# Support pluggable miners
# v=0022 : papampi
# Ethminer new arguments, Coin Pool Protocol
# v=0023 : papampi
# Cuda switch in screenrc for new and old miners
# v=0024 : papampi
# New miners directory and miner version
# v=0025 : papampi
# BMINER Dual Mining
# v=0026 : papampi
# lolMiner
# v=0027 : papampi
# PhoenixMiner
# v=0028 : papampi
# echo miner command, changes for XMR_Stak 2.5.1
# v=0029 : papampi
# Gminer
# v=0030 : papampi
# ENERGIMINER
# v=0031 : papampi
# CUCKAROO29 and CUCKOO ALGO
# v=0032 : papampi
# CUCKATOO31 ALGO
nvOC_0miner_dev="0032"
source "${NVOC}/1bash"
source "${NVOC}/helpers/coin_algo_mapping"
nvOC_0miner_ver="$nvOC_Ver.$nvOC_0miner_dev" # Do not edit this
# Prevent running 2 miners
if ps ax | grep SCREEN | grep -v cpuminer | grep -q miner ; then
ps ax | grep SCREEN | grep -v cpuminer | grep miner | awk '"miner" {print $1}' | xargs kill -9
fi
# Set MINER_PWD if unset
if [ -z "${MINER_PWD+x}" ]
then
MINER_PWD="x"
fi
## Unify COIN Start
UPOOL="_POOL"
UPORT="_PORT"
UPROTO="_POOL_PROTOCOL"
UADDR="_ADDRESS"
UWORK="_WORKER"
UEXT="_EXTENSION_ARGUMENTS"
UINTENSITY="_INTENSITY"
UWALLET="_WALLET_FORMAT"
UMINER="_MINER"
UVERSION="_VERSION"
UCUDA="_CUDA"
UCCALGO="-a ${ALGO,,}"
xpool=$COIN$UPOOL
xport=$COIN$UPORT
xproto=$COIN$UPROTO
xaddr=$COIN$UADDR
xwork=$COIN$UWORK
xext=$COIN$UEXT
xintensity=$ALGO$UINTENSITY
xwallet=$ALGO$UWALLET
xminer=$ALGO$UMINER
xversion=${!xminer}$UVERSION
xcuda=$ALGO$UCUDA
mpath="${NVOC}/miners/${!xminer}"
# List of cuda-8.0 miners
CUDA_8_MINERS="ANXccminer ASccminer KXccminer MSFTccminer NAccminer SILENTminer SPccminer SUPRminer VERTMINER"
LAUNCH="screen -c ${NVOC}/screenrc-miner -dmSL miner"
for miner in $CUDA_8_MINERS
do
if [[ ${!xminer} =~ $miner ]]; then
LAUNCH="screen -c ${NVOC}/screenrc-miner-cuda-8 -dmSL miner"
fi
done
## Unify COIN End
## NICEHASH
if [[ ${COIN:0:4} == NICE ]]
then
NICE_NEOSCRYPT_ADDRESS=$NICE_ADDRESS
NICE_LYRA2REV2_ADDRESS=$NICE_ADDRESS
NICE_X11GOST_ADDRESS=$NICE_ADDRESS
NICE_SKUNKHASH_ADDRESS=$NICE_ADDRESS
NICE_CRYPTONIGHT_ADDRESS=$NICE_ADDRESS
NICE_EQUIHASH_ADDRESS=$NICE_ADDRESS
NICE_ETHASH_ADDRESS=$NICE_ADDRESS
NICE_CUCKAROO29_ADDRESS=$NICE_ADDRESS
NICE_CUCKATOO31_ADDRESS=$NICE_ADDRESS
## ZPOOL
elif [[ ${COIN:0:5} == ZPOOL ]]
then
ZPOOL_NEOSCRYPT_ADDRESS=$BTC_ADDRESS
ZPOOL_LYRA2REV2_ADDRESS=$BTC_ADDRESS
ZPOOL_SKUNK_ADDRESS=$BTC_ADDRESS
ZPOOL_EQUIHASH_ADDRESS=$BTC_ADDRESS
ZPOOL_LBRY_ADDRESS=$BTC_ADDRESS
ZPOOL_SKEIN_ADDRESS=$BTC_ADDRESS
## MPH
elif [[ ${COIN:0:3} == MPH ]]
then
MPH_NEOSCRYPT_ADDRESS=$MPH_ADDRESS
MPH_LYRA2REV2_ADDRESS=$MPH_ADDRESS
MPH_LYRA2Z_ADDRESS=$MPH_ADDRESS
MPH_CRYPTONIGHT_ADDRESS=$MPH_ADDRESS
MPH_EQUIHASH_ADDRESS=$MPH_ADDRESS
MPH_ETHASH_ADDRESS=$MPH_ADDRESS
MPH_SKEIN_ADDRESS=$MPH_ADDRESS
MPH_CRYPTONIGHTV7=$MPH_ADDRESS
fi
if [[ ${!xproto} == "" ]]
then
eval $xproto="stratum+tcp"
fi
if [[ ${!xversion} == "" ]]
then
eval $xversion="recommended"
fi
## CLAYMORE_DUAL
if [[ $COIN == CLAYMORE_DUAL ]]
then
HCD=${NVOC}/miners/CLAYMORE/$CLAYMORE_VERSION/ethdcrminer64
E_ADDR="$DUAL_EWAL""$ETHASH_WALLET_FORMAT""$DUAL_EWORKER"
D_ADDR="$DUAL_DWAL""$DUAL_WALLET_FORMAT""$DUAL_DWORKER"
screen -c "${NVOC}"/screenrc-miner -dmSL miner "$HCD" -epool "$DUAL_EPOOL":"$DUAL_EPORT" -ewal "$E_ADDR" -epsw "$DUAL_EPSW" -dpool stratum+tcp://"$DUAL_DPOOL":"$DUAL_DPORT" -dwal "$D_ADDR" -dpsw "$DUAL_DPSW" -dcoin "$DUAL_DCOIN" -allpools "$ALL_POOLS" -dbg -1 -mport "$MPORT" -mpsw "$MPSW" "$DUAL_ADDITIONAL_ARGUMENTS"
fi
if [[ $COIN == BMINER_DUAL ]]
then
HCD=${NVOC}/miners/BMINER/$BMINER_VERSION/bminer
screen -c "${NVOC}"/screenrc-miner -dmSL miner "$HCD" -uri $MAIN_COIN_POOL_PROTOCOL://$MAIN_COIN_ADDRESS.$MAIN_COIN_WORKER:$MINER_PWD@$MAIN_COIN_POOL:$MAIN_COIN_PORT -uri2 $DUAL_COIN_POOL_PROTOCOL://$DUAL_COIN_ADDRESS.$DUAL_COIN_WORKER:$MINER_PWD@$DUAL_COIN_POOL:$DUAL_COIN_PORT $BMINER_OPTS
fi
## Pluggable miners
if [[ ${!xversion} != "" && -f ${mpath}//"${!xversion}"/nvoc-miner.json ]]
then
HCD="${mpath}/"${!xversion}"/$(jq -r .hcd ${mpath}/"${!xversion}"/nvoc-miner.json)"
echo $LAUNCH $HCD
eval $LAUNCH $HCD
elif [[ -f ${mpath}/nvoc-miner.json ]]
then
HCD="${mpath}/$(jq -r .hcd ${mpath}/nvoc-miner.json)"
echo $LAUNCH $HCD
eval $LAUNCH $HCD
## ETHASH
elif [[ $ALGO == ETHASH ]]
then
if [[ $ETHASH_MINER == GENOIL ]]
then
HCD="${NVOC}/miners/Genoil-U/ethminer -S ${!xpool}:${!xport} -O ${!xaddr}${!xwallet}${!xwork}:$MINER_PWD -SP 1 -U ${!xext}"
elif [[ $ETHASH_MINER == ETHMINER ]]
then
HCD="${NVOC}/miners/ETHMINER/"${!xversion}"/ethminer -P ${!xproto}://${!xaddr}${!xwallet}${!xwork}:$MINER_PWD@${!xpool}:${!xport} -U ${!xext} $ETHMINER_OPTS"
elif [[ $ETHASH_MINER == CLAYMORE ]]
then
HCD="${NVOC}/miners/CLAYMORE/"${!xversion}"/ethdcrminer64 -epool ${!xpool}:${!xport} -ewal ${!xaddr}${!xwallet}${!xwork} -epsw $MINER_PWD -mode 1 -dbg -1 ${!xext} $CLAYMORE_OPTS"
elif [[ $ETHASH_MINER == BMINER ]]
then
HCD="${NVOC}/miners/BMINER/"${!xversion}"/bminer -uri ${!xproto}://${!xaddr}${!xwallet}${!xwork}:$MINER_PWD@${!xpool}:${!xport} $BMINER_OPTS ${!xext}"
elif [[ $ETHASH_MINER == PhoenixMiner ]]
then
HCD="${NVOC}/miners/PhoenixMiner/"${!xversion}"/PhoenixMiner -pool ${!xproto}://${!xpool}:${!xport} -wal ${!xaddr} -worker ${!xwork} -pass $MINER_PWD ${!xext} $PhoenixMiner_OPTS"
fi
echo $LAUNCH $HCD
eval $LAUNCH $HCD
## EQUIHASH
elif [[ $ALGO == EQUIHASH ]]
then
if [[ $EQUIHASH_MINER == DSTM ]]
then
HCD="${NVOC}/miners/DSTM/"${!xversion}"/miner --server ${!xpool} --user ${!xaddr}${!xwallet}${!xwork} --port ${!xport} --pass $MINER_PWD --time $DSTM_OPTS ${!xext}"
elif [[ $EQUIHASH_MINER == EWBF ]]
then
HCD="${NVOC}/miners/EWBF/"${!xversion}"/miner --eexit 3 --fee $EWBF_PERCENT --pec --server ${!xpool} --user ${!xaddr}${!xwallet}${!xwork} --pass $MINER_PWD --port ${!xport} $EWBF_OPTS ${!xext}"
elif [[ $EQUIHASH_MINER == BMINER ]]
then
HCD="${NVOC}/miners/BMINER/"${!xversion}"/bminer -uri ${!xproto}://${!xaddr}${!xwallet}${!xwork}:$MINER_PWD@${!xpool}:${!xport} $BMINER_OPTS ${!xext}"
fi
echo $LAUNCH $HCD
eval $LAUNCH $HCD
## ZHASH
elif [[ $ALGO == ZHASH ]]
then
if [[ $ZHASH_MINER == Z_EWBF ]]
then
HCD="${NVOC}/miners/Z_EWBF/"${!xversion}"/miner --fee $Z_EWBF_PERCENT --server ${!xpool} --user ${!xaddr}${!xwallet}${!xwork} --pass $MINER_PWD --port ${!xport} $Z_EWBF_OPTS ${!xext}"
elif [[ $ZHASH_MINER == BMINER ]]
then
HCD="${NVOC}/miners/BMINER/"${!xversion}"/bminer -uri ${!xproto}://${!xaddr}${!xwallet}${!xwork}:$MINER_PWD@${!xpool}:${!xport} $BMINER_OPTS ${!xext}"
elif [[ $ZHASH_MINER == LOLMINER ]]
then
HCD="${NVOC}/miners/LOLMINER/"${!xversion}"/lolMiner -coin=$COIN -pool=${!xpool} -port=${!xport} -user=${!xaddr}${!xwallet}${!xwork} $LOLMINER_OPTS ${!xext}"
elif [[ $ZHASH_MINER == GMINER ]]
then
HCD="${NVOC}/miners/GMINER/"${!xversion}"/miner --server ${!xpool} --user ${!xaddr}${!xwallet}${!xwork} --pass $MINER_PWD --port ${!xport} $GMINER_OPTS ${!xext}"
fi
echo $LAUNCH $HCD
eval $LAUNCH $HCD
## CUCKOO
elif [[ $ALGO == CUCKOO ]]
then
if [[ $CUCKOO_MINER == GMINER ]]
then
HCD="${NVOC}/miners/GMINER/"${!xversion}"/miner --server ${!xpool} --user ${!xaddr}${!xwallet}${!xwork} --pass $MINER_PWD --port ${!xport} $GMINER_OPTS ${!xext}"
fi
echo $LAUNCH $HCD
eval $LAUNCH $HCD
## CUCKAROO29
elif [[ $ALGO == CUCKAROO29 ]]
then
if [[ $CUCKAROO29_MINER == GMINER ]]
then
HCD="${NVOC}/miners/GMINER/"${!xversion}"/miner --server ${!xpool} --user ${!xaddr}${!xwallet}${!xwork} --pass $MINER_PWD --port ${!xport} $GMINER_OPTS ${!xext}"
echo $LAUNCH $HCD
eval $LAUNCH $HCD
elif [[ $CUCKAROO29_MINER == BMINER ]]
then
HCD="${NVOC}/miners/BMINER/"${!xversion}"/bminer -uri ${!xproto}://${!xaddr}${!xwallet}${!xwork}:$MINER_PWD@${!xpool}:${!xport} $BMINER_OPTS ${!xext}"
echo $LAUNCH $HCD
eval $LAUNCH $HCD
fi
## CUCKATOO31
elif [[ $ALGO == CUCKATOO31 ]]
then
if [[ $CUCKATOO31_MINER == GMINER ]]
then
HCD="${NVOC}/miners/GMINER/"${!xversion}"/miner --server ${!xpool} --user ${!xaddr}${!xwallet}${!xwork} --pass $MINER_PWD --port ${!xport} $GMINER_OPTS ${!xext}"
echo $LAUNCH $HCD
eval $LAUNCH $HCD
elif [[ $CUCKATOO31_MINER == BMINER ]]
then
HCD="${NVOC}/miners/BMINER/"${!xversion}"/bminer -uri ${!xproto}://${!xaddr}${!xwallet}${!xwork}:$MINER_PWD@${!xpool}:${!xport} $BMINER_OPTS ${!xext}"
echo $LAUNCH $HCD
eval $LAUNCH $HCD
fi
## Energi
elif [[ $ALGO == ENERGI ]]
then
if [[ $ENERGI_MINER == ENERGIMINER ]]
then
HCD="${NVOC}/miners/ENERGIMINER/"${!xversion}"/energiminer ${!xproto}://${!xaddr}${!xwallet}${!xwork}:$MINER_PWD@${!xpool}:${!xport} $ENERGIMINER_OPTS ${!xext}"
fi
echo $LAUNCH $HCD
eval $LAUNCH $HCD
## Various Algos
elif [[ $ALGO == X21S || $ALGO == MTP || $ALGO == X22I || $ALGO == X16R || $ALGO == SIB || $ALGO == LYRA2Z || $ALGO == SKUNK || $ALGO == KECCAK || $ALGO == SKEIN || $ALGO == NEOSCRYPT || $ALGO == LYRA2V2 || $ALGO == BITCORE || $ALGO == PHI1612 || $ALGO == PHI2 || $ALGO == LBRY || $ALGO == DMD_GR || $ALGO == GROESTL || $ALGO == MYR_GR || $ALGO == DECRED || $ALGO == SIA || $ALGO == X13 || $ALGO == XEVAN ]]
then
UCCALGO="-a ${ALGO,,}"
HCD="${NVOC}"/miners/"${!xminer}"/"${!xversion}"/ccminer
echo $LAUNCH $HCD $UCCALGO -o ${!xproto}://"${!xpool}":"${!xport}" -u "${!xaddr}""${!xwallet}""${!xwork}" -p "$MINER_PWD" -i "${!xintensity}" $CCMINER_OPTS ${!xext}
eval $LAUNCH $HCD $UCCALGO -o ${!xproto}://"${!xpool}":"${!xport}" -u "${!xaddr}""${!xwallet}""${!xwork}" -p "$MINER_PWD" -i "${!xintensity}" $CCMINER_OPTS ${!xext}
## CRYPTONIGHT
elif [[ $ALGO == CRYPTONIGHT ]]
then
if [[ $CRYPTONIGHT_MINER == KTccminer_cryptonight ]]
then
HCD="${NVOC}"/miners/KTccminer_cryptonight/"${!xversion}"/ccminer
echo $LAUNCH $HCD -o ${!xproto}://"${!xpool}":"${!xport}" -u "${!xaddr}""${!xwallet}""${!xwork}" -p "$MINER_PWD" $CCMINER_OPTS ${!xext}
eval $LAUNCH $HCD -o ${!xproto}://"${!xpool}":"${!xport}" -u "${!xaddr}""${!xwallet}""${!xwork}" -p "$MINER_PWD" $CCMINER_OPTS ${!xext}
else
UCCALGO="-a ${ALGO,,}"
HCD="${NVOC}"/miners/"${!xminer}"/"${!xversion}"/ccminer
echo $LAUNCH $HCD $UCCALGO -o ${!xproto}://"${!xpool}":"${!xport}" -u "${!xaddr}""${!xwallet}""${!xwork}" -p "$MINER_PWD" -i "${!xintensity}" $CCMINER_OPTS ${!xext}
eval $LAUNCH $HCD $UCCALGO -o ${!xproto}://"${!xpool}":"${!xport}" -u "${!xaddr}""${!xwallet}""${!xwork}" -p "$MINER_PWD" -i "${!xintensity}" $CCMINER_OPTS ${!xext}
fi
## CRYPTONIGHTV7
elif [[ $ALGO == CRYPTONIGHTV7 || $ALGO == CRYPTONIGHTHEAVY || $ALGO == CRYPTONIGHTV8 ]];
then
# Large memory page support
sudo sysctl -w vm.nr_hugepages=128
# Remove nvidia.txt if cards count changed
if [ -f ~/nvidia.txt ]
then
if [ "$(grep -c "// gpu:" ~/nvidia.txt)" != "$(nvidia-smi -i 0 --query-gpu=count --format=csv,noheader,nounits)" ]
then
rm ~/nvidia.txt
fi
fi
# Change verbosity to show hashrate in output log
if [ -f ~/config.txt ]
then
if grep -q '"verbose_level" : 3' ~/config.txt
then
sed -i 's/"verbose_level" : 3/"verbose_level" : 4/g' ~/config.txt
fi
fi
if [[ $ALGO == "CRYPTONIGHTV7" ]]
then
UCCALGO="--currency cryptonight_v7"
elif [[ $ALGO == "CRYPTONIGHTV8" ]]
then
UCCALGO="--currency cryptonight_v8"
elif [[ $ALGO == "CRYPTONIGHTHEAVY" ]]
then
UCCALGO="--currency cryptonight_heavy"
fi
pushd ${NVOC}/miners/XMR_Stak/"${!xversion}"
HCD=${NVOC}/miners/XMR_Stak/"${!xversion}"/xmr-stak
echo $LAUNCH $HCD $UCCALGO --config "${NVOC}/miners/XMR_Stak/${!xversion}/config.txt" --poolconf "${NVOC}/miners/XMR_Stak/${!xversion}/pools.txt" --noCPU --noAMD -o "${!xpool}":"${!xport}" -u "${!xaddr}""${!xwallet}""${!xwork}" -p "$MINER_PWD" -i 0
eval $LAUNCH $HCD $UCCALGO --config "${NVOC}/miners/XMR_Stak/${!xversion}/config.txt" --poolconf "${NVOC}/miners/XMR_Stak/${!xversion}/pools.txt" --noCPU --noAMD -o "${!xpool}":"${!xport}" -u "${!xaddr}""${!xwallet}""${!xwork}" -p "$MINER_PWD" -i 0
popd
else
echo ""
echo "COIN/ALGO not found, Check your settings"
echo "Miner not started, Stopping watchdog"
pkill -f 5watchdog
fi