Something similar to blocknotify but for new transaction

0

Based on bitcoind, I noticed several derivative work like bitpay insight has the ability to push new block and transaction realtime to browser.

Reading document of bitcoind I see that bitcoind have blocknotify which let me achieve similar thing for block. But there is no equivalent for transaction. I would like to be notified whenever a new transaction is sent to my node, how can I do it with bitcoind?

Phương Nguyễn

Posted 2017-10-17T04:19:59.590

Reputation: 177

Answers

2

Have a look at the Bitcoin Core ZMQ possibilities. Using blocknotify (or walletnotify) seems very inefficient (the fork a new process each time).

ZMQ does allow to have a IPC push channel from Bitcoin-Core to your client application (from there you could emulate a websocket or something that talks to your web-clients).

https://github.com/bitcoin/bitcoin/blob/master/doc/zmq.md

ZMQ is fast and relatively reliable, although has currently no wallet features (you can't get notification on wallet events, only on "global" events [new tx, new block]).

Jonas Schnelli

Posted 2017-10-17T04:19:59.590

Reputation: 5 465

1

It's called -walletnotify.

-walletnotify=<cmd> Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)

Nate Eldredge

Posted 2017-10-17T04:19:59.590

Reputation: 21 420