@eclesia/indexer-engine 2.7.4 → 2.7.6
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 +7 -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 -2
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";
|
|
2
|
+
export * from "./indexer";
|
|
3
|
+
export * from "./promise-queue";
|
|
4
|
+
export * as Types from "./types";
|
|
5
|
+
export * as Utils from "./utils";
|
|
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,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export * from "./emitter
|
|
2
|
-
export * from "./indexer
|
|
3
|
-
export * from "./promise-queue
|
|
4
|
-
|
|
5
|
-
export
|
|
1
|
+
export * from "./emitter";
|
|
2
|
+
export * from "./indexer";
|
|
3
|
+
export * from "./promise-queue";
|
|
4
|
+
import * as Types_1 from "./types";
|
|
5
|
+
export { Types_1 as Types };
|
|
6
|
+
import * as Utils_1 from "./utils";
|
|
7
|
+
export { Utils_1 as Utils };
|
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";
|
|
4
|
+
import { EcleciaIndexerConfig, EmitFunc, WithHeightAndUUID } from "../types";
|
|
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;AA4ChC,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EACL,cAAc,EACf,MAAM,YAAY,CAAC;AAIpB,OAAO,EACO,oBAAoB,EAAE,QAAQ,EAAqB,iBAAiB,EACjF,MAAM,UAAU,CAAC;AAQlB,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;CAuE3B"}
|
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";
|
|
7
|
+
import { QueryValidatorsRequest, QueryValidatorsResponse, } from "cosmjs-types/cosmos/staking/v1beta1/query";
|
|
8
|
+
import { Tx, } from "cosmjs-types/cosmos/tx/v1beta1/tx";
|
|
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 { parser, } from "stream-json";
|
|
12
|
+
import { pick, } from "stream-json/filters/Pick";
|
|
13
|
+
import { streamArray, } from "stream-json/streamers/StreamArray";
|
|
14
|
+
import { streamValues, } from "stream-json/streamers/StreamValues";
|
|
15
|
+
import { batch, } from "stream-json/utils/Batch";
|
|
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";
|
|
19
|
+
import { CircularBuffer, } from "../promise-queue";
|
|
20
|
+
import { decodeAttr, } from "../utils";
|
|
21
21
|
export const defaultIndexerConfig = {
|
|
22
22
|
startHeight: 1,
|
|
23
23
|
batchSize: 500,
|
|
@@ -592,7 +592,7 @@ export class EcleciaIndexer extends EclesiaEmitter {
|
|
|
592
592
|
}
|
|
593
593
|
readGenesis() {
|
|
594
594
|
if (this.config.genesisPath) {
|
|
595
|
-
return fs.createReadStream(this.config.genesisPath).pipe(
|
|
595
|
+
return fs.createReadStream(this.config.genesisPath).pipe(parser());
|
|
596
596
|
}
|
|
597
597
|
else {
|
|
598
598
|
throw new Error("Genesis path not set");
|
|
@@ -602,15 +602,15 @@ export class EcleciaIndexer extends EclesiaEmitter {
|
|
|
602
602
|
const readPromise = new Promise((resolve, reject) => {
|
|
603
603
|
try {
|
|
604
604
|
const filters = path.split(".");
|
|
605
|
-
const pickers = filters.map(filter =>
|
|
605
|
+
const pickers = filters.map(filter => pick({
|
|
606
606
|
filter,
|
|
607
607
|
}));
|
|
608
608
|
let counter = 0;
|
|
609
609
|
chain([
|
|
610
610
|
this.readGenesis(),
|
|
611
611
|
...pickers,
|
|
612
|
-
|
|
613
|
-
|
|
612
|
+
streamArray(),
|
|
613
|
+
batch({
|
|
614
614
|
batchSize: 1000,
|
|
615
615
|
}),
|
|
616
616
|
processor,
|
|
@@ -636,11 +636,11 @@ export class EcleciaIndexer extends EclesiaEmitter {
|
|
|
636
636
|
const readPromise = new Promise((resolve, reject) => {
|
|
637
637
|
try {
|
|
638
638
|
const filters = path.split(".");
|
|
639
|
-
const pickers = filters.map(filter =>
|
|
639
|
+
const pickers = filters.map(filter => pick({
|
|
640
640
|
filter,
|
|
641
641
|
}));
|
|
642
642
|
let counter = 0;
|
|
643
|
-
chain([this.readGenesis(), ...pickers,
|
|
643
|
+
chain([this.readGenesis(), ...pickers, streamValues(), processor])
|
|
644
644
|
.on("data", (_data) => {
|
|
645
645
|
counter++;
|
|
646
646
|
})
|
|
@@ -706,7 +706,12 @@ export class EcleciaIndexer extends EclesiaEmitter {
|
|
|
706
706
|
this.log.info("Finished importing");
|
|
707
707
|
}
|
|
708
708
|
catch (e) {
|
|
709
|
-
|
|
709
|
+
try {
|
|
710
|
+
await this.config.endTransaction(false);
|
|
711
|
+
}
|
|
712
|
+
catch (dbe) {
|
|
713
|
+
this.log.error("Error ending transaction. Must be a DB error: " + dbe);
|
|
714
|
+
}
|
|
710
715
|
this.log.error("Failed to import genesis");
|
|
711
716
|
throw e;
|
|
712
717
|
}
|
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";
|
|
2
|
+
export * from "./bigint";
|
|
3
|
+
export * from "./text";
|
|
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,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,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";
|
|
2
|
+
export * from "./bigint";
|
|
3
|
+
export * from "./text";
|
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclesia/indexer-engine",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.6",
|
|
4
4
|
"description": "Core eclesia indexer engine",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
-
"type": "module",
|
|
8
7
|
"scripts": {
|
|
9
8
|
"build": "tsc",
|
|
10
9
|
"lint": "eslint",
|