GithubHelp home page GithubHelp logo

cdhowie / bitcoin-mining-proxy Goto Github PK

View Code? Open in Web Editor NEW
126.0 126.0 74.0 471 KB

Multi-pool, multi-worker proxy for Bitcoin miners, supporting long polling and pool failover

License: GNU Affero General Public License v3.0

PHP 100.00%

bitcoin-mining-proxy's People

Contributors

cdecker avatar cdhowie avatar icy2k avatar kripz avatar pharaon avatar wyze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bitcoin-mining-proxy's Issues

use mining-proxy

Hello,

Can we still use scrypt?
How to set it up is how to connect our worker SVP

with cgminer

A big thank-you

separate interval settings for submitted share alert, hashing speed and stale rate

for the stale rate, won't it make more sense if it is daily or even lifetime instead of default interval 1h?
but for submitted share alert, i would probably like 5min. to check whether one card is down.
for hashing speed, 15min will be fine.

so I recommend separate interval settings for submitted share alert, hashing speed and stale rate.

Implement back-off when a pool fails

(Source forum post)

When a pool fails to respond to a request or returns an error, the software should only try again on the next few requests and then back off for a minute or two to improve efficiency of the miner as well as give the pool some breathing room.

Balance Stats API

Many pools provide an API to view the balance of your account. Perhaps this can be integrated so you can view the balance of all of your pools from the pool overview page.

Unhandled error on getwork

I've managed to install and configure the proxy (adding pools, workers, and adding workers to pools), but when I point a miner to it, it seems that only the authentication happens. Here's what phoenix spits out:

[14/06/2011 21:13:34] Phoenix 1.48 starting...
[14/06/2011 21:13:34] Connected to server
[0 Khash/sec] [0 Accepted] [0 Rejected] [RPC]Unhandled Error
Traceback (most recent call last):
  File "phoenix.py", line 125, in <module>

  File "twisted\internet\base.pyc", line 1162, in run

  File "twisted\internet\base.pyc", line 1171, in mainLoop

--- <exception caught here> ---
  File "twisted\internet\base.pyc", line 793, in runUntilCurrent

  File "minerutil\RPCProtocol.pyc", line 127, in callback

  File "minerutil\RPCProtocol.pyc", line 319, in handleWork

exceptions.TypeError: argument of type 'NoneType' is not iterable

Phoenix r101 does not give any error messages, but stays at 0Mhash/s
I've also tried using bitcoin getwork, to which I get error: no response from server. I'm not sure if this should work, however

The proxy is on PHP 5.3.6-pl0-gentoo (fpm-fcgi) on Cherokee 1.2.2

Worker status doesn't seem to be working any more

My miners are doing 418Mhash/sec, yet on the dashboard, it says 1 miner is up doing 1.93MHash. While it reports the other 7 as down completely. I've been running the proxy for about 4 hours now.

My setup is Phoenix 1.7.4 -> bitcoin mining proxy -> merged mining proxy -> bitcoin/namecoin/ixcoin/i0coin daemons

Really like the look of this proxy, hope we can fix this one :D

Long-polling causes LigHTTPd/FastCGI to stop responding

I'm still tracking down the exact cause, but if long-polling is enabled and you serve the proxy with LigHTTPd, it will quit responding to requests as the PHP FastCGI process hangs indefinitely.

Increasing the "max-procs" directive will delay this but it eventually happens in every configuration I've tried.

If you want more details, let me know, otherwise I'll keep pursuing this on my own and see if I can find a way to fix it.

Allow disabling of long polling by miner or pool

There are some clients which don't support long polling using params (phoenix is one), and end up hammering the webserver over and over.

Also long polling uses up a php process indefinitely. I have had a situation where a client keeps hitting that URL every 5 seconds (because its having some sort of issues), causing all of the backend PHP processes to be used up.

Until this is a little more stable, I've manually edited the code to not use long polling at all.

View / Edit Workers from Pool Page

Right now you can edit the pools assigned to a worker, through the worker. This would allow the ability to add/edit/view workers from the reverse side. You choose the pool, and then add workers into it, etc.

login unsuccessful

When opening the page on /admin a login screen is presented.

After typing the username and password like defined in config.inc.php I get redirected to the same login screen.
I can do this a infinity time without ever getting into the site.

When removing
auth_fail(); from function do_admin_auth()
the site works without any problems.

Attempting to edit a pool results in "Pool not found."

Attempting to edit a pool in the latest git commit ( 81b3ce1 ) results in the error "Pool not found."

