Replies: 1 comment 1 reply
-
|
There's a half dozen *notify options, it doesn't make sense to call this one httpnotify... Maybe just blocknotify=http://... and look for the http: prefix? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When using the DATUM gateway, you need to use the blocknotify command in Bitcoin Knots. An example is:
blocknotify=wget -q -O /dev/null http://localhost:7152/NOTIFYThis works by shelling out and running wget. I have been profiling the performance of this, and on my slow hardware (Odroid M2 16GB), this takes about 75ms.
This is a problem because from the moment that Bitcoin Knots has accepted a new block, any energy spent by a hasher is wasted until DATUM can get the notification of the new block, issue a getblocktemplate() RPC-JSON call to Bitcoin Knots, get the result, and send a new work unit to the hasher to start working on a new job.
I propose adding a new config option to improve the DATUM gateway integration notification performance, and model it after blocknotify.
httpnotify=http://localhost:7152/NOTIFY/%sAlthough DATUM does not use the block hash, I propose keeping the %s option (to match blocknotify). I do personally use the %s blockhash in other applications. It offers many benefits, such as providing a unique reference in logs across different systems when debugging issues. For DATUM gateway the config would look like:
httpnotify=http://localhost:7152/NOTIFYI propose that this operate as a "single-shot" system, with no retries. Either the receiver is ready to accept the notification, or they lose it. I propose that only HTTP is supported, and that this is done without any external libraries, using socket/send/recv/close. I propose using this approach because it is very lightweight, with minimal code ripple.
I propose that nothing more be done with errors except log them.
Because this would be a small change, would this be a good first project for people working on Bitcoin Knots?
Beta Was this translation helpful? Give feedback.
All reactions