Crypto Explorer Index Updating after reboot

3 Likes Comment
Blockchain Explorer Issues

If you’re deploying a simple cryptocurrency blockchain explorer with Iquidus platform, sometime you maybe meet some problems with VPS/Server reboot.

Here is a story with the same issue:

Hi,
I’m trying to index an old blockchain with around 2 Million Blocks.
With a physical server, I’ve several issues.
The problem, sometimes, it comes block with heavy transactions and it stopped to react, I need sometimes to reboot the machine, everything I’ve tried, clean cache, up size index values, start/stop/restart db, wallet daemon with txindex, everything I’ve tried. My question is: It’s possible to load the db with multiple tasks, specifying a range of blocks, example, task A = 1-50k; task B 500001-100k and so I would like to run like layers, with multiple machines, each addressing a range of blocks to the db and saving all together without problems… I’m not good developer, if someone have an experience with this issue, could say to me if this possible, because it’s sucking more than week to index the block and I’ve found many problems around the blocks. It’s not working with just one task.

I was think to use a function that I could specify which blocks (range) that I would like to update, as an example Block 300k until 500k… but I remember that I can load the whole Blockchain into MongoDB via CSV, it’s successfully updated but it’s not updating the web automatically, it’s sucking at the “last sync” task. How can I update the last sync to start at the last tx point. Any help?

And the workaround solution is:

Hopefully you got this answer yourself, but it’s as simple as changing the “last” value in coinstats. You could also, if you’re so inclined, just modify the scripts/sync.js from it’s start point to something else.

} else if (mode == 'update') {
db.update_tx_db(settings.coin, stats.last, stats.count, settings.update_timeout, function(){                                           

basically change that to something like this

} else if (mode == 'update') {
db.update_tx_db(settings.coin, 59412, 88000, settings.update_timeout, function(){                                           

In this example, you’re setting the start to block 59412 and the count (or end block) to 88000. You can even do less, like only 59412 to 59413 and then when that completes after 1 block, the script will run its “get_stats” and update the last block to 59413 so that you can revert your changes and run the updater like normal. Obviously changing the coinstats[1].last is the easiest.

Thanks to Uaktags (https://github.com/uaktags )

You might like

About the Author: Toc Xoan

This guy likes taking photos, hunting cheap tours, exploring the unique culture of every cities of Vietnam. Contact: [email protected]