Pages:
Author

Topic: v5.6.0 ][ Open-Source Pooling Web Software ( MiningFarm ) - page 13. (Read 57216 times)

member
Activity: 84
Merit: 10
Another question...

When I query bitcoind getinfo, the hashespersec value is at 0.  Shouldn't this be showing up the total hash value of the pool?

Cheers
member
Activity: 84
Merit: 10
Can you please explain the share and score payment types?

Is there a method to setup pay per share?

Cheers
member
Activity: 84
Merit: 10
So I added the following to register.php:

$act = $_POST["act"];

above

if($act == "auth"){

and that fixed the registration.  I haven't configured mail properly so I just activated my account manual and gave myself admin.

I'm now successfully running a pool and it all seems to be working!  My miners are hashing away and the shares are being recorded.

Are you planning on added the ability to show shares based on workers?

Still seems to be a few more bugs.  I'm happy to work closer with you to debug them and improve the product further.
member
Activity: 84
Merit: 10
Dude you've also hard coded your database name all over the place...are you planning on fixing that?
member
Activity: 84
Merit: 10
So I've setup version 2 from scratch with new database based on the sql file you have included.

I can't get past registering a user.  There seems to be some undefined variables causing the problem and these are:

From index.php:
PHP Notice:  Undefined variable: files1 in /srv/www/htdocs/req/modules/loadModules.php on line 47

From register.php:
PHP Notice:  Undefined variable: act in /srv/www/htdocs/register.php on line 41
PHP Notice:  Undefined variable: act in /srv/www/htdocs/register.php on line 58
PHP Notice:  Undefined variable: goodMessage in /srv/www/htdocs/register.php on line 156
PHP Notice:  Undefined variable: returnError in /srv/www/htdocs/register.php on line 157
PHP Notice:  Undefined variable: goodMessage in /srv/www/htdocs/register.php on line 160

Cheers
member
Activity: 84
Merit: 10
Version 2 is out!, The most notable updates are everything we've previously talked about, such as timestamp, and password hashing issues. Another feature is you ONLY need to edit a couple of files instead of editing the directory of every single page it auto-magically finds the path so it should be an easy as pie as some like to say to install and or update your front-end

Excellent!  Going to give it a try tonight Smiley
legendary
Activity: 980
Merit: 1003
I'm not just any shaman, I'm a Sha256man
Version 2 is out!, The most notable updates are everything we've previously talked about, such as timestamp, and password hashing issues. Another feature is you ONLY need to edit a couple of files instead of editing the directory of every single page it auto-magically finds the path so it should be an easy as pie as some like to say to install and or update your front-end
legendary
Activity: 980
Merit: 1003
I'm not just any shaman, I'm a Sha256man
Nice updates guys, I'll get github up and working after the 2nd version is released so everyone can have their own fork. Github dosen't want to accept my key or something so I can't upload nothing yet but I'll get it worked out soon
sr. member
Activity: 406
Merit: 250
And now more stat sharing code Smiley
woops, that should be:
Code:

$req 
"/var/www/req/";
$functions $req."requiredFunctions.php";
include(
$functions);

/////////Update workers
connectToDb();

//Active in past 10 minutes
try {
$sql ="SELECT sum(a.id) IS NOT NULL AS active, 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 ($resultObj mysql_fetch_object($result)) {
mysql_query("UPDATE pool_worker p SET active=".$resultObj->active." WHERE username='".$resultObj->username."'");
}
} catch (
Exception $e) {}
full member
Activity: 434
Merit: 101
I've got it to the stage where I can create an account but email validation doesn't work (no email sent).

What are the requirements for email validation to work?

In addition to this, looks like login.php is trying to connect to the mysql database without a username and password - line 41.  There's no connectDb function, unlike in register.php which works fine.  Can you have a look at this?
For a fix until v2 go into login.php and change connecDb() to connecToDb();



There is no connecDB in login.php i think thats why its defaulting to the default sql name, pw etc
sr. member
Activity: 406
Merit: 250
And now more stat sharing code Smiley

This is a worker monitor. I have it named cronjobs/workers.php

Code:

$req 
"/var/www/req/";
$functions $req."requiredFunctions.php";
include(
$functions);

/////////Update workers
connectToDb();

//Active in past 10 minutes
try {
$sql ="SELECT sum(a.id) IS NOT NULL AS active, p.username FROM pool_worker p LEFT JOIN ".
  "(SELECT count(id) AS id, username FROM shares_history 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 ($resultObj mysql_fetch_object($result)) {
mysql_query("UPDATE pool_worker p SET active=".$resultObj->active." WHERE username='".$resultObj->username."'");
}
} catch (
Exception $e) {}

change required, active(tinyint) added to pool_worker
legendary
Activity: 980
Merit: 1003
I'm not just any shaman, I'm a Sha256man
I've got it to the stage where I can create an account but email validation doesn't work (no email sent).

What are the requirements for email validation to work?

In addition to this, looks like login.php is trying to connect to the mysql database without a username and password - line 41.  There's no connectDb function, unlike in register.php which works fine.  Can you have a look at this?
For a fix until v2 go into login.php and change connecDb() to connecToDb();
legendary
Activity: 980
Merit: 1003
I'm not just any shaman, I'm a Sha256man
Yes for some reason when I tar.ball'd it, I accidentally included the dev files at the time so those features were removed for testing purposes. Passwords are not hashed, in version one, nor was send email valid, theres a couple of other things too. Check out my first post I wrote up a "Bug list in version 1" they are all crossed out becuase that means i fixed them in version 2 which should be released in two or three days. Also I'm sure alot of you though it was annoying to change the $dir folder in every page, so I found a reliable code to auto-magically find it for you so all new installs should only need to change the requiredFunctions.php and that will be it Smiley