This seems to be because of a missing GROUP BY clause in the SQL query starting on line 96 in pool.inc.php, which throws a MySQL error. Adding GROUP BY wp.worker_id after the WHERE clause appears to fix this.

Apache Error

[warn] Server ran out of threads to serve requests. Consider raising the ThreadsPerChild setting

No error appears, all my miners quit connecting, so I checked the apache logs and that appeared. Any idea?

Submission Caching

Some pools take longer than 2 seconds to respond to submission requests (depending on load, ddos, etc...). This isn't a problem during a getwork request (just hop to the second pool in line), but it has been causing a high number of "rejects" for me.

I propose implementing a submission caching system. The proxy caches the submission allowing the worker to immediately request a new piece of work. The proxy then tries to send the solved work X times with Y timeout (say, X=10, Y=20). Of course, this will invalidate the statistics reported on each individual miner for accepts/rejects.

Another option would be to simply increase the timeout on work submission.

C# getwork/LP backend

I would like to implement a C# service that can replace/supplement the PHP getwork/LP backend to more efficiently handle requests, keep queues of work around, and provide better failover decisions. The current "execute code upon request" model is a bit limiting, so allowing a long-running service to decide how to failover and how/when to appropriately respond to miner LP requests (as well as to handle the pool LP requests) would be extremely beneficial to performance and maintainability of the proxy.

UFAsoft miner share submissions failing

It would seem that the ufasoft miner is failing to communicate with the proxy correctly. It receives work from the proxy, but when it submits completed work, it never is actually processed, or passed through to the pool by the proxy. I have tried monitoring packets to see what is different about how ufa communicated vs puddinpop rpc, but apparently this is above my pay grade to figure out and contribute a solution.

Malformed long-polling request URL

I am getting an error message that says:

Malformed long-polling request URL

Sorry if the answer is already buried in here someplace, I cannot find it.

Everything appears to be set up correctly - Pools added and active, workers added and active. Dashboard and SQL server appear to be working, but thats as far as it goes. I've tried different pools, and have had no luck. Could somebody help me out, or point me in the right direction ?

EDIT

I switched hosting providers to see if it was my server now I'm getting:

"Sorry, I don't understand what you just said."
When connecting with a miner it just sits there on 0Mh

I'm using PHP 5.3 / Apache 2.2 / MySQL 5.1

magic_quotes_gpc is OFF (confirmed)

Add support for proxy

Hi,

is it possible to add support for a proxy?
I'm behind a squid proxy and I cannot access internet directly: I'm not a PHP expert but it looks like you need to change function place_json_call() in common.inc.php.

Thanks
Bye
Piero

Outstanding long polling requests need to be aborted when the pool/assignment is disabled

If the pool or pool-worker assignment corresponding to an outstanding long polling request is disabled, the long polling request does not abort. This has three implications:

  • The worker will likely not make a new long polling request after the next getwork and the worker will therefore not receive long polling notifications from the new active pool. (If the new active pool does not support long polling requests, this is not an issue.)
  • When the outstanding long polling request completes, the worker will begin working on that work, which will be form a disabled pool. Submitted shares will still be routed to the pool, but the worker shouldn't be working for a disabled pool.
  • If the worker gets the URI for the next long polling request from the response for the first long polling request, the worker will continue to poll the wrong pool indefinitely.

Bitp.it Pool Not Working

Not sure what the issue here is, if someone can point me in the direction to debug this I'll happily do it. The pool works fine with a direct connection from phoenix, but doesn't get used at all via proxy.

I've double checked pool info in the proxy DB and it is correct. Perhaps related to the multipool issue?

hashkill and DiabloMiner stops submitting shares

90% shares arent being submitted?

