Bitcoin Forum
April 25, 2024, 12:44:38 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 ... 205 »
  Print  
Author Topic: bitHopper: Python Pool Hopper Proxy  (Read 355548 times)
c00w (OP)
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
July 07, 2011, 08:22:04 PM
Last edit: September 14, 2011, 03:19:29 AM by c00w
 #1

Bithopper is a Bitcoin Pool Hopper Proxy which supports ~30 pools at last count.
Its still in beta but works pretty well.

https://github.com/c00w/bitHopper

Instructions:

1) Download the project

<-------IMPORTANT---------->
2) Move user.cfg.default to user.cfg and modify it to use your accounts instead of mine for mining.
<-------IMPORTANT---------->

3) Install greenlet. Links and instructions are in the README
4) Then run bitHopper.py
5) Direct your miner to localhost:8337
6) Tell me if anything breaks at https://github.com/c00w/bitHopper/issues
6a) Or use the forums.
7) Look at stats and control pool at localhost:8337/stats

Current Features:
* Pool Hopping
* LP based Pool Hopping
* LP (Client and Server)
* Low Reject Rate
* Web based Statistics and Control
* Individual Miner Stats. Based on username
* RollNtime and NonceRange support
* Plugin API
* Scalability. Should scale to 10GH/s and beyond nicely.

Planned features:
Cleared issue list on github.
Stable Release
Integrated Miner

Think this is cool? Want me to hurry up and add more features?:
1HEmzeuVEKxBQkEenysV1yM8oAddQ4o2TX

1HEmzeuVEKxBQkEenysV1yM8oAddQ4o2TX
1714005878
Hero Member
*
Offline Offline

Posts: 1714005878

View Profile Personal Message (Offline)

Ignore
1714005878
Reply with quote  #2

1714005878
Report to moderator
Activity + Trust + Earned Merit == The Most Recognized Users on Bitcointalk
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
burp
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
July 07, 2011, 08:41:24 PM
Last edit: July 07, 2011, 09:06:34 PM by burp
 #2

Nice, finally some alternative to multipool for local proxy use. Looking forward for the further development Cheesy

Is this working yet? I'm getting just rejects.
burp
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
July 07, 2011, 09:09:52 PM
 #3

+1 for somebody to port this to windows...

What part exactly is there to "port"? I see no reason why it shouldn't work for windows.
c00w (OP)
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
July 07, 2011, 09:24:49 PM
Last edit: July 09, 2011, 10:46:05 AM by c00w
 #4

1)What platforms does this work on?
It should work on windows if you have python and twisted. The reason I posted it is so that people can test it out and tell me what breaks.

1HEmzeuVEKxBQkEenysV1yM8oAddQ4o2TX
burp
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
July 07, 2011, 09:30:23 PM
 #5

Data sent:[]
Pulled From eligius, Current shares 640841.478408
Data sent:[u'000000011f8c4bc098527d9df28578dcb367bbd2d5698ea0f339d0f20000080b00000000de58a9c 66f047c2d3353e9438a145f441031f7dd21a95a332c531d9129bfeb9f4e1624241a0abbcf37be74 2700000080000000000000000000000000000000000000000000000000000000000000000000000 0000000000080020000']

[Errno 111] Connection refused
[Errno 111] Connection refused
[Errno 111] Connection refused
[Errno 111] Connection refused
[Errno 111] Connection refused
[Errno 111] Connection refused
[Errno 111] Connection refused
[Errno 4] Interrupted system call

… then it's stuck in such a "Connection refused" loop and I have to SIGKILL it, because it seems to intercept SIGTERM.
c00w (OP)
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
July 07, 2011, 09:35:14 PM
 #6

Data sent:[]
Pulled From eligius, Current shares 640841.478408
Data sent:[u'000000011f8c4bc098527d9df28578dcb367bbd2d5698ea0f339d0f20000080b00000000de58a9c 66f047c2d3353e9438a145f441031f7dd21a95a332c531d9129bfeb9f4e1624241a0abbcf37be74 2700000080000000000000000000000000000000000000000000000000000000000000000000000 0000000000080020000']

[Errno 111] Connection refused
[Errno 111] Connection refused
[Errno 111] Connection refused
[Errno 111] Connection refused
[Errno 111] Connection refused
[Errno 111] Connection refused
[Errno 111] Connection refused
[Errno 4] Interrupted system call

… then it's stuck in such a "Connection refused" loop and I have to SIGKILL it, because it seems to intercept SIGTERM.

I think I fixed the problem. And I rewrote my code to let you use SIGTERM.

Does it work with the latest revision?

1HEmzeuVEKxBQkEenysV1yM8oAddQ4o2TX
burp
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
July 07, 2011, 09:39:37 PM
 #7

Yep, works now Smiley
c00w (OP)
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
July 07, 2011, 09:42:19 PM
Last edit: July 07, 2011, 09:54:53 PM by c00w
 #8

Sweet. I found another error with submitting good work but I think I fixed it. I'm running my card with it but its only 180 MH/S so it might not catch all the errors.

1HEmzeuVEKxBQkEenysV1yM8oAddQ4o2TX
hawks5999
Full Member
***
Offline Offline

Activity: 168
Merit: 100



View Profile WWW
July 07, 2011, 10:38:59 PM
 #9

Sweet. I found another error with submitting good work but I think I fixed it. I'm running my card with it but its only 180 MH/S so it might not catch all the errors.

subscribing.

■ ▄▄▄
■ ███
■ ■  ■               
LEDGER  WALLET    ████
■■■ ORDER NOW! ■■■
              LEDGER WALLET
Smartcard security for your BTCitcoins
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
Decentralized. Open. Secure.
Clipse
Hero Member
*****
Offline Offline

Activity: 504
Merit: 502


View Profile
July 08, 2011, 01:01:49 AM
 #10

You should mention that users should enter their own details in the py code, since its all filled with your own pool account details.

Just in case users dont know it, they will just end up mining for you.

...In the land of the stale, the man with one share is king... >> Clipse

We pay miners at 130% PPS | Signup here : Bonus PPS Pool (Please read OP to understand the current process)
c00w (OP)
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
July 08, 2011, 01:19:49 AM
 #11

Its in both the readme and the initial instructions in the post. I modified it to make it more obvious though.

1HEmzeuVEKxBQkEenysV1yM8oAddQ4o2TX
Sukrim
Legendary
*
Offline Offline

Activity: 2618
Merit: 1006


View Profile
July 08, 2011, 02:30:03 AM
 #12

i do see a problem
Quote
Creative Commons Attribution-NonCommercial-ShareAlike 3.0
 Sad
Where exactly is the problem there? Wanna use it commercially? (Btw. isn't generating "money" commercial per se?!)

Thanks a lot for the program btw.!

Edit:
I think the *.pyc files are not really needed in the repository, hm?

https://www.coinlend.org <-- automated lending at various exchanges.
https://www.bitfinex.com <-- Trade BTC for other currencies and vice versa.
organofcorti
Donator
Legendary
*
Offline Offline

Activity: 2058
Merit: 1007


Poor impulse control.


View Profile WWW
July 08, 2011, 02:38:15 AM
 #13

i do see a problem
Quote
Creative Commons Attribution-NonCommercial-ShareAlike 3.0
  Sad

c00w prolly just doesn't want someone else to take some of the code and sell it as another proxy.

Bitcoin network and pool analysis 12QxPHEuxDrs7mCyGSx1iVSozTwtquDB3r
follow @oocBlog for new post notifications
organofcorti
Donator
Legendary
*
Offline Offline

Activity: 2058
Merit: 1007


Poor impulse control.


View Profile WWW
July 08, 2011, 02:57:25 AM
 #14

I had a very quick look through and have a couple of questions:

1. I can't see how you got difficulty - is it entered manually or is it a wget from http://blockexplorer.com/q/getdifficulty ?
2. I can see you're getting user api data - are you providing an efficiency output? This is something I loved about Multipool - It's much harder to see that you're getting good efficiency otherwise. Easy enough: shares/difficulty*blockvalue.
3. Why 'shares':difficulty*.41 (line 33) for eligius?
4. Can you give simple-ish instructions on adding other pools ourselves?

Looks great - simple enough for me to (mostly) understand! Can't wait to give it a try tonight.


Bitcoin network and pool analysis 12QxPHEuxDrs7mCyGSx1iVSozTwtquDB3r
follow @oocBlog for new post notifications
c00w (OP)
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
July 08, 2011, 03:13:08 AM
 #15

Answers

1. I can't see how you got difficulty - is it entered manually or is it a wget from http://blockexplorer.com/q/getdifficulty ?

Right now its entered manually. Thats a good idea though

2. I can see you're getting user api data - are you providing an efficiency output? This is something I loved about Multipool - It's much harder to see that you're getting good efficiency otherwise. Easy enough: shares/difficulty*blockvalue.

Hmm. I was scraping the user data in order to get server data. I could probably whip up a crude API quickly. My priority right now is wrestling LP support into place.

3. Why 'shares':difficulty*.41 (line 33) for eligius?

Eligius has switched to a shared max pps. This makes it a bad pool for pool hopping but a good pool to mine when we can't find anything better. The difficulty*.41 is there so that it will check the other pools instead of assuming eligius is the best pool. Its a hack that will be removed when I clean up my code.

4. Can you give simple-ish instructions on adding other pools ourselves?

Sure. I'll add it to the readme at some point but its pretty simple: Copy the structure in the servers dictionary for your new pool.
Create a function to call a getPage from your info source.
Set its deferred to a function which parses your info source and sets server['server_name']['shares'] to the current shares.

Add the getpage calling function function to update_servers.

After writing that I realize its not that simple. I'm planning on spinning out some parsing functions with regex into some sort of file structure.

If you have a pool in mind and have the function written for extracting shares or api details, just post it and i can integrate it in if it is annoying.

Issues with the license:
I'll probably relicense it under a GPLV2 at some point. Its mainly so no one steals the script and resells it or trojans it without me being able to have a solid legal complaint.

1HEmzeuVEKxBQkEenysV1yM8oAddQ4o2TX
c00w (OP)
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
July 08, 2011, 03:16:59 AM
 #16


I think the *.pyc files are not really needed in the repository, hm?

You mean in jsonrpc? Yeah. I didn't notice them. I'll delete them once I get my code rewritten and LP support added.

1HEmzeuVEKxBQkEenysV1yM8oAddQ4o2TX
organofcorti
Donator
Legendary
*
Offline Offline

Activity: 2058
Merit: 1007


Poor impulse control.


View Profile WWW
July 08, 2011, 04:38:47 AM
Last edit: July 08, 2011, 05:49:21 AM by organofcorti
 #17

Thanks for the response! I understand this is still a work in progress, I wasn't hassling or anything.

re point 2, if you have the time and inclination to rustle up something at some point I think it would be a big point in the proxy's favour. People like to see how much ahead they are! But I just like chart porn. But you're right of course, LP is just a tad more important

I'd figured that the diff*.41 was something to do with when the proxy decides on which pool to look at next - delaying until all pools are more than 41% of expected shares for a block?

As for point 4 I followed along right up until my heart sunk at the evil word "regex". Sigh. Now I really will have to relearn regexpr. Stupid random symbols and letters  Angry I might just wait until you've had time to add it in.

Cheers!

(edited)

Bitcoin network and pool analysis 12QxPHEuxDrs7mCyGSx1iVSozTwtquDB3r
follow @oocBlog for new post notifications
c00w (OP)
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
July 08, 2011, 05:06:01 AM
 #18

Well I could just have it dynamically import python modules. Should be pretty easy.

1HEmzeuVEKxBQkEenysV1yM8oAddQ4o2TX
burp
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
July 08, 2011, 07:51:44 AM
 #19

I added support for mineco and bitclockers. I like how simple your program is, please don't overcomplicate things by unnecessary generalizations or such a regex-config. Writing a small sharesResponse function is much more flexible. One problem I can see is that shares get submitted to the wrong pool if the best pool changes while the miner has still data for the old pool. These few shares should be negligable though. If you add long-polling support you could make such a "new block" event when the best pool changes so that the miner flushes the work queue.

Code:
+        'mineco':{'time': time.time(), 'shares': 0, 'name': 'mineco.in',
+            'mine_address': 'mineco.in:3000', 'user': mineco_user,
+            'pass': mineco_pass, 'lag': False, 'LP': None},
+        'bitclockers':{'time': time.time(), 'shares': 0, 'name': 'bitclockers.com',
+            'mine_address': 'pool.bitclockers.com:8332', 'user': bitclockers_user,
+            'pass': bitclockers_pass, 'lag': False, 'LP': None}
         }
 current_server = None

@@ -86,16 +96,40 @@ def mtred_sharesResponse(response):
     print 'mtred :' + str(round_shares)
     server_update()

+def mineco_sharesResponse(response):
+    global servers
+    info = json.loads(response)
+    round_shares = int(info['shares_this_round'])
+    servers['mineco']['shares'] = round_shares
+    print 'mineco :' + str(round_shares)
+    server_update()
+
+def bitclockers_sharesResponse(response):
+    global servers
+    info = json.loads(response)
+    round_shares = int(info['roundshares'])
+    servers['bitclockers']['shares'] = round_shares
+    print 'bitclockers :' + str(round_shares)
+    server_update()
+
 def bclc_getshares():
     getPage('https://www.bitcoins.lc/stats.json').addCallback(bclc_sharesResponse)

 def mtred_getshares():
     getPage('https://mtred.com/api/user/key/d91c52cfe1609f161f28a1268a2915b8').addCallback( mtred_sharesResponse )

+def mineco_getshares():
+    getPage('https://mineco.in/stats.json').addCallback(mineco_sharesResponse)
+
+def bitclockers_getshares():
+    getPage('https://bitclockers.com/api').addCallback(bitclockers_sharesResponse)
+
 def update_servers():
     global servers
     bclc_getshares()
     mtred_getshares()
+    mineco_getshares()
+    bitclockers_getshares()

organofcorti
Donator
Legendary
*
Offline Offline

Activity: 2058
Merit: 1007


Poor impulse control.


View Profile WWW
July 08, 2011, 09:11:21 AM
 #20

thx burp Smiley

Bitcoin network and pool analysis 12QxPHEuxDrs7mCyGSx1iVSozTwtquDB3r
follow @oocBlog for new post notifications
Pages: [1] 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 ... 205 »
  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!