selectable estimate...want to try estimate_last24h to see if it doesn't switch as often
This commit is contained in:
27
README.md
27
README.md
@@ -12,6 +12,33 @@ configuration between the different pools.
|
|||||||
I started this under nvOC, but have since migrated my mining rig from nvOC
|
I started this under nvOC, but have since migrated my mining rig from nvOC
|
||||||
to a standard Gentoo Linux setup.
|
to a standard Gentoo Linux setup.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
=====
|
||||||
|
|
||||||
|
./zpool-switch.py conf-file miner-file algo-map estimate_selection [algo]
|
||||||
|
|
||||||
|
The switcher takes four parameters in normal operation:
|
||||||
|
|
||||||
|
conf-file: general configuration (JSON)
|
||||||
|
|
||||||
|
miner-file: miner configuration (JSON)
|
||||||
|
|
||||||
|
algo-map: mapping from the algorithm labels zpool uses to the ones used in
|
||||||
|
miner-file (JSON)
|
||||||
|
|
||||||
|
estimate_selection: one of three values to determine switching behavior,
|
||||||
|
based on the three estimates provided by zpool: estimate_current,
|
||||||
|
estimate_last24h, actual_last24h. estimate_current is likely to lead to
|
||||||
|
more frequent switching than the other two.
|
||||||
|
|
||||||
|
The optional fifth parameter lets you manually pick an algorithm for mining;
|
||||||
|
this is useful for testing and benchmarking.
|
||||||
|
|
||||||
|
zpool-switch configures the cards' fan and power settings, starts the miner
|
||||||
|
in a screen session, and exits. It should be called periodically (perhaps
|
||||||
|
every 10-15 minutes); you could do this with a shell script, a cron job, or
|
||||||
|
whatever other method you prefer.
|
||||||
|
|
||||||
miners.json
|
miners.json
|
||||||
===========
|
===========
|
||||||
|
|
||||||
|
|||||||
@@ -70,18 +70,18 @@ miners=filtered_miners
|
|||||||
# adjust estimates so they're all in the same units: BTC/day per GH/s
|
# adjust estimates so they're all in the same units: BTC/day per GH/s
|
||||||
|
|
||||||
for i in data:
|
for i in data:
|
||||||
data[i]["estimate_current"]=float(data[i]["estimate_current"])*1000
|
data[i]["estimate"]=float(data[i][sys.argv[4]])*1000
|
||||||
try:
|
try:
|
||||||
data["sha256"]["estimate_current"]/=1000000000
|
data["sha256"]["estimate"]/=1000000000
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
data["equihash"]["estimate_current"]*=1000
|
data["equihash"]["estimate"]*=1000
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
for i in ["scrypt", "blakecoin", "blake2s", "decred", "x11", "quark", "qubit", "keccak"]:
|
for i in ["scrypt", "blakecoin", "blake2s", "decred", "x11", "quark", "qubit", "keccak"]:
|
||||||
try:
|
try:
|
||||||
data[i]["estimate_current"]/=1000
|
data[i]["estimate"]/=1000
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ for i in data:
|
|||||||
coins[i]["algo"]=i
|
coins[i]["algo"]=i
|
||||||
coins[i]["mapped_algo"]=algo_map[i]
|
coins[i]["mapped_algo"]=algo_map[i]
|
||||||
coins[i]["name"]=i
|
coins[i]["name"]=i
|
||||||
coins[i]["estimate"]=data[i]["estimate_current"]*float(coins[i]["speed"])-24.0*coins[i]["power"]*pwrcost/exchrate
|
coins[i]["estimate"]=data[i]["estimate"]*float(coins[i]["speed"])-24.0*coins[i]["power"]*pwrcost/exchrate
|
||||||
|
|
||||||
# sort by profitability
|
# sort by profitability
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ log.close()
|
|||||||
|
|
||||||
miner=coins[sort[0][0]]
|
miner=coins[sort[0][0]]
|
||||||
|
|
||||||
if (len(sys.argv)==4):
|
if (len(sys.argv)==5):
|
||||||
# exit if maximum is below minimum
|
# exit if maximum is below minimum
|
||||||
if (miner["estimate"]<min_profit):
|
if (miner["estimate"]<min_profit):
|
||||||
algo_log=open("algo-log", "a")
|
algo_log=open("algo-log", "a")
|
||||||
@@ -121,8 +121,8 @@ if (len(sys.argv)==4):
|
|||||||
subprocess.call(["pkill", "-f", "^"+coins[algo].replace("+", "\\+")])
|
subprocess.call(["pkill", "-f", "^"+coins[algo].replace("+", "\\+")])
|
||||||
sys.exit()
|
sys.exit()
|
||||||
else: # manual override
|
else: # manual override
|
||||||
if (sys.argv[4]!="list"):
|
if (sys.argv[5]!="list"):
|
||||||
miner=coins[sys.argv[4]]
|
miner=coins[sys.argv[5]]
|
||||||
else: # list available algos
|
else: # list available algos
|
||||||
print("algos: ", end="")
|
print("algos: ", end="")
|
||||||
for i in coins:
|
for i in coins:
|
||||||
|
|||||||
Reference in New Issue
Block a user