Indexing update in iquidus explorer

22 Likes Comment

Sometime the indexing, synchronization process take longer time than I expect.

# rm tmp/index.pid; node scripts/sync.js index update
script launched with pid: 52687

Scripts/sync.js seems to be hang, no response?

Here is the way to make you clear about the description of sync process

  1. Edit the scripts/sync.js:
explorer/scripts/sync.js
Lines 188 to 189:
 } else if (mode == 'update') { 
   db.update_tx_db(settings.coin, stats.last, stats.count, settings.update_timeout, function(){ 

change to:

} else if (mode == 'update') {
                  console.log("Coin: %s. Last stats: %s. Current BlockCount: %s",settings.coin, stats.last, stats.count);
                  db.update_tx_db(settings.coin, stats.last, stats.count, settings.update_timeout, function(){

2. Edit file: explorer/lib/database.js

#explorer/lib/database.js
Lines 729 to 731 in c681306
          var task_limit_txs = 1;
          for (i=start; i<(end+1); i++) {
            blocks_to_scan.push(i);
          }
          async.eachLimit(blocks_to_scan, task_limit_blocks, function(block_height, next_block) {

change to

          var task_limit_txs = 1;
          console.log("Start adding blocks to array. Need to sync %s blocks. This can take some time.", (end - start));
          for (i=start; i<(end+1); i++) {
            blocks_to_scan.push(i);
          }
          console.log("Finished adding blocks to array, start Syncing...");
          async.eachLimit(blocks_to_scan, task_limit_blocks, function(block_height, next_block) {

And the debug message will show more clearly:

Coin: JMCcoin. Last stats: 629999. Current BlockCount: 853429
Start adding blocks to array. Need to sync 223430 blocks. This can take some time.
Finished adding blocks to array, start Syncing...

So that is it. Don’t worry. Drink coffee and stay waiting

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]