selectable estimate...want to try estimate_last24h to see if it doesn't switch as often

This commit is contained in:
2018-01-24 10:12:24 -08:00
parent da8e3b82a7
commit cc617b9c2f
2 changed files with 35 additions and 8 deletions

View File

@@ -12,6 +12,33 @@ configuration between the different pools.
I started this under nvOC, but have since migrated my mining rig from nvOC
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
===========

View File

@@ -70,18 +70,18 @@ miners=filtered_miners
# adjust estimates so they're all in the same units: BTC/day per GH/s
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:
data["sha256"]["estimate_current"]/=1000000000
data["sha256"]["estimate"]/=1000000000
except:
pass
try:
data["equihash"]["estimate_current"]*=1000
data["equihash"]["estimate"]*=1000
except:
pass
for i in ["scrypt", "blakecoin", "blake2s", "decred", "x11", "quark", "qubit", "keccak"]:
try:
data[i]["estimate_current"]/=1000
data[i]["estimate"]/=1000
except:
pass
@@ -95,7 +95,7 @@ for i in data:
coins[i]["algo"]=i
coins[i]["mapped_algo"]=algo_map[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
@@ -111,7 +111,7 @@ log.close()
miner=coins[sort[0][0]]
if (len(sys.argv)==4):
if (len(sys.argv)==5):
# exit if maximum is below minimum
if (miner["estimate"]<min_profit):
algo_log=open("algo-log", "a")
@@ -121,8 +121,8 @@ if (len(sys.argv)==4):
subprocess.call(["pkill", "-f", "^"+coins[algo].replace("+", "\\+")])
sys.exit()
else: # manual override
if (sys.argv[4]!="list"):
miner=coins[sys.argv[4]]
if (sys.argv[5]!="list"):
miner=coins[sys.argv[5]]
else: # list available algos
print("algos: ", end="")
for i in coins: