metonymous (OP)
Newbie
Offline
Activity: 29
Merit: 0
|
|
May 18, 2011, 03:27:59 PM |
|
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: #!/usr/bin/env python from jsonrpc.authproxy import AuthServiceProxy import sys import os
access = AuthServiceProxy("http://RPCUSER:RPCPASS@127.0.0.1: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)
|
|
|
|
xmasterpx
Newbie
Offline
Activity: 25
Merit: 0
|
|
June 17, 2011, 08:39:46 AM |
|
Yep i had the same problem. Running Running Running and its doing nothing.
Your little skript works very well. thanks
|
|
|
|
lemosax
Newbie
Offline
Activity: 21
Merit: 0
|
|
June 19, 2011, 07:01:33 AM |
|
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!
|
|
|
|
phorensic
|
|
July 12, 2011, 06:29:35 PM |
|
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.
|
|
|
|
JoelKatz
Legendary
Offline
Activity: 1596
Merit: 1012
Democracy is vulnerable to a 51% attack.
|
|
July 13, 2011, 05:41:19 AM Last edit: July 17, 2011, 02:25:00 AM by JoelKatz |
|
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.)
|
I am an employee of Ripple. Follow me on Twitter @JoelKatz 1Joe1Katzci1rFcsr9HH7SLuHVnDy2aihZ BM-NBM3FRExVJSJJamV9ccgyWvQfratUHgN
|
|
|
phorensic
|
|
July 13, 2011, 04:35:27 PM |
|
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.
|
|
|
|
JoelKatz
Legendary
Offline
Activity: 1596
Merit: 1012
Democracy is vulnerable to a 51% attack.
|
|
July 13, 2011, 04:57:53 PM |
|
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.
|
I am an employee of Ripple. Follow me on Twitter @JoelKatz 1Joe1Katzci1rFcsr9HH7SLuHVnDy2aihZ BM-NBM3FRExVJSJJamV9ccgyWvQfratUHgN
|
|
|
froggy
|
|
July 16, 2011, 01:14:31 PM Last edit: July 16, 2011, 01:31:17 PM by froggy |
|
Excellent stuff, JoelKatz. Can I just check... Then just start bitcoind with '-pollpidfile=/var/run/pushpoold.pid'.
I take it that if I have in pushpool's server.json file... "pid" : "/tmp/pushpoold.pid",
Then I should be using bitcoind -pollpidfile=/tmp/pushpool.pid'.
Would you be kind enough to confirm this? Many huge thanks!
|
|
|
|
JoelKatz
Legendary
Offline
Activity: 1596
Merit: 1012
Democracy is vulnerable to a 51% attack.
|
|
July 16, 2011, 05:12:14 PM |
|
Would you be kind enough to confirm this?
Yes.
|
I am an employee of Ripple. Follow me on Twitter @JoelKatz 1Joe1Katzci1rFcsr9HH7SLuHVnDy2aihZ BM-NBM3FRExVJSJJamV9ccgyWvQfratUHgN
|
|
|
Furyan
|
|
July 17, 2011, 02:12:49 AM |
|
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.
|
|
|
|
JoelKatz
Legendary
Offline
Activity: 1596
Merit: 1012
Democracy is vulnerable to a 51% attack.
|
|
July 17, 2011, 02:24:14 AM |
|
I recently rebased to 0.3.24 and included a few other micro-optimizations. http://davids.webmaster.com/~davids/bitcoin-4diff.txt
|
I am an employee of Ripple. Follow me on Twitter @JoelKatz 1Joe1Katzci1rFcsr9HH7SLuHVnDy2aihZ BM-NBM3FRExVJSJJamV9ccgyWvQfratUHgN
|
|
|
Furyan
|
|
July 17, 2011, 02:43:31 AM |
|
Blargh. My copy is bleeding-edge git. Why you have to make it hard?
|
|
|
|
TeraPool
Newbie
Offline
Activity: 42
Merit: 0
|
|
July 18, 2011, 02:59:19 AM |
|
Blargh. My copy is bleeding-edge git. Why you have to make it hard? Isn't that kind of risky for a production server anyways?
|
|
|
|
JoelKatz
Legendary
Offline
Activity: 1596
Merit: 1012
Democracy is vulnerable to a 51% attack.
|
|
July 18, 2011, 03:09:35 AM |
|
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.)
|
I am an employee of Ripple. Follow me on Twitter @JoelKatz 1Joe1Katzci1rFcsr9HH7SLuHVnDy2aihZ BM-NBM3FRExVJSJJamV9ccgyWvQfratUHgN
|
|
|
Furyan
|
|
July 18, 2011, 02:28:12 PM |
|
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.
|
|
|
|
|