Bitcoin Forum
June 17, 2024, 03:03:27 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Best way to monitor the network for new transactions/blocks in real-time?  (Read 934 times)
tlr (OP)
Member
**
Offline Offline

Activity: 86
Merit: 10


View Profile
December 15, 2013, 01:50:31 AM
 #1

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?
e521
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
December 15, 2013, 01:54:55 AM
 #2

maybe you can contact http://www.listentobitcoin.com and ask?

tlr (OP)
Member
**
Offline Offline

Activity: 86
Merit: 10


View Profile
December 15, 2013, 02:15:09 AM
 #3

maybe you can contact http://www.listentobitcoin.com and ask?

I think they use the blockchain.info API, it says "Blockchain.info Transactions: Connected." near the bottom.

I'd rather connect directly to the Bitcoin network.
artw1982
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
December 15, 2013, 02:46:05 AM
 #4

Not sure what language you're using but you could use something like a FileSystemWatcher and detect when the blockchain db is updated.
edmundedgar
Sr. Member
****
Offline Offline

Activity: 352
Merit: 250


https://www.realitykeys.com


View Profile WWW
December 15, 2013, 10:43:37 AM
 #5

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_Bitcoin

That 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.
malevolent
can into space
Legendary
*
Offline Offline

Activity: 3472
Merit: 1721



View Profile
December 15, 2013, 10:49:23 AM
 #6

maybe you can contact http://www.listentobitcoin.com and ask?

Be careful with that site: http://www.reddit.com/r/Bitcoin/comments/1ia7q2/

Use this one: http://www.bitlisten.com/

Signature space available for rent.
bclucho
Newbie
*
Offline Offline

Activity: 18
Merit: 2


View Profile
July 03, 2016, 08:40:23 PM
 #7

Have a look to  https://bitbucket.org/camp0/aiengine and https://github.com/sebicas/bitcoin-sniffer, hope it helps
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!