@eclesia/indexer-engine 2.5.18 → 2.6.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/emitter/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAAsB;IAE9B,OAAO,sBAA6B;IAE3C,OAAO,CAAC,UAAU,CAAiB;;IAMnC,IAAI,CAAC,KAAK,SAAS,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,GAAG,MAAM,EAC7D,SAAS,EAAE,KAAK,EAChB,QAAQ,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE;IAYlE,EAAE,CAAC,UAAU,SAAS,MAAM,iBAAiB,CAAC,QAAQ,CAAC,GAAG,MAAM,GAAG,YAAY,EAAE,SAAS,EAAE,UAAU,EACpG,OAAO,EAAE,UAAU,SAAS,YAAY,GACpC,CAAC,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAC1B,KAAK,EAAE,OAAO,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;KAAE,KAAK,IAAI,GACxB,CAAC,QAAQ,EAAE,UAAU,SAAS,MAAM,iBAAiB,CAAC,QAAQ,CAAC,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,GAAG,KAAK,KAAK,IAAI;IA2BhI,GAAG,CAAC,UAAU,SAAS,MAAM,iBAAiB,CAAC,QAAQ,CAAC,GAAG,MAAM,EAAE,SAAS,EAAE,UAAU,EACtF,OAAO,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,KAAK,IAAI;CAavE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/emitter/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAElB,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAAsB;IAE9B,OAAO,sBAA6B;IAE3C,OAAO,CAAC,UAAU,CAAiB;;IAMnC,IAAI,CAAC,KAAK,SAAS,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,GAAG,MAAM,EAC7D,SAAS,EAAE,KAAK,EAChB,QAAQ,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG;QAC7C,IAAI,CAAC,EAAE,MAAM,CAAA;KACd;IAkBH,EAAE,CAAC,UAAU,SAAS,MAAM,iBAAiB,CAAC,QAAQ,CAAC,GAAG,MAAM,GAAG,YAAY,EAC7E,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,UAAU,SAAS,YAAY,GACpC,CAAC,QAAQ,EAAE;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,KAAK,EAAE,OAAO,CAAA;QACd,IAAI,EAAE,MAAM,CAAA;KACb,KAAK,IAAI,GACR,CAAC,QAAQ,EAAE,UAAU,SAAS,MAAM,iBAAiB,CAAC,QAAQ,CAAC,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,GAAG,KAAK,KAAK,IAAI;IA8ChI,GAAG,CAAC,UAAU,SAAS,MAAM,iBAAiB,CAAC,QAAQ,CAAC,GAAG,MAAM,EAC/D,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,KAAK,IAAI;CAmBvE"}
@@ -20,7 +20,7 @@ class EclesiaEmitter {
20
20
  this.emitter.emit("_unhandled", {
21
21
  type: eventName,
22
22
  event: eventArg,
23
- uuid: eventArg.uuid
23
+ uuid: eventArg.uuid,
24
24
  });
25
25
  }
26
26
  }
@@ -37,15 +37,19 @@ class EclesiaEmitter {
37
37
  try {
38
38
  await handler(eventData);
39
39
  if (eventName !== "uuid" && eventName !== "_unhandled" && eventData.uuid) {
40
- this.emit("uuid", { status: true,
41
- uuid: eventData.uuid });
40
+ this.emit("uuid", {
41
+ status: true,
42
+ uuid: eventData.uuid,
43
+ });
42
44
  }
43
45
  }
44
46
  catch (error) {
45
47
  if (eventName !== "uuid" && eventName !== "_unhandled" && eventData.uuid) {
46
- this.emit("uuid", { status: false,
48
+ this.emit("uuid", {
49
+ status: false,
47
50
  error: error,
48
- uuid: eventData.uuid });
51
+ uuid: eventData.uuid,
52
+ });
49
53
  }
50
54
  }
51
55
  };
@@ -27,8 +27,7 @@ export declare class EcleciaIndexer extends EclesiaEmitter {
27
27
  client: CometClient;
28
28
  blockClient: CometClient;
29
29
  log: winston.Logger;
30
- private rpcOk;
31
- private debugTime;
30
+ private tryToRecover;
32
31
  private healthCheck;
33
32
  private subscription;
34
33
  constructor(config: EcleciaIndexerConfig);
@@ -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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AAuB;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,YAAY,CAAkB;IAEtC,OAAO,CAAC,WAAW,CAEjB;IAEF,OAAO,CAAC,YAAY,CAA6D;gBAErE,MAAM,EAAE,oBAAoB;IA6ExC,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,aAAa,CAQnB;IAEF,OAAO,CAAC,SAAS;IASJ,OAAO;IAuBP,KAAK;IAqKX,SAAS,EAAE,QAAQ,CAAC,MAAM,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CA2C3D;YAEY,YAAY;YAmJZ,OAAO;IA8DR,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,GAAE,OAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IA0BlH,OAAO,CAAC,gBAAgB;YAgDV,YAAY;IAa1B,OAAO,CAAC,WAAW;YASL,cAAc;YAsCd,cAAc;YA4Bd,YAAY;CAkE3B"}
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.EcleciaIndexer = exports.defaultIndexerConfig = void 0;
7
+ /* eslint-disable max-lines */
7
8
  const node_crypto_1 = require("node:crypto");
8
9
  const node_fs_1 = __importDefault(require("node:fs"));
9
10
  const tendermint_rpc_1 = require("@cosmjs/tendermint-rpc");
@@ -35,30 +36,31 @@ exports.defaultIndexerConfig = {
35
36
  minimal: true,
36
37
  init: () => Promise.resolve(),
37
38
  beginTransaction: () => Promise.resolve(),
38
- endTransaction: (_status) => Promise.resolve()
39
+ endTransaction: (_status) => Promise.resolve(),
39
40
  };
40
41
  class EcleciaIndexer extends emitter_1.EclesiaEmitter {
41
42
  constructor(config) {
42
43
  super();
43
44
  this.initialized = false;
44
45
  this.retryCount = 0;
45
- this.rpcOk = true;
46
- this.debugTime = null;
46
+ this.tryToRecover = false;
47
47
  this.healthCheck = {
48
- status: "CONNECTING"
48
+ status: "CONNECTING",
49
49
  };
50
50
  this.subscription = null;
51
51
  this.blockListener = {
52
52
  next: (data) => {
53
53
  this.newBlockReceived(data.header.height);
54
- }
54
+ },
55
55
  };
56
56
  this.asyncEmit = async (type, event) => {
57
57
  event.uuid = (0, uuid_1.v4)();
58
- // More than 1 listener can be registered for an event type
59
- // Fortunately these are all set up during module init() so we have a consistent count
60
- // so we can count responses to resolve when complete
61
- // values are irrelevant as promise resolution is only used for flow control
58
+ /*
59
+ * More than 1 listener can be registered for an event type
60
+ * Fortunately these are all set up during module init() so we have a consistent count
61
+ * so we can count responses to resolve when complete
62
+ * values are irrelevant as promise resolution is only used for flow control
63
+ */
62
64
  let listenerCount = this.handled.get(type);
63
65
  if (!listenerCount) {
64
66
  // Setting listenerCount to 1 (the unhandled listener)
@@ -89,7 +91,7 @@ class EcleciaIndexer extends emitter_1.EclesiaEmitter {
89
91
  };
90
92
  this.config = {
91
93
  ...exports.defaultIndexerConfig,
92
- ...config
94
+ ...config,
93
95
  };
94
96
  if (this.config.minimal) {
95
97
  this.blockQueue = new promise_queue_1.CircularBuffer(this.config.batchSize);
@@ -97,43 +99,51 @@ class EcleciaIndexer extends emitter_1.EclesiaEmitter {
97
99
  else {
98
100
  this.blockQueue = new promise_queue_1.CircularBuffer(this.config.batchSize);
99
101
  }
100
- const { printf } = winston_1.default.format;
101
- const eclesiaFormat = printf(({ level, message, timestamp }) => {
102
+ const { printf, } = winston_1.default.format;
103
+ const eclesiaFormat = printf(({ level, message, timestamp, }) => {
102
104
  return `${timestamp} [${level.toUpperCase()}]:\t${message}`;
103
105
  });
104
106
  this.log = winston_1.default.createLogger({
105
107
  level: this.config.logLevel,
106
- defaultMeta: { service: "Eclesia Indexer" },
108
+ defaultMeta: {
109
+ service: "Eclesia Indexer",
110
+ },
107
111
  transports: [
108
112
  new winston_1.default.transports.File({
109
113
  filename: "error.log",
110
- level: "error"
114
+ level: "error",
115
+ }),
116
+ new winston_1.default.transports.File({
117
+ filename: "combined.log",
111
118
  }),
112
- new winston_1.default.transports.File({ filename: "combined.log" }),
113
119
  new winston_1.default.transports.Console({
114
- format: winston_1.default.format.combine(winston_1.default.format.splat(), winston_1.default.format.timestamp(), eclesiaFormat, winston_1.default.format.colorize({ all: true }))
115
- })
116
- ]
120
+ format: winston_1.default.format.combine(winston_1.default.format.splat(), winston_1.default.format.timestamp(), eclesiaFormat, winston_1.default.format.colorize({
121
+ all: true,
122
+ })),
123
+ }),
124
+ ],
117
125
  });
118
126
  this.fastify = (0, fastify_1.default)({
119
- logger: false
127
+ logger: false,
120
128
  });
121
129
  this.on("_unhandled", (msg) => {
122
130
  if (msg.uuid) {
123
131
  this.log.verbose("Unhandled event: " + msg.type);
124
132
  this.emit("uuid", {
125
133
  status: true,
126
- uuid: msg.uuid
134
+ uuid: msg.uuid,
127
135
  });
128
136
  }
129
137
  });
130
138
  this.fastify.get("/health", async (_request, reply) => {
131
- const code = this.healthCheck.status == "OK" ? 200 : 503;
139
+ const code = this.healthCheck.status == "OK"
140
+ ? 200
141
+ : 503;
132
142
  reply.code(code).send(this.healthCheck);
133
143
  });
134
144
  this.fastify.listen({
135
145
  port: 80,
136
- host: "0.0.0.0"
146
+ host: "0.0.0.0",
137
147
  }, (err) => {
138
148
  if (err) {
139
149
  this.log.error(err);
@@ -154,27 +164,29 @@ class EcleciaIndexer extends emitter_1.EclesiaEmitter {
154
164
  }
155
165
  async connect() {
156
166
  try {
157
- this.client.disconnect();
158
- this.blockClient.disconnect();
159
- }
160
- catch (e) {
161
- this.log.error("Error disconnecting from RPC: " + e);
162
- }
163
- try {
167
+ if (this.client && this.tryToRecover) {
168
+ this.log.verbose("Recover from error. Attempting to disconnect from RPC");
169
+ this.client.disconnect();
170
+ this.blockClient.disconnect();
171
+ this.log.verbose("Disconnected from RPC");
172
+ }
164
173
  this.client = await (0, tendermint_rpc_2.connectComet)(this.config.rpcUrl);
165
174
  this.log.info("Connected to RPC for ad hoc queries");
166
175
  this.blockClient = await (0, tendermint_rpc_2.connectComet)(this.config.rpcUrl);
167
176
  this.log.info("Connected to RPC for block & validator info");
168
- this.rpcOk = true;
169
177
  return true;
170
178
  }
171
179
  catch (error) {
172
180
  this.log.error(error);
173
- this.rpcOk = false;
181
+ this.tryToRecover = true;
174
182
  return false;
175
183
  }
176
184
  }
177
185
  async start() {
186
+ if (this.blockQueue) {
187
+ this.blockQueue.clear();
188
+ this.log.verbose("Starting, clearing block queue");
189
+ }
178
190
  if (!this.initialized) {
179
191
  try {
180
192
  if (this.config.init) {
@@ -200,13 +212,18 @@ class EcleciaIndexer extends emitter_1.EclesiaEmitter {
200
212
  }
201
213
  this.initialized = true;
202
214
  }
203
- this.subscription = null;
204
215
  try {
205
216
  await this.connect();
206
- this.subscription = this.client.subscribeNewBlock ? this.client.subscribeNewBlock() : null;
217
+ if (!this.config.usePolling && this.subscription) {
218
+ this.subscription.removeListener(this.blockListener);
219
+ this.subscription = null;
220
+ this.log.verbose("Removed existing block listener and subscription");
221
+ }
222
+ this.subscription = this.client.subscribeNewBlock
223
+ ? this.client.subscribeNewBlock()
224
+ : null;
207
225
  const status = await this.client.status();
208
226
  this.latestHeight = status.syncInfo.latestBlockHeight;
209
- this.blockQueue.clear();
210
227
  this.log.info("Current chain height: " + this.latestHeight);
211
228
  this.heightToProcess = await this.config.getNextHeight();
212
229
  if (this.config.usePolling) {
@@ -232,11 +249,11 @@ class EcleciaIndexer extends emitter_1.EclesiaEmitter {
232
249
  });
233
250
  const hrTime = process.hrtime();
234
251
  let ms = hrTime[0] * 1000000 + hrTime[1] / 1000;
235
- while (this.blockQueue.size() > 0) {
252
+ while (this.blockQueue.size() > 0 && !this.tryToRecover) {
236
253
  // await the dequeued promise is essentially awaiting fetched data for that block
237
254
  try {
238
- if (!this.rpcOk) {
239
- throw new Error("RPC not responding");
255
+ if (this.tryToRecover) {
256
+ throw new Error("Exiting processing loop. Attempting to recover indexer");
240
257
  }
241
258
  // Index block inside a db transaction to ensure data consistency
242
259
  await this.config.beginTransaction();
@@ -274,21 +291,21 @@ class EcleciaIndexer extends emitter_1.EclesiaEmitter {
274
291
  await this.asyncEmit("periodic/1000", {
275
292
  value: null,
276
293
  height,
277
- timestamp
294
+ timestamp,
278
295
  });
279
296
  }
280
297
  if (height % 100 == 0) {
281
298
  await this.asyncEmit("periodic/100", {
282
299
  value: null,
283
300
  height,
284
- timestamp
301
+ timestamp,
285
302
  });
286
303
  }
287
304
  if (height % 50 == 0) {
288
305
  await this.asyncEmit("periodic/50", {
289
306
  value: null,
290
307
  height,
291
- timestamp
308
+ timestamp,
292
309
  });
293
310
  }
294
311
  this.log.silly("Handled periodic events");
@@ -299,9 +316,7 @@ class EcleciaIndexer extends emitter_1.EclesiaEmitter {
299
316
  this.log.error("" + e);
300
317
  this.setStatus("FAILED");
301
318
  await this.config.endTransaction(false);
302
- if (this.subscription) {
303
- this.subscription.removeListener(this.blockListener);
304
- }
319
+ this.tryToRecover = true;
305
320
  this.retryCount++;
306
321
  break;
307
322
  }
@@ -329,32 +344,34 @@ class EcleciaIndexer extends emitter_1.EclesiaEmitter {
329
344
  // Initialize height & timestamp to be used for this block-processing run
330
345
  const timestamp = (0, tendermint_rpc_1.toRfc3339WithNanoseconds)(block.block.header.time);
331
346
  // Use & await asyncEmit to ensure db insertions in order
332
- // Emit block information to any interested modules.
333
- // Primarily the required block module listens to this
347
+ /*
348
+ * Emit block information to any interested modules.
349
+ * Primarily the required block module listens to this
350
+ */
334
351
  await this.asyncEmit("block", {
335
352
  value: {
336
353
  block,
337
- block_results
354
+ block_results,
338
355
  },
339
356
  height,
340
- timestamp
357
+ timestamp,
341
358
  });
342
359
  this.log.silly("Modules handled block event");
343
360
  // Deal with begin_block events first
344
361
  await this.asyncEmit("begin_block", {
345
362
  value: {
346
363
  events: block_results.beginBlockEvents,
347
- validators
364
+ validators,
348
365
  },
349
366
  height,
350
- timestamp
367
+ timestamp,
351
368
  });
352
369
  this.log.silly("Modules handled begin_block events");
353
370
  // Then individual tx_events
354
371
  await this.asyncEmit("tx_events", {
355
372
  value: block_results.results,
356
373
  height,
357
- timestamp
374
+ timestamp,
358
375
  });
359
376
  this.log.silly("Modules handled tx events");
360
377
  // Emit details and result for each tx msg separately
@@ -367,14 +384,15 @@ class EcleciaIndexer extends emitter_1.EclesiaEmitter {
367
384
  continue;
368
385
  }
369
386
  if (tx.body && tx.body.memo != "") {
370
- const txHash = (0, node_crypto_1.createHash)("sha256").update(block.block.txs[t]).digest("hex");
387
+ const txHash = (0, node_crypto_1.createHash)("sha256").update(block.block.txs[t])
388
+ .digest("hex");
371
389
  await this.asyncEmit("tx_memo", {
372
390
  value: {
373
391
  txHash,
374
- txBody: tx.body
392
+ txBody: tx.body,
375
393
  },
376
394
  height,
377
- timestamp
395
+ timestamp,
378
396
  });
379
397
  }
380
398
  // parsing log rather than using events directly in order to have msg_index available to filter appropriate events for each msg
@@ -386,15 +404,15 @@ class EcleciaIndexer extends emitter_1.EclesiaEmitter {
386
404
  for (let i = 0; i < msgs.length; i++) {
387
405
  this.log.silly("Indexer broadcasting msg for handling: " + msgs[i].typeUrl);
388
406
  const msgevents = msgs.length > 1
389
- ? events.find((x) => x.msg_index == i)?.events
407
+ ? events.find(x => x.msg_index == i)?.events
390
408
  : events[0].events;
391
409
  await this.asyncEmit(msgs[i].typeUrl, {
392
410
  value: {
393
411
  tx: msgs[i].value,
394
- events: msgevents
412
+ events: msgevents,
395
413
  },
396
414
  height,
397
- timestamp
415
+ timestamp,
398
416
  });
399
417
  if (msgs[i].typeUrl == "/cosmos.authz.v1beta1.MsgExec") {
400
418
  const authzMsgs = tx_1.MsgExec.decode(msgs[i].value).msgs;
@@ -410,10 +428,10 @@ class EcleciaIndexer extends emitter_1.EclesiaEmitter {
410
428
  await this.asyncEmit(authzMsgs[r].typeUrl, {
411
429
  value: {
412
430
  tx: authzMsgs[r].value,
413
- events: authzMsgEvents
431
+ events: authzMsgEvents,
414
432
  },
415
433
  height,
416
- timestamp
434
+ timestamp,
417
435
  });
418
436
  }
419
437
  }
@@ -426,7 +444,7 @@ class EcleciaIndexer extends emitter_1.EclesiaEmitter {
426
444
  await this.asyncEmit("end_block", {
427
445
  value: block_results.endBlockEvents,
428
446
  height,
429
- timestamp
447
+ timestamp,
430
448
  });
431
449
  this.log.silly("Modules handled end_block events");
432
450
  if (this.config.logLevel == "silly") {
@@ -436,7 +454,6 @@ class EcleciaIndexer extends emitter_1.EclesiaEmitter {
436
454
  }
437
455
  }
438
456
  async fetcher() {
439
- let error = false;
440
457
  for (let i = this.heightToProcess; i <= this.latestHeight; i++) {
441
458
  this.log.debug("Fetching: " + i);
442
459
  try {
@@ -444,12 +461,9 @@ class EcleciaIndexer extends emitter_1.EclesiaEmitter {
444
461
  const timeoutPromise = new Promise((resolve, reject) => {
445
462
  setTimeout(reject, 20000, false);
446
463
  });
447
- const toIndex = Promise.race([Promise.all([
448
- this.blockClient.block(i),
449
- this.blockClient.blockResults(i)
450
- ]), timeoutPromise]).catch((e) => {
464
+ const toIndex = Promise.race([Promise.all([this.blockClient.block(i), this.blockClient.blockResults(i)]), timeoutPromise]).catch((e) => {
451
465
  this.log.error("Error fetching block: " + i + " : " + e);
452
- this.rpcOk = false;
466
+ this.tryToRecover = true;
453
467
  return Promise.resolve([]);
454
468
  });
455
469
  this.blockQueue.enqueue(toIndex);
@@ -458,53 +472,61 @@ class EcleciaIndexer extends emitter_1.EclesiaEmitter {
458
472
  const timeoutPromise = new Promise((resolve, reject) => {
459
473
  setTimeout(reject, 20000, false);
460
474
  });
461
- const q = query_1.QueryValidatorsRequest.fromPartial({ pagination: { limit: 1000n } });
475
+ const q = query_1.QueryValidatorsRequest.fromPartial({
476
+ pagination: {
477
+ limit: 1000n,
478
+ },
479
+ });
462
480
  const vals = query_1.QueryValidatorsRequest.encode(q).finish();
463
- const toIndex = Promise.race([Promise.all([
481
+ const toIndex = Promise.race([
482
+ Promise.all([
464
483
  this.blockClient.block(i),
465
484
  this.blockClient.blockResults(i),
466
- this.callABCI("/cosmos.staking.v1beta1.Query/Validators", vals, i, false)
467
- ]), timeoutPromise]).catch((e) => {
485
+ this.callABCI("/cosmos.staking.v1beta1.Query/Validators", vals, i, false),
486
+ ]),
487
+ timeoutPromise,
488
+ ]).catch((e) => {
468
489
  this.log.error("Error fetching block: " + i + " : " + e);
469
- this.rpcOk = false;
490
+ this.tryToRecover = true;
470
491
  return Promise.resolve([]);
471
492
  });
472
493
  this.blockQueue.enqueue(toIndex);
473
494
  }
474
495
  await this.blockQueue.continue();
475
- if (!this.rpcOk) {
496
+ if (this.tryToRecover) {
476
497
  throw new Error("RPC not responding");
477
498
  }
478
499
  }
479
500
  catch (e) {
480
501
  this.log.error(e);
481
- error = true;
482
502
  break;
483
503
  }
484
504
  }
485
- if (!error) {
505
+ if (!this.tryToRecover) {
486
506
  this.blockQueue.setSynced();
487
507
  this.log.info("Synced to latest height");
488
508
  }
489
509
  }
490
510
  async callABCI(path, data, height, adHoc = true) {
491
511
  try {
492
- const abciq = await (adHoc ? this.client : this.blockClient).abciQuery({
512
+ const abciq = await (adHoc
513
+ ? this.client
514
+ : this.blockClient).abciQuery({
493
515
  path,
494
516
  data,
495
- height: height
517
+ height: height,
496
518
  });
497
519
  if (abciq) {
498
520
  return abciq.value;
499
521
  }
500
522
  else {
501
- this.rpcOk = false;
523
+ this.tryToRecover = true;
502
524
  this.setStatus("FAILED");
503
525
  throw new Error("RPC not responding. Query at: " + path);
504
526
  }
505
527
  }
506
528
  catch (_e) {
507
- this.rpcOk = false;
529
+ this.tryToRecover = true;
508
530
  this.setStatus("FAILED");
509
531
  throw new Error("RPC not responding. Query at: " + path);
510
532
  }
@@ -515,26 +537,27 @@ class EcleciaIndexer extends emitter_1.EclesiaEmitter {
515
537
  if (this.blockQueue.synced) {
516
538
  if (this.blockQueue.size() + 1 == this.config.batchSize) {
517
539
  this.log.error("Block queue is full. Cannot add new block");
518
- this.rpcOk = false;
540
+ this.tryToRecover = true;
519
541
  return;
520
542
  }
521
543
  try {
522
544
  if (this.isMinimal(this.blockQueue)) {
523
- this.blockQueue.enqueue(Promise.all([
524
- this.client.block(height),
525
- this.client.blockResults(height)
526
- ]).catch((e) => {
545
+ this.blockQueue.enqueue(Promise.all([this.client.block(height), this.client.blockResults(height)]).catch((e) => {
527
546
  this.log.error("Error fetching block: " + height + " : " + e);
528
547
  return Promise.resolve([]);
529
548
  }));
530
549
  }
531
550
  else {
532
- const q = query_1.QueryValidatorsRequest.fromPartial({ pagination: { limit: 1000n } });
551
+ const q = query_1.QueryValidatorsRequest.fromPartial({
552
+ pagination: {
553
+ limit: 1000n,
554
+ },
555
+ });
533
556
  const vals = query_1.QueryValidatorsRequest.encode(q).finish();
534
557
  this.blockQueue.enqueue(Promise.all([
535
558
  this.client.block(height),
536
559
  this.client.blockResults(height),
537
- this.callABCI("/cosmos.staking.v1beta1.Query/Validators", vals, height, false)
560
+ this.callABCI("/cosmos.staking.v1beta1.Query/Validators", vals, height, false),
538
561
  ]).catch((e) => {
539
562
  this.log.error("Error fetching block: " + height + " : " + e);
540
563
  return Promise.resolve([]);
@@ -572,9 +595,19 @@ class EcleciaIndexer extends emitter_1.EclesiaEmitter {
572
595
  const readPromise = new Promise((resolve, reject) => {
573
596
  try {
574
597
  const filters = path.split(".");
575
- const pickers = filters.map((filter) => (0, Pick_1.pick)({ filter }));
598
+ const pickers = filters.map(filter => (0, Pick_1.pick)({
599
+ filter,
600
+ }));
576
601
  let counter = 0;
577
- (0, stream_chain_1.chain)([this.readGenesis(), ...pickers, (0, StreamArray_1.streamArray)(), (0, Batch_1.batch)({ batchSize: 1000 }), processor])
602
+ (0, stream_chain_1.chain)([
603
+ this.readGenesis(),
604
+ ...pickers,
605
+ (0, StreamArray_1.streamArray)(),
606
+ (0, Batch_1.batch)({
607
+ batchSize: 1000,
608
+ }),
609
+ processor,
610
+ ])
578
611
  .on("data", (data) => {
579
612
  if (data && Array.isArray(data)) {
580
613
  counter = counter + data.length;
@@ -596,7 +629,9 @@ class EcleciaIndexer extends emitter_1.EclesiaEmitter {
596
629
  const readPromise = new Promise((resolve, reject) => {
597
630
  try {
598
631
  const filters = path.split(".");
599
- const pickers = filters.map((filter) => (0, Pick_1.pick)({ filter }));
632
+ const pickers = filters.map(filter => (0, Pick_1.pick)({
633
+ filter,
634
+ }));
600
635
  let counter = 0;
601
636
  (0, stream_chain_1.chain)([this.readGenesis(), ...pickers, (0, StreamValues_1.streamValues)(), processor])
602
637
  .on("data", (_data) => {
@@ -624,29 +659,38 @@ class EcleciaIndexer extends emitter_1.EclesiaEmitter {
624
659
  const genesisEntry = key.split("/");
625
660
  this.log.verbose("Importing " + key + "...");
626
661
  if (genesisEntry[1] == "array") {
662
+ await this.setArrayReader(genesisEntry[2],
627
663
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
628
- await this.setArrayReader(genesisEntry[2], async (data) => {
629
- await this.asyncEmit(key, { value: data.map((x) => x.value) });
664
+ async (data) => {
665
+ await this.asyncEmit(key, {
666
+ value: data.map((x) => x.value),
667
+ });
630
668
  return data;
631
669
  });
632
670
  }
633
671
  else {
672
+ await this.setValueReader(genesisEntry[2],
634
673
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
635
- await this.setValueReader(genesisEntry[2], async (data) => {
636
- await this.asyncEmit(key, { value: data.value });
674
+ async (data) => {
675
+ await this.asyncEmit(key, {
676
+ value: data.value,
677
+ });
637
678
  return data;
638
679
  });
639
680
  }
640
681
  }
641
682
  }
642
683
  this.log.info("Importing gen TXs...");
684
+ await this.setArrayReader("app_state.genutil.gen_txs",
643
685
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
644
- await this.setArrayReader("app_state.genutil.gen_txs", async (data) => {
686
+ async (data) => {
645
687
  for (let j = 0; j < data.length; j++) {
646
688
  const gentx = data[j].value;
647
689
  for (let i = 0; i < gentx.body.messages.length; i++) {
648
690
  const msg = gentx.body.messages[i];
649
- await this.asyncEmit(("gentx" + msg["@type"]), { value: msg });
691
+ await this.asyncEmit(("gentx" + msg["@type"]), {
692
+ value: msg,
693
+ });
650
694
  }
651
695
  }
652
696
  return data;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/promise-queue/index.ts"],"names":[],"mappings":"AAOA,qBAAa,YAAY,CAAC,CAAC;IACzB,OAAO,CAAC,KAAK,CAAoB;IAEjC,OAAO,CAAC,QAAQ,CAAqC;IAErD,OAAO,CAAC,OAAO,CAA0B;IAElC,MAAM,UAAS;IAEtB,OAAO,CAAC,SAAS,CAAS;IAE1B,OAAO,CAAC,eAAe,CAAmB;gBAE9B,SAAS,EAAE,MAAM;IAY7B,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC;IAiBhC,KAAK;IAWL,OAAO,IAMU,OAAO,CAAC,CAAC,CAAC;IAG3B,QAAQ;IAIR,SAAS;IAIT,OAAO;IAQP,IAAI;CAGL;AAED,qBAAa,cAAc,CAAC,CAAC;IAC3B,OAAO,CAAC,KAAK,CAAoB;IAEjC,OAAO,CAAC,QAAQ,CAAqC;IAErD,OAAO,CAAC,KAAK,CAAa;IAE1B,OAAO,CAAC,IAAI,CAAa;IAEzB,OAAO,CAAC,OAAO,CAA0B;IAElC,MAAM,UAAS;IAEtB,OAAO,CAAC,SAAS,CAAS;IAE1B,OAAO,CAAC,eAAe,CAAmB;IAE1C,OAAO,CAAC,SAAS,CAAa;gBAElB,SAAS,EAAE,MAAM;IAsB7B,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC;IAuBhC,OAAO;IAaP,KAAK;IAoBL,QAAQ;IAIR,SAAS;IAIT,OAAO;IAQP,IAAI;CAGL"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/promise-queue/index.ts"],"names":[],"mappings":"AAOA,qBAAa,YAAY,CAAC,CAAC;IACzB,OAAO,CAAC,KAAK,CAAoB;IAEjC,OAAO,CAAC,QAAQ,CAAqC;IAErD,OAAO,CAAC,OAAO,CAA0B;IAElC,MAAM,UAAS;IAEtB,OAAO,CAAC,SAAS,CAAS;IAE1B,OAAO,CAAC,eAAe,CAAmB;gBAE9B,SAAS,EAAE,MAAM;IAY7B,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC;IAkBhC,KAAK;IAWL,OAAO,IAMU,OAAO,CAAC,CAAC,CAAC;IAG3B,QAAQ;IAIR,SAAS;IAIT,OAAO;IASP,IAAI;CAGL;AAED,qBAAa,cAAc,CAAC,CAAC;IAC3B,OAAO,CAAC,KAAK,CAAoB;IAEjC,OAAO,CAAC,QAAQ,CAAqC;IAErD,OAAO,CAAC,KAAK,CAAa;IAE1B,OAAO,CAAC,IAAI,CAAa;IAEzB,OAAO,CAAC,OAAO,CAA0B;IAElC,MAAM,UAAS;IAEtB,OAAO,CAAC,SAAS,CAAS;IAE1B,OAAO,CAAC,eAAe,CAAmB;IAE1C,OAAO,CAAC,SAAS,CAAa;gBAElB,SAAS,EAAE,MAAM;IAsB7B,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC;IAwBhC,OAAO;IAaP,KAAK;IAoBL,QAAQ;IAIR,SAAS;IAIT,OAAO;IASP,IAAI;CAGL"}
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  /*
3
- This implements an "infinite" FIFO queue of fixed size.
4
- await `continue()` before enqueing items to ensure fixed size (as it only resolves when space available)
5
- await `dequeue()` to pop an item as it will only resolve if the next item is available
6
- size() is always at minimum 1 item which is the promise that will resolve to the next item whenever it is enqueued
7
- */
3
+ *This implements an "infinite" FIFO queue of fixed size.
4
+ *await `continue()` before enqueing items to ensure fixed size (as it only resolves when space available)
5
+ *await `dequeue()` to pop an item as it will only resolve if the next item is available
6
+ *size() is always at minimum 1 item which is the promise that will resolve to the next item whenever it is enqueued
7
+ */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.CircularBuffer = exports.PromiseQueue = void 0;
10
10
  class PromiseQueue {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,MAAM,gDAAgD,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IAClD,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;IAC7E,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;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SACpC,CAAA;KACF,CAAA;IAED,KAAK,EAAE;QACL,KAAK,EAAE;YACL,KAAK,EAAE,aAAa,CAAA;YACpB,aAAa,EAAE,oBAAoB,CAAA;SACpC,CAAA;KACF,CAAA;IACD,SAAS,EAAE;QACT,KAAK,EAAE,oBAAoB,CAAC,gBAAgB,CAAC,CAAA;KAC9C,CAAA;IACD,SAAS,EAAE;QACT,KAAK,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAA;KACvC,CAAA;IACD,OAAO,EAAE;QACP,KAAK,EAAE;YACL,MAAM,EAAE,MAAM,CAAA;YACd,MAAM,EAAE,MAAM,CAAA;SACf,CAAA;KACF,CAAA;IACD,UAAU,EAAE;QACV,IAAI,EAAE,MAAM,CAAA;QACZ,KAAK,EAAE,OAAO,CAAA;KACf,CAAA;IACD,aAAa,EAAE;QACb,KAAK,EAAE,IAAI,CAAA;KACZ,CAAA;IACD,cAAc,EAAE;QACd,KAAK,EAAE,IAAI,CAAA;KACZ,CAAA;IACD,eAAe,EAAE;QACf,KAAK,EAAE,IAAI,CAAA;KACZ,CAAA;CACF,CAAC;AACF,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;IACxB,EAAE,EAAE,CAAC,CAAA;IACL,MAAM,EAAE,KAAK,EAAE,CAAA;CAChB,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,cAAc,CAAA;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAE1B,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAA;CAC/B"}
@@ -1,5 +1,5 @@
1
1
  declare function toHexString(byteArray: number[]): string;
2
2
  declare function keyHashfromAddress(address: string): string;
3
3
  declare function chainAddressfromKeyhash(prefix: string, keyhash: string): string;
4
- export { chainAddressfromKeyhash, keyHashfromAddress, toHexString };
4
+ export { chainAddressfromKeyhash, keyHashfromAddress, toHexString, };
5
5
  //# sourceMappingURL=bech32.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bech32.d.ts","sourceRoot":"","sources":["../../src/utils/bech32.ts"],"names":[],"mappings":"AAEA,iBAAS,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,UAMvC;AACD,iBAAS,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAMnD;AACD,iBAAS,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAI/D;AAED,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"bech32.d.ts","sourceRoot":"","sources":["../../src/utils/bech32.ts"],"names":[],"mappings":"AAIA,iBAAS,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,UAQvC;AACD,iBAAS,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOnD;AACD,iBAAS,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAU/D;AAED,OAAO,EACL,uBAAuB,EAAE,kBAAkB,EAAE,WAAW,GACzD,CAAC"}
@@ -21,5 +21,7 @@ function keyHashfromAddress(address) {
21
21
  }
22
22
  function chainAddressfromKeyhash(prefix, keyhash) {
23
23
  const words = bech32_1.bech32.toWords(Buffer.from(keyhash, "hex"));
24
- return keyhash !== "" ? bech32_1.bech32.encode(prefix, words) : "";
24
+ return keyhash !== ""
25
+ ? bech32_1.bech32.encode(prefix, words)
26
+ : "";
25
27
  }
@@ -1,3 +1,3 @@
1
1
  declare const toPlainObject: (obj: unknown) => any;
2
- export { toPlainObject };
2
+ export { toPlainObject, };
3
3
  //# sourceMappingURL=bigint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bigint.d.ts","sourceRoot":"","sources":["../../src/utils/bigint.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,aAAa,GAAI,KAAK,OAAO,QAGlC,CAAC;AACF,OAAO,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"bigint.d.ts","sourceRoot":"","sources":["../../src/utils/bigint.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,aAAa,GAAI,KAAK,OAAO,QAIlC,CAAC;AACF,OAAO,EACL,aAAa,GACd,CAAC"}
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.toPlainObject = void 0;
4
4
  const toPlainObject = (obj) => {
5
- return JSON.parse(JSON.stringify(obj, (key, value) => typeof value === "bigint" ? value.toString() : value // return everything else unchanged
6
- ));
5
+ return JSON.parse(JSON.stringify(obj, (key, value) => (typeof value === "bigint" ? value.toString() : value)));
7
6
  };
8
7
  exports.toPlainObject = toPlainObject;
@@ -1 +1 @@
1
- {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/utils/text.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,GAAI,GAAG,UAAU,GAAG,MAAM,WAQhD,CAAC"}
1
+ {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/utils/text.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,GAAI,GAAG,UAAU,GAAG,MAAM,WAUhD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclesia/indexer-engine",
3
- "version": "2.5.18",
3
+ "version": "2.6.0",
4
4
  "description": "Core eclesia indexer engine",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,7 +22,7 @@
22
22
  "license": "Apache-2.0",
23
23
  "devDependencies": {
24
24
  "@eslint/js": "^9.24.0",
25
- "@stylistic/eslint-plugin-ts": "^4.2.0",
25
+ "@stylistic/eslint-plugin": "^5.3.1",
26
26
  "@types/node": "^22.14.0",
27
27
  "@types/stream-chain": "^2.1.0",
28
28
  "@types/stream-json": "^1.7.8",