Bitcoin Forum

Alternate cryptocurrencies => Altcoin Discussion => Topic started by: williamj2543 on August 15, 2014, 01:47:33 AM



Title: Getting list of all transactions and addresses using a daemon
Post by: williamj2543 on August 15, 2014, 01:47:33 AM
Hey, I am doing some cryptocurrency programming, more specifically I am building a block explorer, and I am wondering how would I list all the latest transactions on the network, and how would I get all addresses with a balance greater than 0 (I am trying to make a rich list). I am not necessarily using bitcoin (I am using other altcoins) but the daemon calls are all the same. How would I do this?


Title: Re: Getting list of all transactions and addresses using a daemon
Post by: kjj on August 15, 2014, 05:13:04 AM
Ugh.

Start by parsing the block files to quickly generate your database.  Keep it current with -blocknotify.  To see unconfirmed transactions, either interface with a real node using the p2p protocol, or poll the mempool and iterate the list asking for transaction details.


Title: Re: Getting list of all transactions and addresses using a daemon
Post by: williamj2543 on August 15, 2014, 06:48:53 AM
Yea I was thinking that I would have to use a database of some sort. I think I'm gonna do a loop to index all of the blocks to get all the txs in the database. I'd have to increase the block height every time it is looped ($a++) sort of thing. Is there any way to get info about an address not in my wallet? My txindex is set to 1.


Title: Re: Getting list of all transactions and addresses using a daemon
Post by: amaclin on August 15, 2014, 11:22:43 AM
Why people like to count funds in pockets they do not own ???


Title: Re: Getting list of all transactions and addresses using a daemon
Post by: BitCoinDream on August 15, 2014, 12:55:48 PM
Why people like to count funds in pockets they do not own ???

Because other people's interest in that data fills up their pocket.


Title: Re: Getting list of all transactions and addresses using a daemon
Post by: BitCoinDream on August 15, 2014, 12:57:55 PM
Yea I was thinking that I would have to use a database of some sort. I think I'm gonna do a loop to index all of the blocks to get all the txs in the database. I'd have to increase the block height every time it is looped ($a++) sort of thing. Is there any way to get info about an address not in my wallet? My txindex is set to 1.

I think the best bet is to use a flat file, but managing that would require a lot of coding.