I'm looking to develop an app that needs to monitor the Bitcoin network in real time. I'm already able to parse the blockchain into a database, but I'm wondering what the best way to keep the database up to date in real time is?
bitcoind doesn't seem to have a JSON-RPC API for getting streams of new transactions or blocks, does it? I suppose I could monitor the debug.log but that feels hacky.
Is there a better client/library for this purpose? What does blockchain.info do, for example?
I haven't used this but bitcoind has an option called "blocknotify", which looks like it lets you specify a command to run when a new block shows up.
https://en.bitcoin.it/wiki/Running_BitcoinThat won't help you if you need stuff before it gets into blocks (and it's not for addresses in the local wallet). The sadly-defunct bitping.net used to use a patched version of bitcoind for that:
https://github.com/MORA99/bitcoin/commits/master...which lets you specify a URL on the command line to notify it about new transactions.
But the patch is a bit old, and I couldn't get the patch to work against more recent versions, so I ended up just running a process to watch debug.log, filtering that for stuff I was interested in and going from there. This does indeed feel hacky, but it's actually quite nice and flexible. It's easy to test (replay whatever you're doing the same log as many times as you like) and easy to catch up if something that needs the data can't keep up.