Menu Close

How to make crypto currency BlockExplorer

This time I will make a tutorial about how to make cryptocurrency BlockExplorer. For example, we will make a DamaCoin (DMC) BlockExplorer, in a Debian 8 64bit server, that run explorer.damacoin.org
damacoin
Install the required packages

 
Create a Database to store the blockchain data


Clone the bitcoin-abe, that will run as our BlockExplorer

 
Clone DamaCoin, as we needed to run it to get the blockchain, and to see the address_version and the magic key

Now we have our DamaCoin running and synchronizing with the network, and so we had our blockchain.
By default, bitcoin-abe will failed if the blockfiles not stored at block directory. So if the blockfile is stored at /home/.kuwaitcoin/blk0001.dat, we need to make a modification to the DataStore.py, and it only can run for the coin that store the blockfiles outside of the block directory.
 
Configuring the bitcoin-abe/abe.conf

To get the address_version, please open the DaMaCoin/src/base58.h, and find the line with PUBKEY_ADDRESS, next we will see the number DEC 30, so we convert it to HEX 1E

 
Configuring the bitcoin-abe/Abe/DataStore.py

We use the same address_version as the abe.conf. And to get the “magic”, please open DaMaCoin/src/main.cpp, and find the char pchMessageStart. We will see 0xfb, 0xc0, 0xb6, 0xdb.Substract one digit, so we have 0xfa,0xbf,xb5,xda

 
Begin parsing the blockchain to the database
The following process could take about one or three hours, or even one day, depends on the server/internet connection/blockchain size. Please wait until it finished, or you can use screen command

 
Running the python internal webserver using our abe.conf.

If we have no error, we can open our BlockExplorer from the http://ip.address.of.server:25000
 
Some crypto currency might use a character that not supported by latin_1 in the database, so we need to make some tweaks on bitcoin-abe/Abe/DataStore.py

After doing some tweaks in the bitcoin-abe/Abe/DataStore.py, we have to change our database tables on “chain” and “datadir” colation to utf8_general_ci
 
If we prefer to run the BlockExplorer using the supervisord, we can use this example for the config :

To start the program, run the supervisord with : supervisorctl start explorer
Now, we can have our own BlockExplorer for many crypto currency. As this article written, I run multi explorer at explorer.cryptonode.xyz
If you find this tutorial helpfull, please make a donation to BTC:18LxEvBNdR81P7AL7YVdisrW9xpiEwrb6A

Leave a Reply

Your email address will not be published. Required fields are marked *