Hi Fullzero,
I've a small improvment of MPH script. I live in EU, so for me are better pools in Europe. MPH salfter script don't check location by default, by API gets list of possible host. I measure ping with default host names from MPH API and there were little big latency against to Europe host. So, I modify switching script.
There is guideline:
1) modify
1bash script and add (in MPH settings - for example before
PROFIT_CHECK_TIMEOUT):
# preferred region - possible values: us-east, europe, asia
MPH_PREFERRED_REGION="europe"
2) modify
3main script and adjust structure for generation configuration file for MPH (
mph_conf.json, find this:
/home/m1/mph_conf.json):
"region": "${MPH_PREFERRED_REGION}"
so, definition for JSON file will be:
cat </home/m1/mph_conf.json
{
"user_name": "$MPH_USERNAME",
"miner_name": "$WORKER_NAME",
"card_type": "nvidia",
"currency": "$CURRENCY",
"pwrcost": $POWER_COST,
"min_profit": $MINIMUM_PROFIT,
"region": "${MPH_PREFERRED_REGION}", # <--- add this line only
"miners":
{
... setting for miners are same
}
}
EOF
3) modify
mph_switch script:
3a) after line with
min_profit=cfg["min_profit"] add:
region=cfg["region"].lower()
3b) replace block for evaluating miner scripts
coins={}
for i in reversed(data): # weed out unconfigured algos, do string substitutions
try:
miner=miners[i["algo"]]
coins[i["coin_name"]]=miner["bin"].format(HOST=i["host"], PORT=str(i["port"]), NAME=user_name, MINER=miner_name)
except:
data.remove(i)
for
coins={}
for i in reversed(data): # weed out unconfigured algos, do string substitutions
try:
miner=miners[i["algo"]]
host = i["host"]
for tmp_host in i["host_list"].split(";"):
if region in tmp_host:
host = tmp_host
break
coins[i["coin_name"]]=miner["bin"].format(HOST=host, PORT=str(i["port"]), NAME=user_name, MINER=miner_name)
except:
data.remove(i)
That's all. Now MPH check region settings.