Linux:
[24/06/11 8:49:58 PM] DEBUG: Attempt 77 found on Cypress (#3)
[24/06/11 8:50:02 PM] DEBUG: Attempt 78 found on Cypress (#2)
[24/06/11 8:50:07 PM] DEBUG: Attempt 79 found on Cypress (#2)
[24/06/11 8:50:12 PM] DEBUG: Attempt 80 found on Cypress (#3)
[24/06/11 8:50:13 PM] DEBUG: Attempt 81 found on Cypress (#2)
[24/06/11 8:50:14 PM] DEBUG: Attempt 82 found on Cypress (#3)
[24/06/11 8:50:15 PM] DEBUG: Attempt 83 found on Cypress (#2)
[24/06/11 8:50:18 PM] DEBUG: Attempt 84 found on Cypress (#3)
[24/06/11 8:50:21 PM] DEBUG: Attempt 85 found on Cypress (#1)
[24/06/11 8:50:23 PM] DEBUG: Attempt 86 found on Cypress (#2)
[24/06/11 8:50:33 PM] DEBUG: Attempt 87 found on Cypress (#2)

Windows machine:
[24/06/11 8:56:17 PM] DEBUG: Attempt 3 found on Cayman (#2)
[24/06/11 8:56:18 PM] DEBUG: Attempt 4 found on Cayman (#2)
[24/06/11 8:56:20 PM] DEBUG: Attempt 5 found on Cayman (#2)
[24/06/11 8:56:26 PM] DEBUG: Forcing getwork update due to nonce saturation
[24/06/11 8:56:31 PM] DEBUG: Forcing getwork update due to nonce saturation
[24/06/11 8:56:32 PM] DEBUG: Attempt 6 found on Cayman (#2)
[24/06/11 8:56:32 PM] DEBUG: Attempt 7 found on Cayman (#2)
[24/06/11 8:56:34 PM] DEBUG: Attempt 8 found on Cayman (#2)
[24/06/11 8:56:38 PM] DEBUG: Attempt 9 found on Cayman (#2)
mhash 364.5/362.8 | a/r/hwe: 0/1/0 | ghash: 30.1 | fps: 30.4

Nothing is being submitted?

Phoenix works 100%.

[26/06/2011 20:44:55] Server gave new work; passing to WorkQueue
[26/06/2011 20:44:58] Result 00000000b278dc5f... accepted
[26/06/2011 20:45:06] Result 0000000040786380... rejected
[26/06/2011 20:45:06] Result 00000000554f353d... accepted
[26/06/2011 20:45:08] Result 000000002c8473cf... accepted
[26/06/2011 20:45:08] Server gave new work; passing to WorkQueue
[26/06/2011 20:45:11] Result 00000000d9981a03... accepted
[26/06/2011 20:45:12] Result 00000000e022cef0... rejected
[26/06/2011 20:45:26] Result 000000001c40b050... accepted
[26/06/2011 20:45:32] Warning: work queue empty, miner is idle
[26/06/2011 20:45:33] Server gave new work; passing to WorkQueue
[26/06/2011 20:45:35] Server gave new work; passing to WorkQueue
[26/06/2011 20:45:47] Server gave new work; passing to WorkQueue
[26/06/2011 20:46:00] Server gave new work; passing to WorkQueue
[26/06/2011 20:46:06] Result 00000000516f1f92... accepted
[26/06/2011 20:46:13] Server gave new work; passing to WorkQueue
[26/06/2011 20:46:25] Server gave new work; passing to WorkQueue
[26/06/2011 20:46:38] Server gave new work; passing to WorkQueue
[26/06/2011 20:46:41] Result 000000006bb4311a... accepted
[26/06/2011 20:46:45] Result 00000000c2c76ecf... accepted
[337.08 Mhash/sec] [1540 Accepted] [76 Rejected] [RPC (+LP)]

From the creator of DiabloMiner:
"The proxy probably does not correctly support things DiabloMiner does, such as time incrementing and returning multiple nonces for the same getwork over short periods. It looks like the sendwork thread is being choked by the proxy.

So, clearly, its a proxy bug."

'SQLSTATE[HY000] [1040] Too many connections'

After few hours, I cannot connect to the proxy, in apache error_log, I see the following message :

[Thu Jul 28 20:17:37 2011] [error] [client 192.168.0.XXX] PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [1040] Too many connections' in common.inc.php:33\nStack trace:\n#0 common.inc.php(33): PDO->__construct('mysql:host=loca...', 'bitcoin_proxy', '741369')\n#1 index.php(31): db_connect()\n#2 {main}\n thrown in common.inc.php on line 33

feature request:bulk pool priority change option

We most likely have a preferences over pools/servers over all our workers. Changing the priority on each individual worker is just tiresome. Wouldn't it be better to have a bulk pool priority change option for all workers?

Connecting to proxy with miners

Hey boss! :)
How can i connect to the proxy for example with guiminer?
Host: Webserver IP, port 80? username/pw ok

I tried several programs, but the answer: Server not found, or Nothing to read from server after xtime sleeping 1 seconds inbetween

I have forwarded 80, 443, 3333, 3433, 8888 ports

Adresses in database:
name: Zpool
stratum+tcp://scrypt.eu.mine.zpool.ca:3433

name: LTCPOOL
url: tcp://litecoinpool.org:3333

(Problem is: miner connecting to web, but it doesn't go any further) please help.

Thx, and have a nice day! :) +coffee

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.