Pages:
Author

Topic: Flexible mining proxy - page 11. (Read 88658 times)

full member
Activity: 182
Merit: 107
May 31, 2011, 11:23:35 AM
I've pushed a series of changes that should clear up several issues.  Long-polling should be much more stable now; I've been running my miner all night and have seen plenty of new block notifications in the miner log, and a significant reduction in rejected shares.

To address Deepbit specifically, it has started returning an absolute URL in the X-Long-Polling header, and the proxy did not support this.  Now it does.  Note that Deepbit is currently infinitely redirecting long-polling requests for some reason; I am going to contact Tycho about this and see what's up.  In the meantime, long-polling against Deepbit will not work -- but it will appear to!  The proxy will now sleep for 30 minutes after a failed long-polling request and then pretend that it was a getwork request.  This is because some miners will give up on long-polling altogether if any long-polling request ever fails.  By pretending that the request succeeded, the miner will continue to send long-polling requests, so when long-polling starts working again (or the proxy fails-over to a different pool) the miner will begin benefiting from long-polling again without needing to be restarted.

I believe that some of these problems were the cause of Phoenix hammering Apache with long-polling requests.  Those of you who were having trouble with Phoenix, consider giving the proxy another go with the latest code.

Please thoroughly stress-test the code in the repository and let me know what other issues you find.  Smiley

UPDATE: Tycho fixed long-polling.  The proxy should now work correctly with Deepbit.
full member
Activity: 125
Merit: 100
May 30, 2011, 11:44:55 PM
Exxxcellent.  This will come in handy when I get all of the long-polling implementation bugs worked out.  Thanks!
kjj
legendary
Activity: 1302
Merit: 1026
May 30, 2011, 11:15:21 PM
It'll take some work to adapt to your location.  Oh, and this is not pretty.

First file is a PHP script that runs out of cron every 10 minutes.  Second file is a BASH CGI that lives on another box.  If your flex proxy can see the PDU directly, you can cut out the middle man and either use snmpget() and snmpsend() PHP functions, if you have them, or exec the binaries directly.

My worker IDs are 3 and 4, so I plugged them into ports 3 and 4 on the PDU.  That isn't necessary, unless you are OCD like me.  The arg to the CGI is pasted directly onto the end of the OID passed to SNMP, which in this case is the outlet number on the strip.  Oh, and you should totally add some input checking to the CGI, because as it is now, you are asking to get pwn3d by executing attacker-supplied variables.

Search for __ (double underlines), those are things that you need to change.

Tested and working on a APC 885-1890 (1U, 8 outlet, 15Amp, 120v).  Yours may differ.  Thank god I was able to find the OIDs for SNMP, I wasn't looking forward to writing an expect script to navigate the telnet menu.

Code: (cron_job)
#!/bin/php

$restart_3
=TRUE;
$restart_4=TRUE;

$con=mysql_connect("__HOST__","__USER__","__PASS__");
mysql_select_db("__DATABASE__",$con);

$q="SELECT DISTINCT worker_id FROM work_data WHERE time_requested  > (NOW() - INTERVAL 15 MINUTE)";

$r=mysql_query($q);
if(
0!=mysql_errno())echo mysql_error()."\n";
while(
$row=mysql_fetch_assoc($r)){
 if(
3==$row['worker_id'])$restart_3=FALSE;
 if(
4==$row['worker_id'])$restart_4=FALSE;
// echo $row['worker_id']."\n";
}

if(
$restart_3){
// echo "Restarting 3\n";
 
$junk=file("http://__CGI_HOST__/cgi-bin/apc_restart.cgi?3");
}
if(
$restart_4){
// echo "Restarting 4\n";
 
$junk=file("http://__CGI__HOST__/cgi-bin/apc_restart.cgi?4");
}

?>


Code: (bash_cgi)
#!/bin/bash
echo "Content-type: text/html"
echo ""
echo ""
echo ""
echo "APC restart"
echo ""
snmpset -v1 -c __WRITE_COMMUNITY__ __PDU_IP__ .1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.$QUERY_STRING i 3
echo "
"
snmpget -v1 -c __READ_COMMUNITY__ __PDU_IP__ .1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.$QUERY_STRING
echo "
"
echo ""
echo ""
full member
Activity: 125
Merit: 100
May 30, 2011, 10:57:07 PM
Just finished setting up a cron job to SNMP-diddle an APC networked PDU to reboot my boxes if they ever go more than 15 minutes without a work request.

Nice!  You should open-source that.. I was just pondering making such a thing for my AP9211s Smiley
kjj
legendary
Activity: 1302
Merit: 1026
May 30, 2011, 10:37:13 PM
I custom build PHP and Apache (and openssl, and mod_ssl, and mm, and mysql, and...).  Wrote a script for it many, many years ago.

I did have to add --with-pdo-mysql to the file that stores my PHP config options to get this working.
full member
Activity: 434
Merit: 101
May 30, 2011, 10:32:41 PM
I'm running the proxy on Slackware.  Slackware 10.2, no less.

Works great with BTC Guild, Deepbit, Eligius, a local bitcoind (last resort), and a local pushpool (for testing, that was a much bigger hassle to build on Slack).  Works great with poclbm and phoenix, but tends to cause DiabloMiner to get hung.

Just finished setting up a cron job to SNMP-diddle an APC networked PDU to reboot my boxes if they ever go more than 15 minutes without a work request.


Full install or did you have to build your own php package?  Also is there any special configurations you used?  Im still trying to get my slack to work hahaah
kjj
legendary
Activity: 1302
Merit: 1026
May 30, 2011, 10:29:55 PM
I'm running the proxy on Slackware.  Slackware 10.2, no less.

Works great with BTC Guild, Deepbit, Eligius, a local bitcoind (last resort), and a local pushpool (for testing, that was a much bigger hassle to build on Slack).  Works great with poclbm and phoenix, but tends to cause DiabloMiner to get hung.

Just finished setting up a cron job to SNMP-diddle an APC networked PDU to reboot my boxes if they ever go more than 15 minutes without a work request.
full member
Activity: 434
Merit: 101
May 30, 2011, 09:45:51 PM
I agree, I'd use Slack for everything if I could.  I mentioned JSON because in PHP versions prior to 5.3 you have to install it separately.  I asked cdhowie to mention this somewhere as a dependency, as to cut down on potential support issues, but I guess it's still not in the docs.

All my miners run slack, sdk 2.1, cat 11.4 no problem.  Its just this darn proxy hahaha.  Slack 13.37 ships with 5.3.6 so json should be installed by default and I believe it is as installing it manually created a json error stating that the module was already loaded.  Im wondering if 5.3.6 just doesnt play well with the proxy oh well eventually i imagine ill figure it out.  Suse in runlevel 3 isnt too bad, just not as slick as slack hahaha. 
full member
Activity: 125
Merit: 100
May 30, 2011, 09:32:40 PM
I agree, I'd use Slack for everything if I could.  I mentioned JSON because in PHP versions prior to 5.3 you have to install it separately.  I asked cdhowie to mention this somewhere as a dependency, as to cut down on potential support issues, but I guess it's still not in the docs.
full member
Activity: 434
Merit: 101
May 30, 2011, 09:23:37 PM
Slackware?  Heh I'd hang it up.  I don't even bother trying to run anything meaningful on it (i.e. above basic apache, php and mail).  I love slack, been an avid user since version 3.3 (circa 1996).  But it has very little utility.

I can also confirm that this package, as it sits, is very distribution-specific.  It runs out of the box on Cent 5.6 but is broken on FC14x64, have not had the time to troubleshoot further.  Out of curiosity, have you installed json for php?

I prefer slackware to just about any other distro.   Its fast, simple, efficient, sbopkg has come along way and i build most of my own modules, kernels etc etc.  I wasn't sure if slackware's php package had json rpc built in, so in installed it, no go.  Rebuilt php with json argument, installed pkg(after removing old pkg ofcourse)  still no go.  I don't think its a json issue.  I could be wrong and maybe its  a version issue.  Im just going to keep using it on my suse box as the slackware box seems to have enough to do already
full member
Activity: 125
Merit: 100
May 30, 2011, 09:14:32 PM
Slackware?  Heh I'd hang it up.  I don't even bother trying to run anything meaningful on it (i.e. above basic apache, php and mail).  I love slack, been an avid user since version 3.3 (circa 1996).  But it has very little utility.

I can also confirm that this package, as it sits, is very distribution-specific.  It runs out of the box on Cent 5.6 but is broken on FC14x64, have not had the time to troubleshoot further.  Out of curiosity, have you installed json for php?
full member
Activity: 434
Merit: 101
May 30, 2011, 06:46:59 PM

I'm getting this exact same error.   Ive added slush's pool, deepbit, btcmine, and solo and solo is the only one that works....
Same problem here. On my site it's currently only deepbit with this error.

