Bitcoin Forum
March 29, 2024, 05:54:25 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Poll
Question: Would you use such a mining proxy?  (Voting closed: April 13, 2011, 10:26:05 PM)
Yes, it seems like a good idea. - 7 (63.6%)
Maybe. - 1 (9.1%)
No, I don't like the idea. - 3 (27.3%)
No, I use something similar already. - 0 (0%)
Total Voters: 11

Pages: « 1 2 3 4 5 [6] 7 8 9 10 11 12 13 14 15 16 »  All
  Print  
Author Topic: Flexible mining proxy  (Read 88530 times)
error
Hero Member
*****
Offline Offline

Activity: 588
Merit: 500



View Profile
May 30, 2011, 09:28:11 AM
 #101

Add more pools?

3KzNGwzRZ6SimWuFAgh4TnXzHpruHMZmV8
1711691665
Hero Member
*
Offline Offline

Posts: 1711691665

View Profile Personal Message (Offline)

Ignore
1711691665
Reply with quote  #2

1711691665
Report to moderator
"In a nutshell, the network works like a distributed timestamp server, stamping the first transaction to spend a coin. It takes advantage of the nature of information being easy to spread but hard to stifle." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1711691665
Hero Member
*
Offline Offline

Posts: 1711691665

View Profile Personal Message (Offline)

Ignore
1711691665
Reply with quote  #2

1711691665
Report to moderator
d3c0n808
Full Member
***
Offline Offline

Activity: 434
Merit: 101


View Profile
May 30, 2011, 10:04:55 AM
 #102

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....
error
Hero Member
*****
Offline Offline

Activity: 588
Merit: 500



View Profile
May 30, 2011, 11:27:16 AM
 #103

Sorry, I meant to say: ENABLE your pools!

3KzNGwzRZ6SimWuFAgh4TnXzHpruHMZmV8
d3c0n808
Full Member
***
Offline Offline

Activity: 434
Merit: 101


View Profile
May 30, 2011, 11:35:33 AM
 #104

I followed the instructions to the T, and yes all 4 pools are enabled. 
0xlemming
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
May 30, 2011, 05:34:34 PM
 #105


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.
d3c0n808
Full Member
***
Offline Offline

Activity: 434
Merit: 101


View Profile
May 30, 2011, 10:46:59 PM
 #106


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. 
pwnyboy
Full Member
***
Offline Offline

Activity: 125
Merit: 100


View Profile
May 31, 2011, 01:14:32 AM
 #107

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?
d3c0n808
Full Member
***
Offline Offline

Activity: 434
Merit: 101


View Profile
May 31, 2011, 01:23:37 AM
 #108

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
pwnyboy
Full Member
***
Offline Offline

Activity: 125
Merit: 100


View Profile
May 31, 2011, 01:32:40 AM
 #109

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.
d3c0n808
Full Member
***
Offline Offline

Activity: 434
Merit: 101


View Profile
May 31, 2011, 01:45:51 AM
 #110

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. 
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1024



View Profile
May 31, 2011, 02:29:55 AM
 #111

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.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
d3c0n808
Full Member
***
Offline Offline

Activity: 434
Merit: 101


View Profile
May 31, 2011, 02:32:41 AM
 #112

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
*
Offline Offline

Activity: 1302
Merit: 1024



View Profile
May 31, 2011, 02:37:13 AM
 #113

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.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
pwnyboy
Full Member
***
Offline Offline

Activity: 125
Merit: 100


View Profile
May 31, 2011, 02:57:07 AM
 #114

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
*
Offline Offline

Activity: 1302
Merit: 1024



View Profile
May 31, 2011, 03:15:21 AM
 #115

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
<?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 "<html>"
echo "<head><title>APC restart</title></head>"
echo "<body>"
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 "<br>"
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 "<br>"
echo "</body>"
echo "</html>"

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
pwnyboy
Full Member
***
Offline Offline

Activity: 125
Merit: 100


View Profile
May 31, 2011, 03:44:55 AM
 #116

Exxxcellent.  This will come in handy when I get all of the long-polling implementation bugs worked out.  Thanks!
cdhowie (OP)
Full Member
***
Offline Offline

Activity: 182
Merit: 107



View Profile WWW
May 31, 2011, 03:23:35 PM
Last edit: May 31, 2011, 03:46:17 PM by cdhowie
 #117

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.

Tips are always welcome and can be sent to 1CZ8QgBWZSV3nLLqRk2BD3B4qDbpWAEDCZ

Thanks to ye, we have the final piece.

PGP key fingerprint: 2B7A B280 8B12 21CC 260A  DF65 6FCE 505A CF83 38F5

SerajewelKS @ #bitcoin-otc
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1024



View Profile
May 31, 2011, 03:31:20 PM
 #118

Any idea why my one Diablo miner occasionally goes idle when using the proxy?  Seems to happen at random, sometimes a few minutes, sometimes many hours.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
twmz
Hero Member
*****
Offline Offline

Activity: 737
Merit: 500



View Profile
May 31, 2011, 05:19:36 PM
 #119

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.

There was also a bug in Phoenix with LP urls that used query strings. Not sure if that may also make a difference.

http://forum.bitcoin.org/index.php?topic=6458.msg152263#msg152263


Was I helpful?  1TwmzX1wBxNF2qtAJRhdKmi2WyLZ5VHRs
WoT, GPG

Bitrated user: ewal.
cdhowie (OP)
Full Member
***
Offline Offline

Activity: 182
Merit: 107



View Profile WWW
May 31, 2011, 06:11:15 PM
 #120

There was also a bug in Phoenix with LP urls that used query strings. Not sure if that may also make a difference.

http://forum.bitcoin.org/index.php?topic=6458.msg152263#msg152263
Good catch.  Yeah, that would cause problems.  I might work around this by using PATH_INFO to convey the required data.

Tips are always welcome and can be sent to 1CZ8QgBWZSV3nLLqRk2BD3B4qDbpWAEDCZ

Thanks to ye, we have the final piece.

PGP key fingerprint: 2B7A B280 8B12 21CC 260A  DF65 6FCE 505A CF83 38F5

SerajewelKS @ #bitcoin-otc
Pages: « 1 2 3 4 5 [6] 7 8 9 10 11 12 13 14 15 16 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!