On a side note what kind of stats would you like included?
full member
Activity: 434
Merit: 101
I've got it to the stage where I can create an account but email validation doesn't work (no email sent).

What are the requirements for email validation to work?

In addition to this, looks like login.php is trying to connect to the mysql database without a username and password - line 41.  There's no connectDb function, unlike in register.php which works fine.  Can you have a look at this?

I concur I had the same issue, sendmail works so not sure why the validation didnt work.  Also I was unable to create new user or login to exhisting user i was able to get rid of the mysql bad account by changing the default account settings in php.ini but thats didnt fix anythign
sr. member
Activity: 280
Merit: 250
Nom Nom Nom
sr. member
Activity: 406
Merit: 250
sr. member
Activity: 280
Merit: 250
Nom Nom Nom
Another note, this codes stores user passwords in plaintext.  Only your 4 digit pin is hashed.

Code:
//Test registration information
$act = $_POST["act"];
if($act == "attemptRegister"){
//Valid date all fields
$username = $_POST["user"];
$pass = $_POST["pass"];
$rPass = $_POST["pass2"];
$email = $_POST["email"];
$email2 = $_POST["email2"];
$authPin = (int) $_POST["authPin"];

$validRegister = 1;
//.....
//Validate passwords
if($pass != $rPass){
if(strlen($pass) < 5){
$validRegister = 0;
$returnError .= " | Password is too short";
}else{
$validRegister = 0;
$returnError .= " | Passwords do not match";
}
}
//.....
if($validRegister){
//Add user to webUsers
$emailAuthPin = genRandomString(10);
$secret = genRandomString(10);
connectToDb();
mysql_query("INSERT INTO `xenland_pushpool`.`webUsers` (`admin`, `username`, `pass`, `email`, `emailAuthPin`, `secret`, `loggedIp`, `sessionTimeoutStamp`, `accountLocked`, `accountFailedAttempts`, `pin`)
VALUES ('0', '".$username."', [b]'".$pass."[/b]', '".$email."', '".$emailAuthPin."', '".$secret."', '0', '0', '0', '0', '".[b]hash("sha256", $authPin)[/b]."')");
$goodMessage = "Successfully signed up! You must authorize your account by now logging into your email address of ".$email." and clicking the authorize link";
}


Also, this does nothing. $salt isnt called on any of the hash functions.

Code:
//Encrypt settings
$salt = "836483jd7Dg6h5s92k";

member
Activity: 84
Merit: 10
I've got it to the stage where I can create an account but email validation doesn't work (no email sent).

What are the requirements for email validation to work?

In addition to this, looks like login.php is trying to connect to the mysql database without a username and password - line 41.  There's no connectDb function, unlike in register.php which works fine.  Can you have a look at this?
member
Activity: 84
Merit: 10
Nice work mate, been looking for something like this.  Keen to see v2 Smiley
sr. member
Activity: 406
Merit: 250
Something handy I added to my cronjob/user table to cut down on huge sql calls (might save you some time on the stats calc):

Code:
/////////Update share counts
$sql ="select sum(id) as id, a.associatedUserId from ".
  "(select count(s.id) as id, p.associatedUserId from shares s, pool_worker p WHERE p.username=s.username group by p.associatedUserId ".
  "union ".
  "select count(s.id) as id, p.associatedUserId from shares_history s, pool_worker p WHERE p.username=s.username group by p.associatedUserId) a group by associatedUserId";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
mysql_query("UPDATE webUsers SET share_count=".$row["id"]." WHERE id=".$row["associatedUserId"]);
}

$sql ="select sum(id) as id, a.associatedUserId from ".
  "(select count(s.id) as id, p.associatedUserId from shares s, pool_worker p WHERE p.username=s.username AND s.our_result='N' group by p.associatedUserId  ".
  "union ".
  "select count(s.id) as id, p.associatedUserId from shares_history s, pool_worker p WHERE p.username=s.username AND s.our_result='N' group by p.associatedUserId) a group by associatedUserId ";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
mysql_query("UPDATE webUsers SET stale_share_count=".$row["id"]." WHERE id=".$row["associatedUserId"]);
}

$sql ="select sum(id) as id, a.associatedUserId from ".
  "(select count(s.id) as id, p.associatedUserId from shares s, pool_worker p WHERE p.username=s.username AND s.our_result='Y' group by p.associatedUserId  ".
  "union ".
  "select count(s.id) as id, p.associatedUserId from shares_history s, pool_worker p WHERE p.username=s.username AND s.our_result='Y' AND s.counted=0 group by p.associatedUserId) a group by associatedUserId ";
$result = mysql_query($sql);
$totalsharesthisround = 0;
while ($row = mysql_fetch_array($result)) {
mysql_query("UPDATE webUsers SET shares_this_round=".$row["id"]." WHERE id=".$row["associatedUserId"]);
$totalsharesthisround += $row["id"];
}
mysql_query("UPDATE settings SET value='".$totalsharesthisround."' WHERE setting='currentroundshares'");

settings is my own table I use to hold sitewide info: 2 varchar fields
the other 3 fields are int fields I added to webUsers.
The readout is in my loginanduserstats file, I tacked the rest onto the existing universalchecklogin queries
Pages:
Jump to: