Author

Topic: Looking for a php developer to help with a error in an altcoin faucet. (Read 650 times)

member
Activity: 84
Merit: 10
memento audere semper
Taking a look at json rpc client.php, it seems that you must pass an array as param along with the rpc call. Hence try to do something like:

$this->rpc("getbalance", array())


Also, as stated above, that If statement is not a nice way to perform a check. Think to change it
newbie
Activity: 22
Merit: 0
Hello,

I've just installed that script yesterday to test it and I can assure you that is working.

Maybe you can debug the connectiong making a print_R() in one of the queries on simple_faucet.php
sr. member
Activity: 266
Merit: 250
Infected Mushroom
Sorry had to go out earlier.

Quote
Line 82: simple_faucet.php: if (!mysqli_connect_error() && !is_null($this->balance = $this->rpc("getbalance")))

Else

Quote
Line 190: simple_faucet.php: $this->status = SF_STATUS_MYSQL_CONNECTION_FAILED;

So it basically checks your db settings and rpc getbalance, if one is wrong then return SF_STATUS_MYSQL_CONNECTION_FAILED

That isnt such a 'nice' way to do it.

Hmm, I guess I missed that part. Assuming it connects to the DB, I am pretty sure about my rpc config too since we run a profit calculator from that wallet too. Any possibility that the code is outdated to work on newer updates of qts, etc?
newbie
Activity: 14
Merit: 0
Sorry had to go out earlier.

Quote
Line 82: simple_faucet.php: if (!mysqli_connect_error() && !is_null($this->balance = $this->rpc("getbalance")))

Else

Quote
Line 190: simple_faucet.php: $this->status = SF_STATUS_MYSQL_CONNECTION_FAILED;

So it basically checks your db settings and rpc getbalance, if one is wrong then return SF_STATUS_MYSQL_CONNECTION_FAILED

That isnt such a 'nice' way to do it.
sr. member
Activity: 266
Merit: 250
Infected Mushroom
It seems the RPC settings are wrong. Both mysql and rpc check are in same IF statement and return same mysql error. Makes sense its slower w real DB info cuz only then it tries to connect to wallet.

Can also debug "getbalance" RPC command further in simplefaucet file. On phone so cannot say exact lines.

Thanks for your answer man.

I also believed to be an RPC error. However the coin I intend to use, uses bitcoind rpc so I thought it wouldn't be problem. On the other hand, I am %100 sure the RPC settings I entered are true.
I wanted to see if the DB connection is the problem. So I removed

Code:
case SF_STATUS_MYSQL_CONNECTION_FAILED:

And boom! The error dissappeared. Since in the template file there are 2 separete IFs for both error, as in:

Code:
   	break;
            case 
SF_STATUS_RPC_CONNECTION_FAILED:
            case 
SF_STATUS_MYSQL_CONNECTION_FAILED:
?>

   

       

           

Status


       

       

            Cannot seem to connect at the moment, please come back later!
       

   

I thought removing 1 would show me where the problem is. So I tried removing:

Code:
            case SF_STATUS_RPC_CONNECTION_FAILED:

And I still had the error message. So it really seems like a database connection error despite all the settings are true and despite I created a simple php to call the database and it worked.

I'd assume something doesn't work with my mySQLi version?


Man i hope you will resolve this.
Free altcoin faucet script sounds wonderfull. If it will work, i will probably make one too.

I'll make sure to share it If I come up with a solution indeed. Smiley
legendary
Activity: 1876
Merit: 1295
DiceSites.com owner
It seems the RPC settings are wrong. Both mysql and rpc check are in same IF statement and return same mysql error. Makes sense its slower w real DB info cuz only then it tries to connect to wallet.

Can also debug "getbalance" RPC command further in simplefaucet file. On phone so cannot say exact lines.
sr. member
Activity: 322
Merit: 250
Real power doesnt hit hard,but right to the target
Man i hope you will resolve this.
Free altcoin faucet script sounds wonderfull. If it will work, i will probably make one too.
sr. member
Activity: 266
Merit: 250
Infected Mushroom
So I created a simple php calling the same database and there were no connection errors.
I changed the database config to false dbname etc. The site renewed in 2 secs, when the credentials were true, it took like 15 seconds to load. So I am guessing it tries to connect to database but something prevents it.

sr. member
Activity: 266
Merit: 250
Infected Mushroom
Have you created the db? Edited the settings in config.php to match? imported faucet.sql?

Yeah, everything looks fine. I triple checked, even created 2 more users with same previleges.

I am guessing it's not because of the cron job I failed to create.

I haven't edited simple_facuet.php located at /lib. I don't know if I have to since there is no indication for it at Install steps.
newbie
Activity: 14
Merit: 0
Have you created the db? Edited the settings in config.php to match? imported faucet.sql?
sr. member
Activity: 266
Merit: 250
Infected Mushroom
Hey there, I was trying to setup a faucet for an altcoin. I tried using https://github.com/ChristianGrieger/Cryptocurrency-faucet-script

I setup a deamon on a VPS and put the correct settings in the config file. However I am getting this error in the page:

Code:
Cannot seem to connect at the moment, please come back later!

This code in the template section, like this:

Code:
    	break;
            case 
SF_STATUS_RPC_CONNECTION_FAILED:
            case 
SF_STATUS_MYSQL_CONNECTION_FAILED:
?>

    

        

            

Status


        

        

            Cannot seem to connect at the moment, please come back later!
        

    

I tried removing

Code:
case SF_STATUS_MYSQL_CONNECTION_FAILED:

to see if it was a database error and bum, the error code dissappeared. So it seems like my rpc settings are alright and it connects to my wallet, however, even though I am %100 sure every database config is true, it somehow fails to connect to my database. Perhaps this is because the mysql or even php version.

If you are able to solve this problem / error please whisper me with an reasonable offer. The aim of the faucet is not to get profits from adds as you will see I put none on the interface.

Thanks.
Jump to: