Can a live feed of blockchain transactions be obtained from using bitcoin core wallet?

1

1

I am interested in both obtaining the entire blockchain transaction history data (for bitcoin) and a live feed of transactions for a data science project. BlockChain.com has a very useful websocket API for the latter and I have been downloading Bitcoin core to obtain the former. Given that bitcoin core clearly receives new transactions in real time - is there a way I could get a live feed of transactions directly from bitcoin core (cutting out the need for the BlockChain.com websocket API). Thanks.

ElisVandyck

Posted 2018-09-12T08:23:57.253

Reputation: 13

Have a look at the zeromq options for bitcoind.Jannes 2018-09-12T09:41:16.690

Answers

1

is there a way I could get a live feed of transactions directly from bitcoin core (cutting out the need for the BlockChain.com websocket API)

Certainly. Bitcoin Core supports the ZeroMQ messaging protocol. It publishes a stream of blocks, block hashes, transactions, and transaction hashes to whatever port you specify. You can specify which of those you want to, they have to be explicitly enabled. This stream is always a reflection of what it is currently receiving over the network. Once it has validated a block or transaction, it will then push that out to the ZMQ stream.

You can then connect to the ZMQ stream with whatever software and parse the messages into their respective types.

Andrew Chow

Posted 2018-09-12T08:23:57.253

Reputation: 40 910