This seems like its some kind of dependancy.  I reinstalled the database using phpmysql to see if perhaps mysql admin didnt install the scheme properly.  That did not resolve the issue.  So I loaded it on my suse box at another location and it works without a hitch.  It would seem to me there is some dependy that slackware and your distro don't have that are required.  PHP magic quotes is is disabled so I know its not that I also tried to install php 5.2 on my slackware box and that did not resolve the issue either. 
newbie
Activity: 2
Merit: 0
May 30, 2011, 01:34:34 PM

I'm getting this exact same error.   Ive added slush's pool, deepbit, btcmine, and solo and solo is the only one that works....
Same problem here. On my site it's currently only deepbit with this error.
full member
Activity: 434
Merit: 101
May 30, 2011, 07:35:33 AM
I followed the instructions to the T, and yes all 4 pools are enabled. 
hero member
Activity: 588
Merit: 500
May 30, 2011, 07:27:16 AM
Sorry, I meant to say: ENABLE your pools!
full member
Activity: 434
Merit: 101
May 30, 2011, 06:04:55 AM
I can't configure this proxy((
Admin panel works fine, i add pools (deepbit: http://deepbit.net:8332 and btcguild: http://btcguild.com:8332) then created worker (login q password 1) add pool workers credentials for it (email_5 password_of_worker_in_pool for deepbit login_2 password_of_worker_in_pool for btc guild). But when i started miner (i tried poclbm, bitcoin-miner, diablo miner windows with my servers ip as url port 80 login and password from proxy worker) proxy returned
HTTP/1.1 200 OK

Date: Mon, 30 May 2011 07:46:57 GMT

Server: Apache

X-Source-Code: https://github.com/cdhowie/Bitcoin-mining-proxy

Set-Cookie: PHPSESSID=kph1h3dib6nnad4okc3k29kp85; path=/

Expires: Thu, 19 Nov 1981 08:52:00 GMT

Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0

Pragma: no-cache

Content-Length: 85

Content-Type: application/json-rpc



{"error":"No enabled pools responded to the work request.","result":null,"id":"json"}

How can i solve this problem?
 


I'm getting this exact same error.   Ive added slush's pool, deepbit, btcmine, and solo and solo is the only one that works....
hero member
Activity: 588
Merit: 500
May 30, 2011, 05:28:11 AM
Add more pools?
newbie
Activity: 3
Merit: 0
May 30, 2011, 05:04:41 AM
I can't configure this proxy((
Admin panel works fine, i add pools (deepbit: http://deepbit.net:8332 and btcguild: http://btcguild.com:8332) then created worker (login q password 1) add pool workers credentials for it (email_5 password_of_worker_in_pool for deepbit login_2 password_of_worker_in_pool for btc guild). But when i started miner (i tried poclbm, bitcoin-miner, diablo miner windows with my servers ip as url port 80 login and password from proxy worker) proxy returned
HTTP/1.1 200 OK

Date: Mon, 30 May 2011 07:46:57 GMT

Server: Apache

X-Source-Code: https://github.com/cdhowie/Bitcoin-mining-proxy

Set-Cookie: PHPSESSID=kph1h3dib6nnad4okc3k29kp85; path=/

Expires: Thu, 19 Nov 1981 08:52:00 GMT

Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0

Pragma: no-cache

Content-Length: 85

Content-Type: application/json-rpc



{"error":"No enabled pools responded to the work request.","result":null,"id":"json"}

How can i solve this problem?
sr. member
Activity: 291
Merit: 250
May 30, 2011, 03:20:16 AM
#99
Going to look into this one for myself.  I am having a problem mining from work Smiley  I have my own co-located server, but dont want to setup a pool on it.  I might could use this to connect my miners to my co-located server on a port that isnt blocked by our firewall, and then use my co-located server to connect to the pools.
full member
Activity: 434
Merit: 101
May 30, 2011, 01:09:35 AM
#98
I'm sorry but I need to ask a question.  Currently for pools I have deepbit and solo, deepbit has a higher priority but doesnt connect for some reason.  I rebooted, the computer can resolve the dns but none of the miners connect to deepbit just the solo.  Perhaps this has been asked before.  Im wondering if there is some type of cache that needs to be reset or what.  Im using poclbm gui and poclbm on my dedicated miners(slackware)  The admin pages seems to be working fine but its just not kicking over to deepbit.  Thank you in advance and the address i ahve in the pool config is http://pit.deepbit.net:8332
Pages:
Jump to: