Does Bitcoin RPC API have a realtime websocket?

2

I am trying to create some app based on RPC API call from bitcoin core.

I want to make my btc core daemon send a notification whenever a new transaction is observed. Does BTC core RPC API have a websocket interface to make a call when new transaction happens ?

Billy Adelphia

Posted 2018-03-19T02:29:51.833

Reputation: 165

1Do you want the call happen for every transaction on the network or just transactions in your wallet?Andrew Chow 2018-03-19T05:24:07.727

just on my walletBilly Adelphia 2018-03-20T02:45:25.703

Answers

4

Since you only care about transactions involving your wallet, you can specify the walletnotify option in your bitcoin.conf or your bitcoind start command.

Since walletnotify allows you to execute an arbitrary command with the new tx info, it's fairly easy to make it call a webhook on your application, or invoke your application via the command line, or pass the information on in any number of other ways.

Raghav Sood

Posted 2018-03-19T02:29:51.833

Reputation: 10 897