@eclesia/indexer-engine 2.7.2 → 2.7.4
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/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/indexer/index.d.ts +2 -2
- package/dist/indexer/index.d.ts.map +1 -1
- package/dist/indexer/index.js +23 -18
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +3 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from "./emitter";
|
|
2
|
-
export * from "./indexer";
|
|
3
|
-
export * from "./promise-queue";
|
|
4
|
-
export * as Types from "./types";
|
|
5
|
-
export * as Utils from "./utils";
|
|
1
|
+
export * from "./emitter/index.js";
|
|
2
|
+
export * from "./indexer/index.js";
|
|
3
|
+
export * from "./promise-queue/index.js";
|
|
4
|
+
export * as Types from "./types/index.js";
|
|
5
|
+
export * as Utils from "./utils/index.js";
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./emitter";
|
|
2
|
-
export * from "./indexer";
|
|
3
|
-
export * from "./promise-queue";
|
|
4
|
-
export * as Types from "./types";
|
|
5
|
-
export * as Utils from "./utils";
|
|
1
|
+
export * from "./emitter/index.js";
|
|
2
|
+
export * from "./indexer/index.js";
|
|
3
|
+
export * from "./promise-queue/index.js";
|
|
4
|
+
export * as Types from "./types/index.js";
|
|
5
|
+
export * as Utils from "./utils/index.js";
|
package/dist/indexer/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CometClient } from "@cosmjs/tendermint-rpc";
|
|
2
2
|
import winston from "winston";
|
|
3
|
-
import { EclesiaEmitter } from "../emitter";
|
|
4
|
-
import { EcleciaIndexerConfig, EmitFunc, WithHeightAndUUID } from "../types";
|
|
3
|
+
import { EclesiaEmitter } from "../emitter/index.js";
|
|
4
|
+
import { EcleciaIndexerConfig, EmitFunc, WithHeightAndUUID } from "../types/index.js";
|
|
5
5
|
export declare const defaultIndexerConfig: {
|
|
6
6
|
startHeight: number;
|
|
7
7
|
batchSize: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/indexer/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACgC,WAAW,EACjD,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/indexer/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACgC,WAAW,EACjD,MAAM,wBAAwB,CAAC;AAkChC,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EACL,cAAc,EACf,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EACO,oBAAoB,EAAE,QAAQ,EAAqB,iBAAiB,EACjF,MAAM,mBAAmB,CAAC;AAQ3B,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,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;IA2KX,SAAS,EAAE,QAAQ,CAAC,MAAM,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CA2C3D;YAEY,YAAY;YAmJZ,OAAO;IAmER,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,GAAE,OAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IA2BlH,OAAO,CAAC,gBAAgB;YAiDV,YAAY;IAa1B,OAAO,CAAC,WAAW;YASL,cAAc;YAsCd,cAAc;YA4Bd,YAAY;CAkE3B"}
|
package/dist/indexer/index.js
CHANGED
|
@@ -3,21 +3,21 @@ import { createHash, } from "node:crypto";
|
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import { toRfc3339WithNanoseconds, } from "@cosmjs/tendermint-rpc";
|
|
5
5
|
import { connectComet, } from "@cosmjs/tendermint-rpc";
|
|
6
|
-
import { MsgExec, } from "cosmjs-types/cosmos/authz/v1beta1/tx";
|
|
7
|
-
import { QueryValidatorsRequest, QueryValidatorsResponse, } from "cosmjs-types/cosmos/staking/v1beta1/query";
|
|
8
|
-
import { Tx, } from "cosmjs-types/cosmos/tx/v1beta1/tx";
|
|
6
|
+
import { MsgExec, } from "cosmjs-types/cosmos/authz/v1beta1/tx.js";
|
|
7
|
+
import { QueryValidatorsRequest, QueryValidatorsResponse, } from "cosmjs-types/cosmos/staking/v1beta1/query.js";
|
|
8
|
+
import { Tx, } from "cosmjs-types/cosmos/tx/v1beta1/tx.js";
|
|
9
9
|
import Fastify from "fastify";
|
|
10
10
|
import { chain, } from "stream-chain";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
11
|
+
import StreamJson from "stream-json";
|
|
12
|
+
import Pick from "stream-json/filters/Pick.js";
|
|
13
|
+
import StreamArray from "stream-json/streamers/StreamArray.js";
|
|
14
|
+
import StreamValues from "stream-json/streamers/StreamValues.js";
|
|
15
|
+
import Batch from "stream-json/utils/Batch.js";
|
|
16
16
|
import { v4 as uuidv4, } from "uuid";
|
|
17
17
|
import winston from "winston";
|
|
18
|
-
import { EclesiaEmitter, } from "../emitter";
|
|
19
|
-
import { CircularBuffer, } from "../promise-queue";
|
|
20
|
-
import { decodeAttr, } from "../utils";
|
|
18
|
+
import { EclesiaEmitter, } from "../emitter/index.js";
|
|
19
|
+
import { CircularBuffer, } from "../promise-queue/index.js";
|
|
20
|
+
import { decodeAttr, } from "../utils/index.js";
|
|
21
21
|
export const defaultIndexerConfig = {
|
|
22
22
|
startHeight: 1,
|
|
23
23
|
batchSize: 500,
|
|
@@ -310,7 +310,12 @@ export class EcleciaIndexer extends EclesiaEmitter {
|
|
|
310
310
|
catch (e) {
|
|
311
311
|
this.log.error("" + e);
|
|
312
312
|
this.setStatus("FAILED");
|
|
313
|
-
|
|
313
|
+
try {
|
|
314
|
+
await this.config.endTransaction(false);
|
|
315
|
+
}
|
|
316
|
+
catch (dbe) {
|
|
317
|
+
this.log.error("Error ending transaction. Must be a DB error: " + dbe);
|
|
318
|
+
}
|
|
314
319
|
this.tryToRecover = true;
|
|
315
320
|
this.retryCount++;
|
|
316
321
|
break;
|
|
@@ -587,7 +592,7 @@ export class EcleciaIndexer extends EclesiaEmitter {
|
|
|
587
592
|
}
|
|
588
593
|
readGenesis() {
|
|
589
594
|
if (this.config.genesisPath) {
|
|
590
|
-
return fs.createReadStream(this.config.genesisPath).pipe(parser());
|
|
595
|
+
return fs.createReadStream(this.config.genesisPath).pipe(StreamJson.parser());
|
|
591
596
|
}
|
|
592
597
|
else {
|
|
593
598
|
throw new Error("Genesis path not set");
|
|
@@ -597,15 +602,15 @@ export class EcleciaIndexer extends EclesiaEmitter {
|
|
|
597
602
|
const readPromise = new Promise((resolve, reject) => {
|
|
598
603
|
try {
|
|
599
604
|
const filters = path.split(".");
|
|
600
|
-
const pickers = filters.map(filter => pick({
|
|
605
|
+
const pickers = filters.map(filter => Pick.pick({
|
|
601
606
|
filter,
|
|
602
607
|
}));
|
|
603
608
|
let counter = 0;
|
|
604
609
|
chain([
|
|
605
610
|
this.readGenesis(),
|
|
606
611
|
...pickers,
|
|
607
|
-
streamArray(),
|
|
608
|
-
batch({
|
|
612
|
+
StreamArray.streamArray(),
|
|
613
|
+
Batch.batch({
|
|
609
614
|
batchSize: 1000,
|
|
610
615
|
}),
|
|
611
616
|
processor,
|
|
@@ -631,11 +636,11 @@ export class EcleciaIndexer extends EclesiaEmitter {
|
|
|
631
636
|
const readPromise = new Promise((resolve, reject) => {
|
|
632
637
|
try {
|
|
633
638
|
const filters = path.split(".");
|
|
634
|
-
const pickers = filters.map(filter => pick({
|
|
639
|
+
const pickers = filters.map(filter => Pick.pick({
|
|
635
640
|
filter,
|
|
636
641
|
}));
|
|
637
642
|
let counter = 0;
|
|
638
|
-
chain([this.readGenesis(), ...pickers, streamValues(), processor])
|
|
643
|
+
chain([this.readGenesis(), ...pickers, StreamValues.streamValues(), processor])
|
|
639
644
|
.on("data", (_data) => {
|
|
640
645
|
counter++;
|
|
641
646
|
})
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./bech32";
|
|
2
|
-
export * from "./bigint";
|
|
3
|
-
export * from "./text";
|
|
1
|
+
export * from "./bech32.js";
|
|
2
|
+
export * from "./bigint.js";
|
|
3
|
+
export * from "./text.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./bech32";
|
|
2
|
-
export * from "./bigint";
|
|
3
|
-
export * from "./text";
|
|
1
|
+
export * from "./bech32.js";
|
|
2
|
+
export * from "./bigint.js";
|
|
3
|
+
export * from "./text.js";
|