Bitcoin Forum

Bitcoin => Project Development => Topic started by: Khanduras on February 22, 2013, 08:13:41 AM



Title: Reading live data from bitcoin network?
Post by: Khanduras on February 22, 2013, 08:13:41 AM
I'm going to be creating a few projects related to Bitcoin that I think will be rather useful.  A few of the sites will be using Bitcoin as a primary method of payment.  I currently have my website communicating with an instance of the bitcoin client in order to create deposit addresses for users of these services.  This is highly documented, so it's simple enough to set up.

I'd now like to make use of the transaction data of the network, much like blockchain.info does.  Chances are I'm just being extremely slow, and just wasn't able to spot the right forum post or passed something by in the documentation.  Either that or it's some form of well-guarded secret.

Anyway, is there some form of documentation for setting this up that I've been unable to find?  If not, is there anyone who can sum up how to do something similar?  I'd very much appreciate any information I can get.


Title: Re: Reading live data from bitcoin network?
Post by: gweedo on February 22, 2013, 08:23:53 AM
Well are you asking how to read the data from the actual network, you could modify the bitcoin-qt client and add in the features you need like writing it to a database, or allowing you to access the information using JSON-RPC. Or you could build your own client that connects to peers...

https://en.bitcoin.it/wiki/Protocol_specification


Title: Re: Reading live data from bitcoin network?
Post by: Khanduras on February 22, 2013, 08:38:14 AM
Yes, I am talking about getting live transaction data from the Bitcoin network.  Unfortunately, I figured it would be something similar to what you said.

Are there any clients out there with this functionality already built in?  I know I can use Blockchain's API to do so, but I'd rather have something done in-house and use them as a backup only if necessary.


Title: Re: Reading live data from bitcoin network?
Post by: jim618 on February 22, 2013, 09:58:01 AM
You can use bitcoinj to see all the zero conf transactions. The peers you are connected to send them to you when they retransmit them.

You can see it happening in MultiBit when you do a send. When the peer count for a transaction increments that is one of the peers you are connected to retransmitting your own transaction back to you (after it has traversed the network).


Title: Re: Reading live data from bitcoin network?
Post by: Stephen Gornick on February 22, 2013, 04:44:07 PM
Either that or it's some form of well-guarded secret.

The Bitcoin.org client's API command "listsinceblock" will let you know new transactions, and then the Raw Transactions will give you the details on each.


Title: Re: Reading live data from bitcoin network?
Post by: Khanduras on February 22, 2013, 07:27:28 PM
Wouldn't using listsinceblock require constant polling for receiving up-to-date information on the current transactions?  Seems horribly inefficient, and wouldn't exactly be considered live.

Seems out of all of these options, editing the client to include a socket which spits out transaction information as it arrives would be the best option.  May even go as far as to create my own, since I'd like to see a Node.js alternative (BitcoinJS didn't seem to work for me after hours of frustration) surface.

Oh well.  Was kind of hoping for an easy-way-out that I could host on my own servers.  Back to the drawing board, it seems.  Thanks for the information, guys.


Title: Re: Reading live data from bitcoin network?
Post by: Zeilap on February 22, 2013, 09:07:59 PM
Wouldn't using listsinceblock require constant polling for receiving up-to-date information on the current transactions?  Seems horribly inefficient, and wouldn't exactly be considered live.

Seems out of all of these options, editing the client to include a socket which spits out transaction information as it arrives would be the best option.  May even go as far as to create my own, since I'd like to see a Node.js alternative (BitcoinJS didn't seem to work for me after hours of frustration) surface.

Oh well.  Was kind of hoping for an easy-way-out that I could host on my own servers.  Back to the drawing board, it seems.  Thanks for the information, guys.
The creator of BitcoinJS is an active member (https://bitcointalk.org/index.php?action=profile;u=2211) of this forum, you could ask him what needs to be done to bring it back up to working state, rather than implementing everything from scratch.


Title: Re: Reading live data from bitcoin network?
Post by: Stephen Gornick on February 22, 2013, 10:42:55 PM
Was kind of hoping for an easy-way-out that I could host on my own servers.  Back to the drawing board, it seems.

Not ready for production use, however ...

The bitsofproof node offers a message bus where it sends validated transactions and block chain events to authenticated extensions. It accepts transactions for routing towards the net through the same bus.

[...]
See the wiki for more: https://github.com/bitsofproof/supernode/wiki