@eclesia/indexer-engine 2.5.10 → 2.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/indexer/index.d.ts.map +1 -1
- package/dist/indexer/index.js +19 -14
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/indexer/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAuC,WAAW,EAA4B,MAAM,wBAAwB,CAAC;AAkBpH,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAc,oBAAoB,EAAE,QAAQ,EAAqB,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAI5G,eAAO,MAAM,oBAAoB;;;;;cAKX,oBAAoB,CAAC,UAAU,CAAC;;;;;;;8BAO1B,OAAO;CAClC,CAAC;AAEF,qBAAa,cAAe,SAAQ,cAAc;IAChD,OAAO,CAAC,MAAM,CAAuB;IAErC,OAAO,CAAC,OAAO,CAAkB;IAEjC,OAAO,CAAC,UAAU,CAAa;IAE/B,OAAO,CAAC,YAAY,CAAU;IAE9B,OAAO,CAAC,eAAe,CAAU;IAEjC,OAAO,CAAC,WAAW,CAAS;IAE5B,OAAO,CAAC,UAAU,CAAK;IAEhB,MAAM,EAAG,WAAW,CAAC;IAErB,WAAW,EAAG,WAAW,CAAC;IAE1B,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC;IAE3B,OAAO,CAAC,SAAS,CAAiC;IAElD,OAAO,CAAC,WAAW,CAEjB;IAEF,OAAO,CAAC,YAAY,CAA6D;gBAErE,MAAM,EAAE,oBAAoB;IAyDxC,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,aAAa,CAInB;IAEF,OAAO,CAAC,SAAS;IAQJ,OAAO;IAcP,KAAK;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources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Y;IAY1B,OAAO,CAAC,WAAW;YAQL,cAAc;YAyBd,cAAc;YAuBd,YAAY;CAiD3B"}
|
package/dist/indexer/index.js
CHANGED
|
@@ -216,6 +216,7 @@ class EcleciaIndexer extends emitter_1.EclesiaEmitter {
|
|
|
216
216
|
throw e;
|
|
217
217
|
}
|
|
218
218
|
this.fetcher().catch((e) => {
|
|
219
|
+
this.setStatus("FAILED");
|
|
219
220
|
throw new Error("Error in fetching service: " + e);
|
|
220
221
|
});
|
|
221
222
|
const hrTime = process.hrtime();
|
|
@@ -298,6 +299,10 @@ class EcleciaIndexer extends emitter_1.EclesiaEmitter {
|
|
|
298
299
|
this.log.info("Indexer is restarting");
|
|
299
300
|
setTimeout(() => this.start(), this.retryCount * 5000);
|
|
300
301
|
}
|
|
302
|
+
else {
|
|
303
|
+
this.log.info("Indexer failed too many times. Exiting.");
|
|
304
|
+
process.exit(1);
|
|
305
|
+
}
|
|
301
306
|
}
|
|
302
307
|
async processBlock(block, block_results, validators) {
|
|
303
308
|
let processStart = [0, 0];
|
|
@@ -422,26 +427,26 @@ class EcleciaIndexer extends emitter_1.EclesiaEmitter {
|
|
|
422
427
|
this.log.debug("Fetching: " + i);
|
|
423
428
|
try {
|
|
424
429
|
if (this.isMinimal(this.blockQueue)) {
|
|
425
|
-
const
|
|
426
|
-
|
|
427
|
-
this.blockClient.blockResults(i)
|
|
428
|
-
]).catch((e) => {
|
|
429
|
-
this.log.error("Error fetching block: " + i + " : " + e);
|
|
430
|
-
return Promise.resolve([]);
|
|
430
|
+
const timeoutPromise = new Promise((resolve, reject) => {
|
|
431
|
+
setTimeout(reject, 20000, false);
|
|
431
432
|
});
|
|
433
|
+
const toIndex = Promise.race([Promise.all([
|
|
434
|
+
this.blockClient.block(i),
|
|
435
|
+
this.blockClient.blockResults(i)
|
|
436
|
+
]), timeoutPromise]);
|
|
432
437
|
this.blockQueue.enqueue(toIndex);
|
|
433
438
|
}
|
|
434
439
|
else {
|
|
440
|
+
const timeoutPromise = new Promise((resolve, reject) => {
|
|
441
|
+
setTimeout(reject, 20000, false);
|
|
442
|
+
});
|
|
435
443
|
const q = query_1.QueryValidatorsRequest.fromPartial({ pagination: { limit: 1000n } });
|
|
436
444
|
const vals = query_1.QueryValidatorsRequest.encode(q).finish();
|
|
437
|
-
const toIndex = Promise.all([
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
this.log.error("Error fetching block: " + i + " : " + e);
|
|
443
|
-
return Promise.resolve([]);
|
|
444
|
-
});
|
|
445
|
+
const toIndex = Promise.race([Promise.all([
|
|
446
|
+
this.blockClient.block(i),
|
|
447
|
+
this.blockClient.blockResults(i),
|
|
448
|
+
this.callABCI("/cosmos.staking.v1beta1.Query/Validators", vals, i, false)
|
|
449
|
+
]), timeoutPromise]);
|
|
445
450
|
this.blockQueue.enqueue(toIndex);
|
|
446
451
|
}
|
|
447
452
|
await this.blockQueue.continue();
|