Author

Topic: track blocks (Read 2863 times)

legendary
Activity: 1428
Merit: 1000
August 07, 2012, 02:32:26 AM
#4
bitcoind does what you need.  From "bitcoind --help":

  -blocknotify= Execute command when the best block changes (%s in cmd is replaced by block hash)

Then whenever you're notified of a new block use getreceivedbyaddress or listreceivedbyaddress to see if your address has received anything.


Quote
is there any way to get a json representation of a specific block which includes all transaction in it?

Yes, getblock does exactly that.

thanks

i dont have a bitcoind here right now and the internet says "getblock" is not available.
i'll try it tonight.
hero member
Activity: 728
Merit: 500
165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g
August 06, 2012, 09:25:41 PM
#3
bitcoind does what you need.  From "bitcoind --help":

  -blocknotify= Execute command when the best block changes (%s in cmd is replaced by block hash)

Then whenever you're notified of a new block use getreceivedbyaddress or listreceivedbyaddress to see if your address has received anything.


Quote
is there any way to get a json representation of a specific block which includes all transaction in it?

Yes, getblock does exactly that.
legendary
Activity: 1428
Merit: 1000
August 06, 2012, 10:59:23 AM
#2
i guess i just use blockchain.info's api
it looks very promising
legendary
Activity: 1428
Merit: 1000
August 06, 2012, 10:31:34 AM
#1
hello,

i want to write a small program which track bitcoin blocks and looks for certain addresses.
what is the easiest way to get notified when a new block arrives?

i'd prefer to run a stock bitcoind.

with "getinfo" i get the current block count.
is there any way to get a json representation of a specific block which includes all transaction in it?

(notification or polling does not really matter. its not that time sensitive)
Jump to: