Author

Topic: Litecoin + Pushpool + mmcfe (Read 2811 times)

sr. member
Activity: 850
Merit: 331
October 03, 2012, 10:15:46 AM
#3
Ok,

So now that I've gotten over the newbie restriction,

I saw in this post  https://bitcointalksearch.org/topic/litecoind-pushpool-mmcfe-76372 that Tittiez fixed the hashrate issue in mmcfe.  I have everything up and running but I can't for the life of me figure out how to fix this problem, it's acutally getting on my nerves at this point. Also, if anyone can recommend any other frontend that works, as in NOT simplecoin (working on getting that one up) please let me know because I have everything up and running... except for the front end.

To your problem I've found this mod of hashrate.php that seems to give correct values on MH/s.

http://pastebin.com/aj86DsJx


I've added $retarget as variable to requiredFuntions.php, maybe is needed in other files, when make more changes.

Code:

$includeDirectory 
"/var/www/includes/";

include(
$includeDirectory."requiredFunctions.php");

//Hashrate by worker
$sql =  "SELECT IFNULL(sum(a.id),0) as id, p.username FROM pool_worker p LEFT JOIN ".
"((SELECT count(id) as id, username ".
"FROM shares ".
"WHERE time > DATE_SUB(now(), INTERVAL 10 MINUTE) ".
"GROUP BY username) ".
"UNION ".
"(SELECT count(id) as id, username ".
"FROM shares_history ".
"WHERE time > DATE_SUB(now(), INTERVAL 10 MINUTE) ".
"GROUP BY username)) a ".
"ON p.username=a.username ".
"GROUP BY username";
$result mysql_query($sql);
while (
$resultrow mysql_fetch_object($result)) {
$retarget 17;
$hashrate $resultrow->id;
$key bcpow(2,$retarget) or die("bcpow err");
$hashrate round((($hashrate*$key)/600)/10003);
mysql_query("UPDATE pool_worker SET hashrate = $hashrate WHERE username = '$resultrow->username'");
}

//Total Hashrate (more exact than adding)
$sql =  "SELECT sum(a.id) as id FROM ".
"((SELECT count(id) as id FROM shares WHERE time > DATE_SUB(now(), INTERVAL 10 MINUTE)) ".
"UNION ".
"(SELECT count(id) as id FROM shares_history WHERE time > DATE_SUB(now(), INTERVAL 10 MINUTE)) ".
") a ";
$result mysql_query($sql);
if (
$resultrow mysql_fetch_object($result)) {
$retarget 17;
$hashrate $resultrow->id;
        
$key bcpow(2,$retarget) or die("bcpow err");
        
$hashrate round((($hashrate*$key)/600)/10003);
mysql_query("UPDATE settings SET value = '$hashrate' WHERE setting='currenthashrate'");
}

//Hashrate by user
$sql "SELECT u.id, IFNULL(sum(p.hashrate),0) as hashrate ".
"FROM webUsers u LEFT JOIN pool_worker p ".
"ON p.associatedUserId = u.id ".
"GROUP BY id";
$result mysql_query($sql);
while (
$resultrow mysql_fetch_object($result)) {
mysql_query("UPDATE webUsers SET hashrate = $resultrow->hashrate WHERE id = $resultrow->id");

// Enable this for lots of stats for graphing
if ($resultrow->hashrate 0) {
mysql_query("INSERT INTO userHashrates (userId, hashrate) VALUES ($resultrow->id$resultrow->hashrate)"); // active users hashrate
}
}

mysql_query("INSERT INTO userHashrates (userId, hashrate) VALUES (0, $hashrate)"); // the pool total hashrate

$currentTime time();
mysql_query("update settings set value='$currentTime' where setting='statstime'");

// Clean up the userHashrate table (anything older than 4 days)
mysql_query("DELETE FROM userHashrates WHERE timestamp < DATE_SUB(now(), INTERVAL 96 HOUR)");

?>

sr. member
Activity: 850
Merit: 331
October 03, 2012, 09:50:17 AM
#2
At least you have all running btu not me Cheesy, the cronjobs to update the pool fail the 2 that uses bitcoinclient class, so cronjob.php and archive.php.

Code:
XML-RPC: xmlrpcmsg::parseResponseHeaders: HTTP error, got response: HTTP/1.1 Not Found
PHP Fatal error:  Uncaught BitcoinClientException: [0]: Didn't receive 200 Oom remote server. (HTTP/1.1 404 Not Found)

  thrown in  on line 0

Did you faced that problem?

Regards

EDIT: The problem was the the function to get block number, is different from to btc to LTC, so in both files change:
Code:
$currentBlockNumber = $bitcoinController->getblocknumber();

by

Code:
$currentBlockNumber = $bitcoinController->query("getblockcount");
newbie
Activity: 10
Merit: 0
October 02, 2012, 04:21:10 PM
#1
Ok,

So now that I've gotten over the newbie restriction,

I saw in this post  https://bitcointalksearch.org/topic/litecoind-pushpool-mmcfe-76372 that Tittiez fixed the hashrate issue in mmcfe.  I have everything up and running but I can't for the life of me figure out how to fix this problem, it's acutally getting on my nerves at this point. Also, if anyone can recommend any other frontend that works, as in NOT simplecoin (working on getting that one up) please let me know because I have everything up and running... except for the front end.
Jump to: