Author

Topic: blkmond lite (Read 6522 times)

full member
Activity: 175
Merit: 102
July 18, 2011, 09:28:12 AM
#15
Isn't that kind of risky for a production server anyways?
Yeah, but without people who take that risk, we could never have confidence in the code we are releasing. It's thanks to the folks who first ran my code on live servers that the code is reasonably stable today. So thank him for taking that risk so that you don't have to. (Assuming he's watching it closely. Otherwise, he's just being stupid.)

For the moment, the only one taking the risk is me and a couple of others.  And yes, I am watching it closely.

I don't have the production/test server division fully built out yet but when I do, this ceases to be an issue. Crash test dummies can have at it if they wish.
legendary
Activity: 1596
Merit: 1012
Democracy is vulnerable to a 51% attack.
July 17, 2011, 10:09:35 PM
#14
Isn't that kind of risky for a production server anyways?
Yeah, but without people who take that risk, we could never have confidence in the code we are releasing. It's thanks to the folks who first ran my code on live servers that the code is reasonably stable today. So thank him for taking that risk so that you don't have to. (Assuming he's watching it closely. Otherwise, he's just being stupid.)
newbie
Activity: 42
Merit: 0
July 17, 2011, 09:59:19 PM
#13
I recently rebased to 0.3.24 and included a few other micro-optimizations.
http://davids.webmaster.com/~davids/bitcoin-4diff.txt


Blargh. My copy is bleeding-edge git.  Why you have to make it hard?  Grin

Isn't that kind of risky for a production server anyways?
full member
Activity: 175
Merit: 102
July 16, 2011, 09:43:31 PM
#12
I recently rebased to 0.3.24 and included a few other micro-optimizations.
http://davids.webmaster.com/~davids/bitcoin-4diff.txt


Blargh. My copy is bleeding-edge git.  Why you have to make it hard?  Grin
legendary
Activity: 1596
Merit: 1012
Democracy is vulnerable to a 51% attack.
July 16, 2011, 09:24:14 PM
#11
I recently rebased to 0.3.24 and included a few other micro-optimizations.
http://davids.webmaster.com/~davids/bitcoin-4diff.txt
full member
Activity: 175
Merit: 102
July 16, 2011, 09:12:49 PM
#10
JoelKatz, I love the work you have done on bitcoind and I will be using your patches soon.  I would like to see your fork (maintained by the other guy on Github) become a bit more stable on the larger pools and I will start running it.
Thanks. He's done a good job of porting it to 0.3.24 and maintaining it. I'm glad someone did that, as I haven't had the time lately. I may be having a lot more free time in the next week or so, so I hope get back to it aggressively.

Are you referring to Jine's fork of pushpool where you've implemented the long polling and keep-alives in pp?

I love that work too... I just got the stock codebases of bitcoind and pushpool compiled and working but I think I'm going to use your patches instead... much more elegant.
legendary
Activity: 1596
Merit: 1012
Democracy is vulnerable to a 51% attack.
July 16, 2011, 12:12:14 PM
#9
Would you be kind enough to confirm this?
Yes.
full member
Activity: 127
Merit: 100
July 16, 2011, 08:14:31 AM
#8
Excellent stuff, JoelKatz.  Can I just check...
Quote

Then just start bitcoind with '-pollpidfile=/var/run/pushpoold.pid'.

I take it that if I have in pushpool's server.json  file...
Code:
  "pid" : "/tmp/pushpoold.pid",
Then I should be using
Code:
bitcoind -pollpidfile=/tmp/pushpool.pid'.
Would you be kind enough to confirm this?

Many huge thanks!
legendary
Activity: 1596
Merit: 1012
Democracy is vulnerable to a 51% attack.
July 13, 2011, 11:57:53 AM
#7
JoelKatz, I love the work you have done on bitcoind and I will be using your patches soon.  I would like to see your fork (maintained by the other guy on Github) become a bit more stable on the larger pools and I will start running it.
Thanks. He's done a good job of porting it to 0.3.24 and maintaining it. I'm glad someone did that, as I haven't had the time lately. I may be having a lot more free time in the next week or so, so I hope get back to it aggressively.
hero member
Activity: 630
Merit: 500
July 13, 2011, 11:35:27 AM
#6
JoelKatz, I love the work you have done on bitcoind and I will be using your patches soon.  I would like to see your fork (maintained by the other guy on Github) become a bit more stable on the larger pools and I will start running it.
legendary
Activity: 1596
Merit: 1012
Democracy is vulnerable to a 51% attack.
July 13, 2011, 12:41:19 AM
#5
You can use my native long polling patch for bitcoind. It's this simple:

diff -up orig/main.cpp new/main.cpp
--- orig/main.cpp       2011-07-03 17:36:31.538080064 -0700
+++ new/main.cpp        2011-07-03 19:31:18.396649894 -0700
@@ -1586,6 +1586,20 @@ bool CBlock::SetBestChain(CTxDB& txdb, C
     // Update best block in wallet (so we can detect restored wallets)
     if (!IsInitialBlockDownload())
     {
+        // Support long polling
+        string lp_pid=mapArgs["-pollpidfile"];
+        if(lp_pid != "")
+        {
+            FILE *pidFile = fopen(lp_pid.c_str(), "r");
+            if(pidFile!=NULL)
+            {
+                int pid=0;
+                if ((fscanf(pidFile, "%d", &pid) == 1) && (pid>1))
+                    kill((pid_t) pid, SIGUSR1);
+                fclose(pidFile);
+            }
+        }
+    
         CWalletDB walletdb;
         const CBlockLocator locator(pindexNew);

Then just start bitcoind with '-pollpidfile=/var/run/pushpoold.pid' (or whatever the path to your pid file is from your config). Do not use this patch and use anything else to send a SIGUSR1 to pushpoold! (Bitcoind and pushpoold must run as the same user or this won't work.)
hero member
Activity: 630
Merit: 500
July 12, 2011, 01:29:35 PM
#4
After two weeks of working flawlessly, blkmond decided it didn't want to send SIGUSR1 anymore.  It was monitoring fine, but not sending the signal.  I just implemented your script on our pool, and it works like magic!  Thanks.
newbie
Activity: 21
Merit: 0
June 19, 2011, 02:01:33 AM
#3
This works beautifully.  I could not get blkmond working at all, but your script does the trick, and the clients clearly show the "long poll: new block"

Thanks!
newbie
Activity: 25
Merit: 0
June 17, 2011, 03:39:46 AM
#2
Yep i had the same problem.
Running Running Running and its doing nothing.

Your little skript works very well. thanks
newbie
Activity: 29
Merit: 0
May 18, 2011, 10:27:59 AM
#1
hey all, I couldn't grok blkmond, or seemingly get it working. it runs and sits there... doing nothing even when a block turns up. Anyway;

from that engineering "do it yourself" mentality I wrote a substitute that operates in possibly the least efficient way possible, it just polls bitcoind over RPC ever 0.1 of a second. Huzzah! Anyway it works, and it's a "fixed cost" work, it won't increase usage if you increase pool size.

I jokingly called it pollpokepush.py (it's even fun to say!),

To get it working:
Code:
#!/usr/bin/env python
from jsonrpc.authproxy import AuthServiceProxy
import sys
import os

access = AuthServiceProxy("http://RPCUSER:[email protected]:8332")
blockcount = access.getblockcount()
from time import sleep
while(True):
        newcount = access.getblockcount()
        if newcount > blockcount:
                os.system("killall -s SIGUSR1 pushpoold")
                sys.stdout.write("B")
                sys.stdout.flush()
                blockcount = newcount
                sleep(1)
        else:
                sleep(0.1)

Jump to: