We need to add more pools to pool.conf. I have no idea how to parse the pools API.
The file pools.conf is quite straightforward; for example:
slush
api.bitcoin.cz:8332
https://mining.bitcoin.cz/stats/json/
$time=~s/.*round_duration": "//; $time=~s/".*//; $time=parse_time($time); $rate=~s/.*ghashes_ps": "//; $rate=~s/(\.\d*)?".*//; $shares=~s/.*shares": //s; $shares=~s/,.*//s;
utility_2
The first line of a stanza is the pool's name; second is the RPC port (the one the miners use), the third is a URL which the Multipool.pl will fetch in order to gather statistics, then some code whose purpose is to get the time since last block found, total shares and total rate in GHash, and lastly the "utility" function to be used to calculate the utility for a pool.
The line of code is messy, but the idea is that it is executed in a context in which $_ (the topic variable) is aliased to the data received from the URL above, and it needs to "output" three variables:
* $time, in seconds, indicating how long ago the last block was found;
* $rate, in GHashes/s, indicating the pool's speed in GH/s
* $shares, indicating how many shares the pool has currently mined.
An example, for mineco.in:
The stats are in JSON:
$ curl https://mineco.in/stats.json
{"hashrate":86362247950,"users":568,"blocks_found":16,"shares_this_round":2102867,"last_block":{"found":1309779953,"user":"mau","shares":1461964,"duration":79213}}
The info we're looking for is the number after "hashrate", but it's in hashes per second so it needs to be divided by 10^6; the number after "duration" and the number after "shares_this_round".
The way you can test the line of code that goes in the config is via:
curl URL | perl -lne' $time=$shares=$rate=$_;
THAT LINE OF CODE HERE;
print "Rate: $rate"; print "Time: $time"; print "Shares: $shares"; '
so for example:
$ curl https://mineco.in/stats.json | perl -lne'
$time=$shares=$rate=$_;
$time=~s/^.*"duration":(\d+).*$/$1/;
$shares=~s/^.*"shares_this_round":(\d+).*/$1/;
$rate=~s/^.*"hashrate":(\d+).*/$1/;$rate/=10**9;
print "Rate: $rate"; print "Time: $time"; print "Shares: $shares"; '
Rate: 86.069951565
Time: 79213
Shares: 2097252
There you go
The stanza then becomes:
minecoin
mineco.in:3000
https://mineco.in/stats.json
$time=~s/^.*"duration":(\d+).*$/$1/; $shares=~s/^.*"shares_this_round":(\d+).*/$1/; $rate=~s/^.*"hashrate":(\d+).*/$1/;$rate/=10**9;
utility_1
Check out the different utility_ functions, but usually utility_1 seems to work fine.
If you want me to do others do not hesitate to PM me or try doing them yourselves; above I have explained how.
(edited: wrapped in code blocks)