Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: dingrite on November 28, 2013, 06:12:45 PM



Title: Creating a specialized listener
Post by: dingrite on November 28, 2013, 06:12:45 PM

My goal is to create a bot that would listen to the bitcoin network for a list of specific transactions associated with specific bitcoin addresses.

To achieve this I figured it would be best to query the network for the latest blocks, verify them and look for the transactions there.

Does anyone know how I could best do this? A high level description would do.

And I assume libbitcoin is the best cpp lib out there?


Title: Re: Creating a specialized listener
Post by: doof on November 28, 2013, 11:14:39 PM
Depending on your coding skills this is very easy. 

Call api such as http://blockchain.info/api/blockchain_api

Do your logic

Pause, Repeat.


Title: Re: Creating a specialized listener
Post by: dingrite on November 28, 2013, 11:32:25 PM
Thank you but I forgot to mention I do not want to rely on any static source(s).

I want to bootstrap into the p2p network and pull the info out of there.

I also don't want to store the whole blockchain in the process but only the last N blocks. Also the possibility of offline time is possible so it should be able to somehow query only the last N blocks even if the last block it has is N+x (x>0) away.

Sorry I wasn't clearer, I was in a bit of a hurry.


Title: Re: Creating a specialized listener
Post by: elbandi on November 29, 2013, 12:49:39 AM

My goal is to create a bot that would listen to the bitcoin network for a list of specific transactions associated with specific bitcoin addresses.

To achieve this I figured it would be best to query the network for the latest blocks, verify them and look for the transactions there.

Does anyone know how I could best do this? A high level description would do.

And I assume libbitcoin is the best cpp lib out there?

https://code.google.com/p/bitcoinj/wiki/UsingFromOtherLanguages
here is a sample:
https://github.com/mikehearn/cppjvm/blob/master/mytest/bcj-hello-world.cpp


Title: Re: Creating a specialized listener
Post by: dingrite on November 29, 2013, 01:34:35 AM

My goal is to create a bot that would listen to the bitcoin network for a list of specific transactions associated with specific bitcoin addresses.

To achieve this I figured it would be best to query the network for the latest blocks, verify them and look for the transactions there.

Does anyone know how I could best do this? A high level description would do.

And I assume libbitcoin is the best cpp lib out there?

https://code.google.com/p/bitcoinj/wiki/UsingFromOtherLanguages
here is a sample:
https://github.com/mikehearn/cppjvm/blob/master/mytest/bcj-hello-world.cpp


Thank you but I am looking for a C/Cpp implementation, I do not like java dependency and the bot need be able to run without a potential JVM bottleneck. It will be performing a lot of cryptography and many instances may have to be run.


Title: Re: Creating a specialized listener
Post by: wiggi on November 30, 2013, 04:58:31 PM
a bot that would listen to the bitcoin network for a list of specific transactions associated with specific bitcoin addresses
Patch the Qt-client. Take a look at the console commands (getrawtransaction etc),
everything you need is already there.


Title: Re: Creating a specialized listener
Post by: cnk on December 02, 2013, 11:29:13 AM

My goal is to create a bot that would listen to the bitcoin network for a list of specific transactions associated with specific bitcoin addresses.


There is a pull request that adds support for watch-only addresses to bitcoind : https://github.com/bitcoin/bitcoin/pull/2861. This PR allows to track transactions and balances without having to know and keep associated private keys in the wallet. Unfortunately, it is unclear when it will be merged.

It is also reported that people are using this in production (custom version of bitcoind).