Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: PrintCoins on March 02, 2013, 03:30:21 PM



Title: How to build a blockexplorer.com type site.
Post by: PrintCoins on March 02, 2013, 03:30:21 PM
I am looking to develop some sites that would end up relying on the APIs provided on blockexplorer.com or blockchain.info.

Specifically, I will need access to their services to get transactions related to specific addresses.

Rather than relying on their services though, I would like to have my own internal site that does the same - or just a version of bitcoind that has indexed all addresses and will allow me to query for the raw transactions for any address stored in the blockchain.

Does anyone know how these sites set up a system to arbitrarily query different addresses? Does anyone know of an open source build of something that I can use to reach what I am looking for?

Heck, a tool that would be able to scan the blk data files of bitcoind and dump results into mysql would even work.


Title: Re: How to build a blockexplorer.com type site.
Post by: Scrat Acorns on March 02, 2013, 03:36:13 PM
You need an index in order to abritrarily lookup addresses.

Abe accomplishes this by storing everything in an SQL database.

https://github.com/jtobey/bitcoin-abe (https://github.com/jtobey/bitcoin-abe)


Title: Re: How to build a blockexplorer.com type site.
Post by: PrintCoins on March 02, 2013, 03:45:28 PM
You need an index in order to abritrarily lookup addresses.

Abe accomplishes this by storing everything in an SQL database.

https://github.com/jtobey/bitcoin-abe (https://github.com/jtobey/bitcoin-abe)

So it reads the bitcoin main client's db and dumps it into a database.

Bitcoin's blockchain db has been switched to leveldb. Does it still work with this?

Also, 0.8 release has this in its notes
Quote
This release no longer maintains a full index of historical transaction ids
by default, so looking up an arbitrary transaction using the getrawtransaction
RPC call will not work. If you need that functionality, you must run once
with -txindex=1 -reindex=1 to rebuild block-chain indices (see below for more
details).

Is that a problem? Is the transaction index required?


Title: Re: How to build a blockexplorer.com type site.
Post by: Scrat Acorns on March 02, 2013, 03:52:09 PM
Bitcoin's blockchain db has been switched to leveldb. Does it still work with this?

The blockchain isn't a database, it's raw data so it will work.


Is that a problem? Is the transaction index required?

No, since everything is rebuilt SQL side.


Title: Re: How to build a blockexplorer.com type site.
Post by: PrintCoins on March 02, 2013, 03:56:48 PM
Bitcoin's blockchain db has been switched to leveldb. Does it still work with this?

The blockchain isn't a database, it's raw data so it will work.


Is that a problem? Is the transaction index required?

No, since everything is rebuilt SQL side.

Fantastic. Thank you very much.


Title: Re: How to build a blockexplorer.com type site.
Post by: PrintCoins on April 09, 2013, 02:56:57 AM
So I set up Abe and Bitcoind on a linux vps, but bitcoin either gets hung or consumes the whole machine in the course of a day (making it so I can't even ssh in).

This hardly seems like the path to a stable server that could be relied on. What do people do to make bitcoind more stable? Why is it so demanding?


Title: Re: How to build a blockexplorer.com type site.
Post by: moni3z on April 09, 2013, 07:30:26 PM
Could try running bitcoin client on Amazon free instance to update blockchain (or somewhere else), then feed data to google app engine running Abe for query/storage. Or use some other hosted cloud app engine like Heroku, or buy a bigger VPS maybe it's just bogging down while trying to update the blockchain first time

https://bitcointalk.org/index.php?topic=67125.0

If I remember correctly there's plenty of bitcoin services to monitor transactions and send you alerts/info about addresses https://en.bitcoin.it/wiki/BitcoinNotify