Post
Topic
Board Mining (Altcoins)
Re: [OS] nvOC easy-to-use Linux Nvidia Mining v0019-1.2
by
papampi
on 09/10/2017, 18:36:28 UTC
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):
Code:
# 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):
Code:
"region": "${MPH_PREFERRED_REGION}"
so, definition for JSON file will be:
Code:
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:
Code:
region=cfg["region"].lower()
3b) replace block for evaluating miner scripts
Code:
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
Code:
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.
Why do you waste your mining on MPH auto switch ?
MPH changed its api update time from 3 minutes to 30 minutes a month ago
So by the time api updates and you switch to a new coin, probably  the coin has gain difficulty and has no profit any more.
The web page update normal at 3 minutes but api no.