@subql/node-ethereum 2.9.3-3 → 2.9.3-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/LICENSE +674 -201
- package/dist/.tsbuildinfo +1 -1
- package/dist/app.module.js +2 -2
- package/dist/app.module.js.map +1 -1
- package/dist/configure/SubqueryProject.js +2 -2
- package/dist/configure/SubqueryProject.js.map +1 -1
- package/dist/configure/configure.module.js +2 -2
- package/dist/configure/configure.module.js.map +1 -1
- package/dist/ethereum/api.connection.js +2 -2
- package/dist/ethereum/api.connection.js.map +1 -1
- package/dist/ethereum/api.ethereum.js +2 -2
- package/dist/ethereum/api.ethereum.js.map +1 -1
- package/dist/ethereum/api.ethereum.test.js +2 -2
- package/dist/ethereum/api.ethereum.test.js.map +1 -1
- package/dist/ethereum/api.service.ethereum.js +2 -2
- package/dist/ethereum/api.service.ethereum.js.map +1 -1
- package/dist/ethereum/api.service.ethereum.test.js +2 -2
- package/dist/ethereum/api.service.ethereum.test.js.map +1 -1
- package/dist/ethereum/block.ethereum.js +2 -2
- package/dist/ethereum/block.ethereum.js.map +1 -1
- package/dist/ethereum/index.js +2 -2
- package/dist/ethereum/index.js.map +1 -1
- package/dist/ethereum/safe-api.js +2 -2
- package/dist/ethereum/safe-api.js.map +1 -1
- package/dist/ethereum/utils.ethereum.js +2 -2
- package/dist/ethereum/utils.ethereum.js.map +1 -1
- package/dist/indexer/blockDispatcher/block-dispatcher.service.js +2 -2
- package/dist/indexer/blockDispatcher/block-dispatcher.service.js.map +1 -1
- package/dist/indexer/blockDispatcher/index.js +2 -2
- package/dist/indexer/blockDispatcher/index.js.map +1 -1
- package/dist/indexer/blockDispatcher/worker-block-dispatcher.service.js +2 -2
- package/dist/indexer/blockDispatcher/worker-block-dispatcher.service.js.map +1 -1
- package/dist/indexer/dictionary.service.js +2 -2
- package/dist/indexer/dictionary.service.js.map +1 -1
- package/dist/indexer/ds-processor.service.js +2 -2
- package/dist/indexer/ds-processor.service.js.map +1 -1
- package/dist/indexer/dynamic-ds.service.js +2 -2
- package/dist/indexer/dynamic-ds.service.js.map +1 -1
- package/dist/indexer/fetch.module.js +2 -2
- package/dist/indexer/fetch.module.js.map +1 -1
- package/dist/indexer/fetch.service.js +2 -2
- package/dist/indexer/fetch.service.js.map +1 -1
- package/dist/indexer/fetch.service.spec.js +2 -2
- package/dist/indexer/fetch.service.spec.js.map +1 -1
- package/dist/indexer/indexer.manager.js +2 -2
- package/dist/indexer/indexer.manager.js.map +1 -1
- package/dist/indexer/indexer.module.js +2 -2
- package/dist/indexer/indexer.module.js.map +1 -1
- package/dist/indexer/project.service.js +2 -2
- package/dist/indexer/project.service.js.map +1 -1
- package/dist/indexer/sandbox.service.js +2 -2
- package/dist/indexer/sandbox.service.js.map +1 -1
- package/dist/indexer/types.js +2 -2
- package/dist/indexer/types.js.map +1 -1
- package/dist/indexer/unfinalizedBlocks.service.js +2 -2
- package/dist/indexer/unfinalizedBlocks.service.js.map +1 -1
- package/dist/indexer/worker/worker.js +2 -2
- package/dist/indexer/worker/worker.js.map +1 -1
- package/dist/indexer/worker/worker.module.js +2 -2
- package/dist/indexer/worker/worker.module.js.map +1 -1
- package/dist/indexer/worker/worker.service.js +2 -2
- package/dist/indexer/worker/worker.service.js.map +1 -1
- package/dist/indexer/worker/worker.unfinalizedBlocks.service.js +2 -2
- package/dist/indexer/worker/worker.unfinalizedBlocks.service.js.map +1 -1
- package/dist/init.js +2 -2
- package/dist/init.js.map +1 -1
- package/dist/main.js +2 -2
- package/dist/main.js.map +1 -1
- package/dist/meta/meta.controller.js +2 -2
- package/dist/meta/meta.controller.js.map +1 -1
- package/dist/meta/meta.module.js +2 -2
- package/dist/meta/meta.module.js.map +1 -1
- package/dist/meta/meta.service.js +2 -2
- package/dist/meta/meta.service.js.map +1 -1
- package/dist/subcommands/forceClean.init.js +2 -2
- package/dist/subcommands/forceClean.init.js.map +1 -1
- package/dist/subcommands/forceClean.module.js +2 -2
- package/dist/subcommands/forceClean.module.js.map +1 -1
- package/dist/subcommands/mmrMigrate.init.js +2 -2
- package/dist/subcommands/mmrMigrate.init.js.map +1 -1
- package/dist/subcommands/mmrMigrate.module.js +2 -2
- package/dist/subcommands/mmrMigrate.module.js.map +1 -1
- package/dist/subcommands/mmrRegenerate.init.js +2 -2
- package/dist/subcommands/mmrRegenerate.init.js.map +1 -1
- package/dist/subcommands/mmrRegenerate.module.js +2 -2
- package/dist/subcommands/mmrRegenerate.module.js.map +1 -1
- package/dist/subcommands/reindex.init.js +2 -2
- package/dist/subcommands/reindex.init.js.map +1 -1
- package/dist/subcommands/reindex.module.js +2 -2
- package/dist/subcommands/reindex.module.js.map +1 -1
- package/dist/subcommands/reindex.service.js +2 -2
- package/dist/subcommands/reindex.service.js.map +1 -1
- package/dist/subcommands/testing.init.js +2 -2
- package/dist/subcommands/testing.init.js.map +1 -1
- package/dist/subcommands/testing.module.js +2 -2
- package/dist/subcommands/testing.module.js.map +1 -1
- package/dist/subcommands/testing.service.js +2 -2
- package/dist/subcommands/testing.service.js.map +1 -1
- package/dist/utils/project.js +2 -2
- package/dist/utils/project.js.map +1 -1
- package/dist/utils/string.js +2 -2
- package/dist/utils/string.js.map +1 -1
- package/dist/yargs.js +2 -2
- package/dist/yargs.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mmrRegenerate.init.js","sourceRoot":"","sources":["../../src/subcommands/mmrRegenerate.init.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"mmrRegenerate.init.js","sourceRoot":"","sources":["../../src/subcommands/mmrRegenerate.init.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;AAEnC,uCAA2C;AAC3C,gDAAmE;AACnE,iEAA6D;AAE7D,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,kBAAkB,CAAC,CAAC;AAEtC,KAAK,UAAU,iBAAiB,CACrC,SAAS,GAAG,KAAK,EACjB,SAAS,GAAG,KAAK,EACjB,MAAM,GAAG,KAAK,EACd,YAAqB;IAErB,IAAI;QACF,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAC,0CAAmB,CAAC,CAAC;QAC1D,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QACjB,MAAM,oBAAoB,GAAG,GAAG,CAAC,GAAG,CAAC,gCAAoB,CAAC,CAAC;QAC3D,GAAG,CAAC,mBAAmB,EAAE,CAAC;QAC1B,MAAM,oBAAoB,CAAC,IAAI,EAAE,CAAC;QAClC,IAAI,CAAC,SAAS,EAAE;YACd,MAAM,oBAAoB,CAAC,UAAU,CAAC,YAAY,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;SACxE;KACF;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,mCAAmC,CAAC,CAAC;QACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AApBD,8CAoBC","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { NestFactory } from '@nestjs/core';\nimport { getLogger, MmrRegenerateService } from '@subql/node-core';\nimport { MmrRegenerateModule } from './mmrRegenerate.module';\n\nconst logger = getLogger('MMR-Regeneration');\n\nexport async function mmrRegenerateInit(\n probeMode = false,\n resetOnly = false,\n unsafe = false,\n targetHeight?: number,\n): Promise<void> {\n try {\n const app = await NestFactory.create(MmrRegenerateModule);\n await app.init();\n const mmrRegenerateService = app.get(MmrRegenerateService);\n app.enableShutdownHooks();\n await mmrRegenerateService.init();\n if (!probeMode) {\n await mmrRegenerateService.regenerate(targetHeight, resetOnly, unsafe);\n }\n } catch (e) {\n logger.error(e, 'Re-generate MMR failed to execute');\n process.exit(1);\n }\n process.exit(0);\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2020-
|
|
3
|
-
// SPDX-License-Identifier:
|
|
2
|
+
// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors
|
|
3
|
+
// SPDX-License-Identifier: GPL-3.0
|
|
4
4
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
5
5
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6
6
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mmrRegenerate.module.js","sourceRoot":"","sources":["../../src/subcommands/mmrRegenerate.module.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"mmrRegenerate.module.js","sourceRoot":"","sources":["../../src/subcommands/mmrRegenerate.module.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;AAEnC,2CAAwC;AACxC,yDAA2D;AAC3D,gDAAwE;AACxE,oEAAgE;AAWzD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAAG,CAAA;AAAtB,mBAAmB;IAT/B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,oBAAQ,CAAC,OAAO,EAAE;YAClB,kCAAe,CAAC,QAAQ,EAAE;YAC1B,sCAA0B;YAC1B,kCAAkB,CAAC,OAAO,EAAE;SAC7B;QACD,WAAW,EAAE,EAAE;KAChB,CAAC;GACW,mBAAmB,CAAG;AAAtB,kDAAmB","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { Module } from '@nestjs/common';\nimport { EventEmitterModule } from '@nestjs/event-emitter';\nimport { DbModule, MmrRegenerateFeatureModule } from '@subql/node-core';\nimport { ConfigureModule } from '../configure/configure.module';\n\n@Module({\n imports: [\n DbModule.forRoot(),\n ConfigureModule.register(),\n MmrRegenerateFeatureModule,\n EventEmitterModule.forRoot(),\n ],\n controllers: [],\n})\nexport class MmrRegenerateModule {}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2020-
|
|
3
|
-
// SPDX-License-Identifier:
|
|
2
|
+
// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors
|
|
3
|
+
// SPDX-License-Identifier: GPL-3.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.reindexInit = void 0;
|
|
6
6
|
const core_1 = require("@nestjs/core");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reindex.init.js","sourceRoot":"","sources":["../../src/subcommands/reindex.init.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"reindex.init.js","sourceRoot":"","sources":["../../src/subcommands/reindex.init.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;AAEnC,uCAA2C;AAC3C,gDAA6C;AAC7C,qDAAiD;AACjD,uDAAmD;AAEnD,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,aAAa,CAAC,CAAC;AACjC,KAAK,UAAU,WAAW,CAAC,YAAoB;IACpD,IAAI;QACF,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAC,8BAAa,CAAC,CAAC;QAEpD,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QACjB,MAAM,cAAc,GAAG,GAAG,CAAC,GAAG,CAAC,gCAAc,CAAC,CAAC;QAE/C,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC;QAC5B,MAAM,mBAAmB,GACvB,MAAM,cAAc,CAAC,oCAAoC,CAAC,YAAY,CAAC,CAAC;QAC1E,IAAI,mBAAmB,KAAK,YAAY,EAAE;YACxC,MAAM,CAAC,IAAI,CACT,6BAA6B,YAAY,qCAAqC,mBAAmB,mBAAmB,mBAAmB,EAAE,CAC1I,CAAC;SACH;QACD,MAAM,cAAc,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;KACnD;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,2BAA2B,CAAC,CAAC;QAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AArBD,kCAqBC","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { NestFactory } from '@nestjs/core';\nimport { getLogger } from '@subql/node-core';\nimport { ReindexModule } from './reindex.module';\nimport { ReindexService } from './reindex.service';\n\nconst logger = getLogger('CLI-Reindex');\nexport async function reindexInit(targetHeight: number): Promise<void> {\n try {\n const app = await NestFactory.create(ReindexModule);\n\n await app.init();\n const reindexService = app.get(ReindexService);\n\n await reindexService.init();\n const actualReindexHeight =\n await reindexService.getTargetHeightWithUnfinalizedBlocks(targetHeight);\n if (actualReindexHeight !== targetHeight) {\n logger.info(\n `Found index target height ${targetHeight} beyond indexed unfinalized block ${actualReindexHeight}, will index to ${actualReindexHeight}`,\n );\n }\n await reindexService.reindex(actualReindexHeight);\n } catch (e) {\n logger.error(e, 'Reindex failed to execute');\n process.exit(1);\n }\n process.exit(0);\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2020-
|
|
3
|
-
// SPDX-License-Identifier:
|
|
2
|
+
// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors
|
|
3
|
+
// SPDX-License-Identifier: GPL-3.0
|
|
4
4
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
5
5
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6
6
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reindex.module.js","sourceRoot":"","sources":["../../src/subcommands/reindex.module.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"reindex.module.js","sourceRoot":"","sources":["../../src/subcommands/reindex.module.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;AAEnC,2CAAwC;AACxC,yDAA2D;AAC3D,+CAAqD;AACrD,gDAQ0B;AAC1B,oEAAgE;AAChE,0EAAqE;AACrE,sEAAiE;AACjE,oFAAgF;AAChF,uDAAmD;AAsB5C,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAAG,CAAA;AAAvB,oBAAoB;IApBhC,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT,6BAAiB;YACjB,wBAAY;YACZ,gCAAc;YACd,sBAAU;YACV,6BAAiB;YACjB,6BAAiB;YACjB,oDAAwB;YACxB,qCAAgB;YAChB,yCAAkB;YAClB;gBACE,8EAA8E;gBAC9E,OAAO,EAAE,sBAAU;gBACnB,UAAU,EAAE,GAAG,EAAE,CAAC,SAAS;aAC5B;YACD,4BAAiB;SAClB;QACD,WAAW,EAAE,EAAE;KAChB,CAAC;GACW,oBAAoB,CAAG;AAAvB,oDAAoB;AAW1B,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,aAAa;IATzB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,oBAAQ,CAAC,OAAO,EAAE;YAClB,kCAAe,CAAC,QAAQ,EAAE;YAC1B,oBAAoB;YACpB,kCAAkB,CAAC,OAAO,EAAE;SAC7B;QACD,WAAW,EAAE,EAAE;KAChB,CAAC;GACW,aAAa,CAAG;AAAhB,sCAAa","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { Module } from '@nestjs/common';\nimport { EventEmitterModule } from '@nestjs/event-emitter';\nimport { SchedulerRegistry } from '@nestjs/schedule';\nimport {\n ApiService,\n DbModule,\n ForceCleanService,\n MmrService,\n PgMmrCacheService,\n StoreCacheService,\n StoreService,\n} from '@subql/node-core';\nimport { ConfigureModule } from '../configure/configure.module';\nimport { DsProcessorService } from '../indexer/ds-processor.service';\nimport { DynamicDsService } from '../indexer/dynamic-ds.service';\nimport { UnfinalizedBlocksService } from '../indexer/unfinalizedBlocks.service';\nimport { ReindexService } from './reindex.service';\n\n@Module({\n providers: [\n StoreCacheService,\n StoreService,\n ReindexService,\n MmrService,\n PgMmrCacheService,\n ForceCleanService,\n UnfinalizedBlocksService,\n DynamicDsService,\n DsProcessorService,\n {\n // Used to work with DI for unfinalizedBlocksService but not used with reindex\n provide: ApiService,\n useFactory: () => undefined,\n },\n SchedulerRegistry,\n ],\n controllers: [],\n})\nexport class ReindexFeatureModule {}\n\n@Module({\n imports: [\n DbModule.forRoot(),\n ConfigureModule.register(),\n ReindexFeatureModule,\n EventEmitterModule.forRoot(),\n ],\n controllers: [],\n})\nexport class ReindexModule {}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2020-
|
|
3
|
-
// SPDX-License-Identifier:
|
|
2
|
+
// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors
|
|
3
|
+
// SPDX-License-Identifier: GPL-3.0
|
|
4
4
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
5
5
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6
6
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reindex.service.js","sourceRoot":"","sources":["../../src/subcommands/reindex.service.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"reindex.service.js","sourceRoot":"","sources":["../../src/subcommands/reindex.service.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;;;;;;;AAEnC,2CAAoD;AAEpD,gDAM0B;AAE1B,oDAA+C;AAC/C,kEAA+D;AAC/D,sEAAiE;AACjE,oFAAgF;AAGzE,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,8BAInC;IACC,YACE,SAAoB,EACpB,UAAsB,EACtB,YAA0B,EAC1B,UAAsB,EACM,OAAwB,EACpD,iBAAoC,EACpC,wBAAkD,EAClD,gBAAkC;QAElC,KAAK,CACH,SAAS,EACT,UAAU,EACV,YAAY,EACZ,UAAU,EACV,OAAO,EACP,iBAAiB,EACjB,wBAAwB,EACxB,gBAAgB,CACjB,CAAC;IACJ,CAAC;IAED,4DAA4D;IAClD,KAAK,CAAC,wBAAwB;QAGtC,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;IAClC,CAAC;CACF,CAAA;AAjCY,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAWR,WAAA,IAAA,eAAM,EAAC,kBAAkB,CAAC,CAAA;qCAJhB,uBAAS;QACR,sBAAU;QACR,wBAAY;QACd,sBAAU;QACe,iCAAe;QACjC,6BAAiB;QACV,oDAAwB;QAChC,qCAAgB;GAbzB,cAAc,CAiC1B;AAjCY,wCAAc","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { Inject, Injectable } from '@nestjs/common';\nimport { SubqlEthereumDataSource } from '@subql/common-ethereum';\nimport {\n MmrService,\n NodeConfig,\n StoreService,\n ForceCleanService,\n BaseReindexService,\n} from '@subql/node-core';\nimport { BlockWrapper } from '@subql/types-ethereum';\nimport { Sequelize } from '@subql/x-sequelize';\nimport { SubqueryProject } from '../configure/SubqueryProject';\nimport { DynamicDsService } from '../indexer/dynamic-ds.service';\nimport { UnfinalizedBlocksService } from '../indexer/unfinalizedBlocks.service';\n\n@Injectable()\nexport class ReindexService extends BaseReindexService<\n SubqueryProject,\n SubqlEthereumDataSource,\n BlockWrapper\n> {\n constructor(\n sequelize: Sequelize,\n nodeConfig: NodeConfig,\n storeService: StoreService,\n mmrService: MmrService,\n @Inject('ISubqueryProject') project: SubqueryProject,\n forceCleanService: ForceCleanService,\n unfinalizedBlocksService: UnfinalizedBlocksService,\n dynamicDsService: DynamicDsService,\n ) {\n super(\n sequelize,\n nodeConfig,\n storeService,\n mmrService,\n project,\n forceCleanService,\n unfinalizedBlocksService,\n dynamicDsService,\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/require-await\n protected async getStartBlockDatasources(): Promise<\n SubqlEthereumDataSource[]\n > {\n return this.project.dataSources;\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2020-
|
|
3
|
-
// SPDX-License-Identifier:
|
|
2
|
+
// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors
|
|
3
|
+
// SPDX-License-Identifier: GPL-3.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.testingInit = void 0;
|
|
6
6
|
const core_1 = require("@nestjs/core");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.init.js","sourceRoot":"","sources":["../../src/subcommands/testing.init.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"testing.init.js","sourceRoot":"","sources":["../../src/subcommands/testing.init.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;AAEnC,uCAA2C;AAC3C,gDAAqE;AAErE,gEAA4D;AAC5D,qDAAiD;AACjD,uDAAmD;AAEnD,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,SAAS,CAAC,CAAC;AAC7B,KAAK,UAAU,WAAW;IAC/B,IAAI;QACF,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAC,8BAAa,EAAE;YAClD,MAAM,EAAE,IAAI,sBAAU,EAAE;SACzB,CAAC,CAAC;QAEH,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QACjB,MAAM,cAAc,GAAG,GAAG,CAAC,GAAG,CAAC,gCAAc,CAAC,CAAC;QAE/C,wGAAwG;QACxG,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC;QAE5B,MAAM,cAAc,GAAG,GAAG,CAAC,GAAG,CAAC,gCAAc,CAAC,CAAC;QAC/C,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC;QAC5B,MAAM,cAAc,CAAC,GAAG,EAAE,CAAC;KAC5B;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AApBD,kCAoBC","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { NestFactory } from '@nestjs/core';\nimport { ApiService, getLogger, NestLogger } from '@subql/node-core';\nimport { EthereumApiService } from '../ethereum';\nimport { ProjectService } from '../indexer/project.service';\nimport { TestingModule } from './testing.module';\nimport { TestingService } from './testing.service';\n\nconst logger = getLogger('Testing');\nexport async function testingInit(): Promise<void> {\n try {\n const app = await NestFactory.create(TestingModule, {\n logger: new NestLogger(),\n });\n\n await app.init();\n const projectService = app.get(ProjectService);\n\n // Initialise async services, we do this here rather than in factories, so we can capture one off events\n await projectService.init();\n\n const testingService = app.get(TestingService);\n await testingService.init();\n await testingService.run();\n } catch (e) {\n logger.error(e, 'Testing failed');\n process.exit(1);\n }\n process.exit(0);\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2020-
|
|
3
|
-
// SPDX-License-Identifier:
|
|
2
|
+
// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors
|
|
3
|
+
// SPDX-License-Identifier: GPL-3.0
|
|
4
4
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
5
5
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6
6
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.module.js","sourceRoot":"","sources":["../../src/subcommands/testing.module.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"testing.module.js","sourceRoot":"","sources":["../../src/subcommands/testing.module.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;AAEnC,2CAAwC;AACxC,yDAA0E;AAC1E,+CAAqE;AACrE,gDAO0B;AAC1B,oEAAgE;AAEhE,0CAAiD;AAEjD,0EAAqE;AACrE,sEAAiE;AACjE,0DAAsD;AACtD,gEAA4D;AAC5D,gEAA4D;AAC5D,gEAA4D;AAC5D,oFAAgF;AAChF,qDAAiD;AACjD,uDAAmD;AA0C5C,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAAG,CAAA;AAAvB,oBAAoB;IAxChC,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT,wBAAY;YACZ,gCAAc;YACd,6BAAa;YACb,sBAAU;YACV,gCAAc;YACd,yCAAkB;YAClB,qCAAgB;YAChB,oDAAwB;YACxB,gCAAc;YACd,iCAAqB;YACrB;gBACE,OAAO,EAAE,iBAAiB;gBAC1B,QAAQ,EAAE,gCAAc;aACzB;YACD;gBACE,OAAO,EAAE,sBAAU;gBACnB,UAAU,EAAE,KAAK,EACf,OAAwB,EACxB,qBAAmE,EACnE,YAA2B,EAC3B,EAAE;oBACF,MAAM,UAAU,GAAG,IAAI,6BAAkB,CACvC,OAAO,EACP,qBAAqB,EACrB,YAAY,CACb,CAAC;oBACF,MAAM,UAAU,CAAC,IAAI,EAAE,CAAC;oBACxB,OAAO,UAAU,CAAC;gBACpB,CAAC;gBACD,MAAM,EAAE,CAAC,kBAAkB,EAAE,iCAAqB,EAAE,6BAAa,CAAC;aACnE;YACD,gCAAc;YACd,4BAAiB;SAClB;QAED,OAAO,EAAE,CAAC,wBAAU,EAAE,0BAAW,CAAC;QAClC,WAAW,EAAE,EAAE;KAChB,CAAC;GACW,oBAAoB,CAAG;AAAvB,oDAAoB;AAY1B,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,aAAa;IAVzB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,oBAAQ,CAAC,OAAO,EAAE;YAClB,kCAAe,CAAC,QAAQ,EAAE;YAC1B,kCAAkB,CAAC,OAAO,EAAE;YAC5B,yBAAc,CAAC,OAAO,EAAE;YACxB,oBAAoB;SACrB;QACD,WAAW,EAAE,EAAE;KAChB,CAAC;GACW,aAAa,CAAG;AAAhB,sCAAa","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { Module } from '@nestjs/common';\nimport { EventEmitter2, EventEmitterModule } from '@nestjs/event-emitter';\nimport { ScheduleModule, SchedulerRegistry } from '@nestjs/schedule';\nimport {\n ApiService,\n ConnectionPoolService,\n DbModule,\n NodeConfig,\n PoiService,\n StoreService,\n} from '@subql/node-core';\nimport { ConfigureModule } from '../configure/configure.module';\nimport { SubqueryProject } from '../configure/SubqueryProject';\nimport { EthereumApiService } from '../ethereum';\nimport { EthereumApiConnection } from '../ethereum/api.connection';\nimport { DsProcessorService } from '../indexer/ds-processor.service';\nimport { DynamicDsService } from '../indexer/dynamic-ds.service';\nimport { FetchModule } from '../indexer/fetch.module';\nimport { IndexerManager } from '../indexer/indexer.manager';\nimport { ProjectService } from '../indexer/project.service';\nimport { SandboxService } from '../indexer/sandbox.service';\nimport { UnfinalizedBlocksService } from '../indexer/unfinalizedBlocks.service';\nimport { MetaModule } from '../meta/meta.module';\nimport { TestingService } from './testing.service';\n\n@Module({\n providers: [\n StoreService,\n TestingService,\n EventEmitter2,\n PoiService,\n SandboxService,\n DsProcessorService,\n DynamicDsService,\n UnfinalizedBlocksService,\n ProjectService,\n ConnectionPoolService,\n {\n provide: 'IProjectService',\n useClass: ProjectService,\n },\n {\n provide: ApiService,\n useFactory: async (\n project: SubqueryProject,\n connectionPoolService: ConnectionPoolService<EthereumApiConnection>,\n eventEmitter: EventEmitter2,\n ) => {\n const apiService = new EthereumApiService(\n project,\n connectionPoolService,\n eventEmitter,\n );\n await apiService.init();\n return apiService;\n },\n inject: ['ISubqueryProject', ConnectionPoolService, EventEmitter2],\n },\n IndexerManager,\n SchedulerRegistry,\n ],\n\n imports: [MetaModule, FetchModule],\n controllers: [],\n})\nexport class TestingFeatureModule {}\n\n@Module({\n imports: [\n DbModule.forRoot(),\n ConfigureModule.register(),\n EventEmitterModule.forRoot(),\n ScheduleModule.forRoot(),\n TestingFeatureModule,\n ],\n controllers: [],\n})\nexport class TestingModule {}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2020-
|
|
3
|
-
// SPDX-License-Identifier:
|
|
2
|
+
// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors
|
|
3
|
+
// SPDX-License-Identifier: GPL-3.0
|
|
4
4
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
5
5
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6
6
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.service.js","sourceRoot":"","sources":["../../src/subcommands/testing.service.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"testing.service.js","sourceRoot":"","sources":["../../src/subcommands/testing.service.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;;;;;;;AAEnC,2CAAoD;AACpD,gDAK0B;AAE1B,oDAA+C;AAC/C,kEAA+E;AAG/E,gEAA4D;AAGrD,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,0BAKnC;IACC,YACE,SAAoB,EACpB,UAAsB,EACtB,YAA0B,EACE,OAAwB,EACpD,UAAsB,EACtB,cAA8B;QAE9B,KAAK,CACH,SAAS,EACT,UAAU,EACV,YAAY,EACZ,OAAO,EACP,UAAU,EACV,cAAc,CACf,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,UAAU,CACd,KAA2B,EAC3B,OAAe;QAEf,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9E,CAAC;CACF,CAAA;AA9BY,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAWR,WAAA,IAAA,eAAM,EAAC,kBAAkB,CAAC,CAAA;qCAHhB,uBAAS;QACR,sBAAU;QACR,wBAAY;QACW,iCAAe;QACxC,sBAAU;QACN,gCAAc;GAZrB,cAAc,CA8B1B;AA9BY,wCAAc","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { Inject, Injectable } from '@nestjs/common';\nimport {\n NodeConfig,\n StoreService,\n TestingService as BaseTestingService,\n ApiService,\n} from '@subql/node-core';\nimport { EthereumBlockWrapper } from '@subql/types-ethereum';\nimport { Sequelize } from '@subql/x-sequelize';\nimport { SubqlProjectDs, SubqueryProject } from '../configure/SubqueryProject';\nimport { EthereumApi } from '../ethereum';\nimport SafeEthProvider from '../ethereum/safe-api';\nimport { IndexerManager } from '../indexer/indexer.manager';\n\n@Injectable()\nexport class TestingService extends BaseTestingService<\n EthereumApi,\n SafeEthProvider,\n EthereumBlockWrapper,\n SubqlProjectDs\n> {\n constructor(\n sequelize: Sequelize,\n nodeConfig: NodeConfig,\n storeService: StoreService,\n @Inject('ISubqueryProject') project: SubqueryProject,\n apiService: ApiService,\n indexerManager: IndexerManager,\n ) {\n super(\n sequelize,\n nodeConfig,\n storeService,\n project,\n apiService,\n indexerManager,\n );\n }\n\n async indexBlock(\n block: EthereumBlockWrapper,\n handler: string,\n ): Promise<void> {\n await this.indexerManager.indexBlock(block, this.getDsWithHandler(handler));\n }\n}\n"]}
|
package/dist/utils/project.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2020-
|
|
3
|
-
// SPDX-License-Identifier:
|
|
2
|
+
// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors
|
|
3
|
+
// SPDX-License-Identifier: GPL-3.0
|
|
4
4
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
5
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/utils/project.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/utils/project.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;AAEnC,4CAAoB;AACpB,gDAAwB;AACxB,0CAAoD;AACpD,4DAOgC;AAChC,gDAAwE;AACxE,0DAAgF;AAGhF,SAAgB,aAAa,CAC3B,OAAqB;IAErB,OAAO,MAAM,CAAC,MAAM,CAAS,qCAAmB,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC3E,CAAC;AAJD,sCAIC;AAED,SAAgB,eAAe,CAC7B,OAAqB;IAErB,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAJD,0CAIC;AAED,MAAM,aAAa,GAAG,CAAC,SAAS,CAAC,CAAC;AAClC,4DAA4D;AACrD,KAAK,UAAU,cAAc,CAClC,OAAyB,EACzB,MAA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,qCAAmB,CAAC,IAAI,CAAC;oBACxC,MAAM;iBACP;gBACD,KAAK,kBAAkB,CAAC,CAAC;oBACvB,OAAO,CAAC,IAAI,GAAG,qCAAmB,CAAC,KAAK,CAAC;oBACzC,MAAM;iBACP;gBACD,QAAQ;aACT;YACD,OAAO,OAAO,CAAC;QACjB,CAAC,CACF,CAAC;QAEF,IAAI,UAAU,CAAC,MAAM,EAAE;YACrB,KAAK,MAAM,CAAC,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;gBACzD,IAAI,MAAM,YAAY,oBAAW,EAAE;oBACjC,KAAK,CAAC,IAAI,GAAG,cAAI,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;iBAC7C;qBAAM;oBACL,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;oBAC7C,MAAM,UAAU,GAAG,cAAI,CAAC,OAAO,CAC7B,IAAI,EACJ,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAClC,CAAC;oBACF,MAAM,YAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,EAAE,GAAa,CAAC,CAAC;oBACvD,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;iBACzB;aACF;SACF;QAED,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,IAAA,mCAAuB,EAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,4BAAU,CAAC,CAAC;AAC1E,CAAC;AArDD,wDAqDC","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport fs from 'fs';\nimport path from 'path';\nimport { LocalReader, Reader } from '@subql/common';\nimport {\n SubqlRuntimeHandler,\n SubqlCustomHandler,\n SubqlHandler,\n EthereumHandlerKind,\n SubqlEthereumHandlerKind,\n isCustomDs,\n} from '@subql/common-ethereum';\nimport { retryOnFail, updateDataSourcesV1_0_0 } from '@subql/node-core';\nimport { EthereumDatasourceKind, SubqlDatasource } from '@subql/types-ethereum';\nimport { SubqlProjectDs } from '../configure/SubqueryProject';\n\nexport function isBaseHandler(\n handler: SubqlHandler,\n): handler is SubqlRuntimeHandler {\n return Object.values<string>(EthereumHandlerKind).includes(handler.kind);\n}\n\nexport function isCustomHandler(\n handler: SubqlHandler,\n): handler is SubqlCustomHandler {\n return !isBaseHandler(handler);\n}\n\nconst handledErrors = ['timeout'];\n// eslint-disable-next-line @typescript-eslint/require-await\nexport async function retryOnFailEth<T>(\n request: () => Promise<T>,\n errors = handledErrors,\n): Promise<T> {\n return retryOnFail(request, (e) => !!errors.find((t) => t === e?.reason));\n}\n\nexport function onlyHasLogDataSources(dataSources: SubqlProjectDs[]): boolean {\n for (const ds of dataSources) {\n for (const handler of ds.mapping.handlers) {\n if (\n handler.kind !== SubqlEthereumHandlerKind.EthEvent &&\n handler.kind !== SubqlEthereumHandlerKind.FlareEvent\n ) {\n return false;\n }\n }\n }\n\n return true;\n}\n\nexport async function updateDatasourcesFlare(\n _dataSources: SubqlDatasource[],\n reader: Reader,\n root: string,\n): Promise<SubqlProjectDs[]> {\n // Cast to any to make types happy\n const partialUpdate = await Promise.all(\n _dataSources.map(async (dataSource) => {\n if ((dataSource.kind as string) === 'flare/Runtime') {\n dataSource.kind = EthereumDatasourceKind.Runtime;\n }\n dataSource.mapping.handlers = dataSource.mapping.handlers.map(\n (handler) => {\n switch (handler.kind as string) {\n case 'flare/BlockHandler': {\n handler.kind = EthereumHandlerKind.Block;\n break;\n }\n case 'flare/TransactionHandler': {\n handler.kind = EthereumHandlerKind.Call;\n break;\n }\n case 'flare/LogHandler': {\n handler.kind = EthereumHandlerKind.Event;\n break;\n }\n default:\n }\n return handler;\n },\n );\n\n if (dataSource.assets) {\n for (const [, asset] of Object.entries(dataSource.assets)) {\n if (reader instanceof LocalReader) {\n asset.file = path.resolve(root, asset.file);\n } else {\n const res = await reader.getFile(asset.file);\n const outputPath = path.resolve(\n root,\n asset.file.replace('ipfs://', ''),\n );\n await fs.promises.writeFile(outputPath, res as string);\n asset.file = outputPath;\n }\n }\n }\n\n return dataSource;\n }),\n );\n\n return updateDataSourcesV1_0_0(partialUpdate, reader, root, isCustomDs);\n}\n"]}
|
package/dist/utils/string.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2020-
|
|
3
|
-
// SPDX-License-Identifier:
|
|
2
|
+
// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors
|
|
3
|
+
// SPDX-License-Identifier: GPL-3.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.functionToSighash = exports.eventToTopic = exports.hexStringEq = exports.stringNormalizedEq = void 0;
|
|
6
6
|
const abi_1 = require("@ethersproject/abi");
|
package/dist/utils/string.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.js","sourceRoot":"","sources":["../../src/utils/string.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"string.js","sourceRoot":"","sources":["../../src/utils/string.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;AAEnC,4CAAqE;AACrE,gDAAgF;AAChF,8CAAyC;AAEzC,SAAgB,kBAAkB,CAAC,CAAS,EAAE,CAAS;IACrD,OAAO,CAAC,CAAC,WAAW,EAAE,MAAK,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,WAAW,EAAE,CAAA,CAAC;AAC9C,CAAC;AAFD,gDAEC;AAED,SAAgB,WAAW,CAAC,CAAS,EAAE,CAAS;IAC9C,IAAI,CAAC,IAAA,mBAAW,EAAC,CAAC,CAAC,IAAI,CAAC,IAAA,mBAAW,EAAC,CAAC,CAAC,EAAE;QACtC,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;KAC/C;IACD,OAAO,kBAAkB,CAAC,IAAA,qBAAa,EAAC,CAAC,CAAC,EAAE,IAAA,qBAAa,EAAC,CAAC,CAAC,CAAC,CAAC;AAChE,CAAC;AALD,kCAKC;AAED,MAAM,gBAAgB,GAA2B,EAAE,CAAC;AACpD,MAAM,oBAAoB,GAA2B,EAAE,CAAC;AAExD,SAAgB,YAAY,CAAC,KAAa;IACxC,IAAI,IAAA,mBAAW,EAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAErC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE;QAC5B,gBAAgB,CAAC,KAAK,CAAC,GAAG,IAAA,SAAE,EAAC,mBAAa,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;KACxE;IAED,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC;AARD,oCAQC;AAED,SAAgB,iBAAiB,CAAC,KAAa;IAC7C,IAAI,IAAA,mBAAW,EAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAErC,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE;QAChC,oBAAoB,CAAC,KAAK,CAAC,GAAG,IAAA,oBAAY,EACxC,IAAA,SAAE,EAAC,sBAAgB,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC,EAC/C,CAAC,EACD,CAAC,CACF,CAAC;KACH;IAED,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC;AAZD,8CAYC","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { EventFragment, FunctionFragment } from '@ethersproject/abi';\nimport { isHexString, hexStripZeros, hexDataSlice } from '@ethersproject/bytes';\nimport { id } from '@ethersproject/hash';\n\nexport function stringNormalizedEq(a: string, b: string): boolean {\n return a.toLowerCase() === b?.toLowerCase();\n}\n\nexport function hexStringEq(a: string, b: string): boolean {\n if (!isHexString(a) || !isHexString(b)) {\n throw new Error('Inputs are not hex strings');\n }\n return stringNormalizedEq(hexStripZeros(a), hexStripZeros(b));\n}\n\nconst eventTopicsCache: Record<string, string> = {};\nconst functionSighashCache: Record<string, string> = {};\n\nexport function eventToTopic(input: string): string {\n if (isHexString(input)) return input;\n\n if (!eventTopicsCache[input]) {\n eventTopicsCache[input] = id(EventFragment.fromString(input).format());\n }\n\n return eventTopicsCache[input];\n}\n\nexport function functionToSighash(input: string): string {\n if (isHexString(input)) return input;\n\n if (!functionSighashCache[input]) {\n functionSighashCache[input] = hexDataSlice(\n id(FunctionFragment.fromString(input).format()),\n 0,\n 4,\n );\n }\n\n return functionSighashCache[input];\n}\n"]}
|
package/dist/yargs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright 2020-
|
|
3
|
-
// SPDX-License-Identifier:
|
|
2
|
+
// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors
|
|
3
|
+
// SPDX-License-Identifier: GPL-3.0
|
|
4
4
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
5
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
6
|
};
|
package/dist/yargs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yargs.js","sourceRoot":"","sources":["../src/yargs.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,sCAAsC;;;;;;AAEtC,oDAAqD;AACrD,2CAAwC;AACxC,wDAAgC;AAEnB,QAAA,YAAY,GAAG,IAAA,eAAK,EAAC,IAAA,iBAAO,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KACrD,GAAG,CAAC,YAAY,CAAC;KACjB,OAAO,CAAC;IACP,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE,sCAAsC;IAChD,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;QA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AAG;QACV,YAAY,EAAE,IAAI;QAClB,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE;QACtB,QAAQ,EAAE,gDAAgD;QAC1D,IAAI,EAAE,QAAQ;KACf;IACD,eAAe,EAAE;QACf,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,KAAK;QACnB,QAAQ,EAAE,8BAA8B;QACxC,IAAI,EAAE,QAAQ;KACf;IACD,YAAY,EAAE;QACZ,YAAY,EAAE,KAAK;QACnB,QAAQ,EAAE,qDAAqD;QAC/D,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;KACf;IACD,OAAO,EAAE;QACP,YAAY,EAAE,KAAK;QACnB,QAAQ,EAAE,8DAA8D;QACxE,IAAI,EAAE,QAAQ;KACf;IACD,iBAAiB,EAAE;QACjB,YAAY,EAAE,KAAK;QACnB,QAAQ,EAAE,oDAAoD;QAC9D,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;KACf;IACD,oBAAoB,EAAE;QACpB,YAAY,EAAE,KAAK;QACnB,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,8CAA8C;QACxD,IAAI,EAAE,SAAS;KAChB;IACD,MAAM,EAAE;QACN,IAAI,EAAE,SAAS;QACf,YAAY,EAAE,KAAK;QACnB,QAAQ,EAAE,wDAAwD;KACnE;IACD,OAAO,EAAE;QACP,KAAK,EAAE,GAAG;QACV,YAAY,EAAE,KAAK;QACnB,QAAQ,EACN,0FAA0F;QAC5F,IAAI,EAAE,QAAQ;KACf;IACD,IAAI,EAAE;QACJ,QAAQ,EACN,wKAAwK;QAC1K,IAAI,EAAE,QAAQ;KACf;IACD,qBAAqB,EAAE;QACrB,QAAQ,EACN,yEAAyE;QAC3E,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,GAAG;KACb;CACF,CAAC;KACD,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,8CAA8C","sourcesContent":["// Copyright 2020-2022 OnFinality Limited authors & contributors\n// SPDX-License-Identifier: Apache-2.0\n\nimport { initLogger } from '@subql/node-core/logger';\nimport { hideBin } from 'yargs/helpers';\nimport yargs from 'yargs/yargs';\n\nexport const yargsOptions = yargs(hideBin(process.argv))\n .env('SUBQL_NODE')\n .command({\n command: 'test',\n describe: 'Run tests for a SubQuery application',\n builder: {},\n handler: (argv) => {\n initLogger(\n argv.debug as boolean,\n argv.outputFmt as 'json' | 'colored',\n argv.logLevel as string | undefined,\n );\n // lazy import to make sure logger is instantiated before all other services\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { testingInit } = require('./subcommands/testing.init');\n return testingInit();\n },\n })\n .command({\n command: 'force-clean',\n describe:\n 'Clean the database dropping project schemas and tables. Once the command is executed, the application would exit upon completion.',\n builder: {},\n handler: (argv) => {\n initLogger(\n argv.debug as boolean,\n argv.outputFmt as 'json' | 'colored',\n argv.logLevel as string | undefined,\n );\n\n // lazy import to make sure logger is instantiated before all other services\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { forceCleanInit } = require('./subcommands/forceClean.init');\n return forceCleanInit();\n },\n })\n .command({\n command: 'reindex',\n describe:\n 'Reindex to specified block height. Historical must be enabled for the targeted project (--disable-historical=false). Once the command is executed, the application would exit upon completion.',\n builder: (yargs) =>\n yargs.options('targetHeight', {\n type: 'number',\n description: 'set targetHeight',\n require: true,\n }),\n handler: (argv) => {\n initLogger(\n argv.debug as boolean,\n argv.outputFmt as 'json' | 'colored',\n argv.logLevel as string | undefined,\n );\n // lazy import to make sure logger is instantiated before all other services\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { reindexInit } = require('./subcommands/reindex.init');\n return reindexInit(argv.targetHeight);\n },\n })\n .command({\n command: 'mmr-regen',\n describe:\n 'Re-generate mmr between Filebased/Postgres mmr and Proof of index',\n builder: (yargs) =>\n yargs.options({\n probe: {\n type: 'boolean',\n description:\n 'Fetch latest mmr height information from file based/postgres DB and Poi table',\n demandOption: false,\n default: false,\n },\n targetHeight: {\n type: 'number',\n description: 'Re-genrate mmr value from this block height',\n demandOption: false,\n },\n resetOnly: {\n type: 'boolean',\n description:\n 'Only reset the mmr value in both POI and file based/postgres DB to target height',\n demandOption: false,\n default: false,\n },\n unsafe: {\n type: 'boolean',\n description: 'Allow sync mmr from Poi table to file or a postgres DB',\n demandOption: false,\n default: false,\n },\n 'mmr-store-type': {\n demandOption: false,\n describe:\n 'When regenerate MMR store in either a file or a postgres DB',\n type: 'string',\n choices: ['file', 'postgres'],\n default: 'postgres',\n },\n 'mmr-path': {\n alias: 'm',\n demandOption: false,\n describe:\n 'File based only : local path of the merkle mountain range (.mmr) file',\n type: 'string',\n },\n 'db-schema': {\n demandOption: false,\n describe: 'Db schema name of the project',\n type: 'string',\n },\n subquery: {\n alias: 'f',\n demandOption: true,\n default: process.cwd(),\n describe: 'Local path or IPFS cid of the subquery project',\n type: 'string',\n },\n }),\n handler: (argv) => {\n initLogger(\n argv.debug as boolean,\n argv.outputFmt as 'json' | 'colored',\n argv.logLevel as string | undefined,\n );\n\n // lazy import to make sure logger is instantiated before all other services\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { mmrRegenerateInit } = require('./subcommands/mmrRegenerate.init');\n return mmrRegenerateInit(\n argv.probe,\n argv.resetOnly,\n argv.unsafe,\n argv.targetHeight,\n );\n },\n })\n .command({\n command: 'mmr-migrate',\n describe: 'Migrate MMR data from storage file to postgres DB',\n builder: (yargs) =>\n yargs.options({\n direction: {\n type: 'string',\n description: 'set direction of migration (file -> DB or DB -> file)',\n demandOption: false,\n choices: ['dbToFile', 'fileToDb'],\n default: 'dbToFile',\n },\n 'mmr-path': {\n alias: 'm',\n demandOption: false,\n describe: 'Local path of the merkle mountain range (.mmr) file',\n type: 'string',\n },\n 'db-schema': {\n demandOption: false,\n describe: 'Db schema name of the project',\n type: 'string',\n },\n subquery: {\n alias: 'f',\n demandOption: true,\n default: process.cwd(),\n describe: 'Local path or IPFS cid of the subquery project',\n type: 'string',\n },\n }),\n handler: (argv) => {\n initLogger(\n argv.debug as boolean,\n argv.outputFmt as 'json' | 'colored',\n argv.logLevel as string | undefined,\n );\n\n // lazy import to make sure logger is instantiated before all other services\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { mmrMigrateInit } = require('./subcommands/mmrMigrate.init');\n return mmrMigrateInit(argv.direction);\n },\n })\n .options({\n 'batch-size': {\n demandOption: false,\n describe: 'Batch size of blocks to fetch in one round',\n type: 'number',\n },\n 'block-confirmations': {\n demandOption: false,\n default: 20,\n describe:\n 'The number of blocks behind the head to be considered finalized, this has no effect with Ethereum',\n type: 'number',\n },\n config: {\n alias: 'c',\n demandOption: false,\n describe: 'Specify configuration file',\n type: 'string',\n },\n 'db-schema': {\n demandOption: false,\n describe: 'Db schema name of the project',\n type: 'string',\n },\n debug: {\n demandOption: false,\n describe:\n 'Show debug information to console output. will forcefully set log level to debug',\n type: 'boolean',\n default: false,\n },\n 'dictionary-resolver': {\n demandOption: false,\n describe: 'Use SubQuery Network dictionary resolver',\n type: 'string',\n },\n 'dictionary-timeout': {\n demandOption: false,\n describe: 'Max timeout for dictionary query',\n type: 'number',\n },\n 'disable-historical': {\n demandOption: false,\n default: false,\n describe: 'Disable storing historical state entities',\n type: 'boolean',\n },\n ipfs: {\n demandOption: false,\n describe: 'IPFS gateway endpoint',\n type: 'string',\n },\n local: {\n deprecated: true,\n type: 'boolean',\n demandOption: false,\n describe: 'Use local mode',\n },\n 'log-level': {\n demandOption: false,\n describe: 'Specify log level to print. Ignored when --debug is used',\n type: 'string',\n choices: ['fatal', 'error', 'warn', 'info', 'debug', 'trace', 'silent'],\n },\n 'mmr-path': {\n alias: 'm',\n demandOption: false,\n describe: 'Local path of the merkle mountain range (.mmr) file',\n type: 'string',\n },\n 'multi-chain': {\n demandOption: false,\n default: false,\n describe:\n 'Enables indexing multiple subquery projects into the same database schema',\n type: 'boolean',\n },\n 'network-dictionary': {\n alias: 'd',\n demandOption: false,\n describe: 'Specify the dictionary api for this network',\n type: 'string',\n },\n 'network-endpoint': {\n demandOption: false,\n type: 'string',\n describe: 'Blockchain network endpoint to connect',\n },\n 'output-fmt': {\n demandOption: false,\n describe: 'Print log as json or plain text',\n type: 'string',\n choices: ['json', 'colored'],\n },\n port: {\n alias: 'p',\n demandOption: false,\n describe: 'The port the service will bind to',\n type: 'number',\n },\n profiler: {\n demandOption: false,\n describe: 'Show profiler information to console output',\n type: 'boolean',\n default: false,\n },\n 'proof-of-index': {\n demandOption: false,\n describe: 'Enable/disable proof of index',\n type: 'boolean',\n default: false,\n },\n 'mmr-store-type': {\n demandOption: false,\n describe: 'Store MMR in either a file or a postgres DB',\n type: 'string',\n choices: ['file', 'postgres'],\n default: 'postgres',\n },\n 'query-limit': {\n demandOption: false,\n describe:\n 'The limit of items a project can query with store.getByField at once',\n type: 'number',\n default: 100,\n },\n 'scale-batch-size': {\n type: 'boolean',\n demandOption: false,\n describe: 'scale batch size based on memory usage',\n default: false,\n },\n 'pg-ca': {\n demandOption: false,\n describe:\n 'Postgres ca certificate - to enable TLS/SSL connections to your PostgreSQL, path to the server certificate file are required, e.g /path/to/server-certificates/root.crt',\n type: 'string',\n },\n 'pg-key': {\n demandOption: false,\n describe:\n 'Postgres client key - Path to key file e.g /path/to/client-key/postgresql.key',\n type: 'string',\n },\n 'pg-cert': {\n demandOption: false,\n describe:\n 'Postgres client certificate - Path to client certificate e.g /path/to/client-certificates/postgresql.crt',\n type: 'string',\n },\n 'store-cache-threshold': {\n demandOption: false,\n describe:\n 'Store cache will flush data to the database when number of records excess this threshold',\n type: 'number',\n },\n 'store-cache-upper-limit': {\n demandOption: false,\n describe:\n 'Defines the upper limit to the store cache size. When this limit is reached indexing will wait for the cache to be flushed before continuing.',\n type: 'number',\n },\n 'store-get-cache-size': {\n demandOption: false,\n describe: 'Store get cache size for each model',\n type: 'number',\n },\n 'store-cache-async': {\n demandOption: false,\n describe:\n 'If enabled the store cache will flush data asyncronously relative to indexing data',\n type: 'boolean',\n },\n 'store-flush-interval': {\n demandOption: false,\n describe:\n 'The interval, in seconds, at which data is flushed from the cache. ' +\n 'This ensures that data is persisted regularly when there is either not much data or the project is up to date.',\n type: 'number',\n default: 5,\n },\n subquery: {\n alias: 'f',\n demandOption: true,\n default: process.cwd(),\n describe: 'Local path or IPFS cid of the subquery project',\n type: 'string',\n },\n 'subquery-name': {\n deprecated: true,\n demandOption: false,\n describe: 'Name of the subquery project',\n type: 'string',\n },\n subscription: {\n demandOption: false,\n describe: 'Enable subscription by create notification triggers',\n type: 'boolean',\n default: false,\n },\n timeout: {\n demandOption: false,\n describe: 'Timeout for indexer sandbox to execute the mapping functions',\n type: 'number',\n },\n 'timestamp-field': {\n demandOption: false,\n describe: 'Enable/disable created_at and updated_at in schema',\n type: 'boolean',\n default: false,\n },\n 'unfinalized-blocks': {\n demandOption: false,\n default: false,\n describe: 'Enable to fetch and index unfinalized blocks',\n type: 'boolean',\n },\n unsafe: {\n type: 'boolean',\n demandOption: false,\n describe: 'Allows usage of any built-in module within the sandbox',\n },\n workers: {\n alias: 'w',\n demandOption: false,\n describe:\n 'Number of worker threads to use for fetching and processing blocks. Disabled by default.',\n type: 'number',\n },\n root: {\n describe:\n 'This is a hidden flag only used from the main thread to workers. It provides a root directory for the project. This is a temp directory with IPFS and GitHub projects.',\n type: 'string',\n },\n 'query-address-limit': {\n describe:\n 'Set the limit for address on dictionary queries for dynamic datasources',\n type: 'number',\n default: 100,\n },\n })\n .hide('root'); // root is hidden because its for internal use\n"]}
|
|
1
|
+
{"version":3,"file":"yargs.js","sourceRoot":"","sources":["../src/yargs.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;AAEnC,oDAAqD;AACrD,2CAAwC;AACxC,wDAAgC;AAEnB,QAAA,YAAY,GAAG,IAAA,eAAK,EAAC,IAAA,iBAAO,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KACrD,GAAG,CAAC,YAAY,CAAC;KACjB,OAAO,CAAC;IACP,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE,sCAAsC;IAChD,OAAO,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["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { initLogger } from '@subql/node-core/logger';\nimport { hideBin } from 'yargs/helpers';\nimport yargs from 'yargs/yargs';\n\nexport const yargsOptions = yargs(hideBin(process.argv))\n .env('SUBQL_NODE')\n .command({\n command: 'test',\n describe: 'Run tests for a SubQuery application',\n builder: {},\n handler: (argv) => {\n initLogger(\n argv.debug as boolean,\n argv.outputFmt as 'json' | 'colored',\n argv.logLevel as string | undefined,\n );\n // lazy import to make sure logger is instantiated before all other services\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { testingInit } = require('./subcommands/testing.init');\n return testingInit();\n },\n })\n .command({\n command: 'force-clean',\n describe:\n 'Clean the database dropping project schemas and tables. Once the command is executed, the application would exit upon completion.',\n builder: {},\n handler: (argv) => {\n initLogger(\n argv.debug as boolean,\n argv.outputFmt as 'json' | 'colored',\n argv.logLevel as string | undefined,\n );\n\n // lazy import to make sure logger is instantiated before all other services\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { forceCleanInit } = require('./subcommands/forceClean.init');\n return forceCleanInit();\n },\n })\n .command({\n command: 'reindex',\n describe:\n 'Reindex to specified block height. Historical must be enabled for the targeted project (--disable-historical=false). Once the command is executed, the application would exit upon completion.',\n builder: (yargs) =>\n yargs.options('targetHeight', {\n type: 'number',\n description: 'set targetHeight',\n require: true,\n }),\n handler: (argv) => {\n initLogger(\n argv.debug as boolean,\n argv.outputFmt as 'json' | 'colored',\n argv.logLevel as string | undefined,\n );\n // lazy import to make sure logger is instantiated before all other services\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { reindexInit } = require('./subcommands/reindex.init');\n return reindexInit(argv.targetHeight);\n },\n })\n .command({\n command: 'mmr-regen',\n describe:\n 'Re-generate mmr between Filebased/Postgres mmr and Proof of index',\n builder: (yargs) =>\n yargs.options({\n probe: {\n type: 'boolean',\n description:\n 'Fetch latest mmr height information from file based/postgres DB and Poi table',\n demandOption: false,\n default: false,\n },\n targetHeight: {\n type: 'number',\n description: 'Re-genrate mmr value from this block height',\n demandOption: false,\n },\n resetOnly: {\n type: 'boolean',\n description:\n 'Only reset the mmr value in both POI and file based/postgres DB to target height',\n demandOption: false,\n default: false,\n },\n unsafe: {\n type: 'boolean',\n description: 'Allow sync mmr from Poi table to file or a postgres DB',\n demandOption: false,\n default: false,\n },\n 'mmr-store-type': {\n demandOption: false,\n describe:\n 'When regenerate MMR store in either a file or a postgres DB',\n type: 'string',\n choices: ['file', 'postgres'],\n default: 'postgres',\n },\n 'mmr-path': {\n alias: 'm',\n demandOption: false,\n describe:\n 'File based only : local path of the merkle mountain range (.mmr) file',\n type: 'string',\n },\n 'db-schema': {\n demandOption: false,\n describe: 'Db schema name of the project',\n type: 'string',\n },\n subquery: {\n alias: 'f',\n demandOption: true,\n default: process.cwd(),\n describe: 'Local path or IPFS cid of the subquery project',\n type: 'string',\n },\n }),\n handler: (argv) => {\n initLogger(\n argv.debug as boolean,\n argv.outputFmt as 'json' | 'colored',\n argv.logLevel as string | undefined,\n );\n\n // lazy import to make sure logger is instantiated before all other services\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { mmrRegenerateInit } = require('./subcommands/mmrRegenerate.init');\n return mmrRegenerateInit(\n argv.probe,\n argv.resetOnly,\n argv.unsafe,\n argv.targetHeight,\n );\n },\n })\n .command({\n command: 'mmr-migrate',\n describe: 'Migrate MMR data from storage file to postgres DB',\n builder: (yargs) =>\n yargs.options({\n direction: {\n type: 'string',\n description: 'set direction of migration (file -> DB or DB -> file)',\n demandOption: false,\n choices: ['dbToFile', 'fileToDb'],\n default: 'dbToFile',\n },\n 'mmr-path': {\n alias: 'm',\n demandOption: false,\n describe: 'Local path of the merkle mountain range (.mmr) file',\n type: 'string',\n },\n 'db-schema': {\n demandOption: false,\n describe: 'Db schema name of the project',\n type: 'string',\n },\n subquery: {\n alias: 'f',\n demandOption: true,\n default: process.cwd(),\n describe: 'Local path or IPFS cid of the subquery project',\n type: 'string',\n },\n }),\n handler: (argv) => {\n initLogger(\n argv.debug as boolean,\n argv.outputFmt as 'json' | 'colored',\n argv.logLevel as string | undefined,\n );\n\n // lazy import to make sure logger is instantiated before all other services\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { mmrMigrateInit } = require('./subcommands/mmrMigrate.init');\n return mmrMigrateInit(argv.direction);\n },\n })\n .options({\n 'batch-size': {\n demandOption: false,\n describe: 'Batch size of blocks to fetch in one round',\n type: 'number',\n },\n 'block-confirmations': {\n demandOption: false,\n default: 20,\n describe:\n 'The number of blocks behind the head to be considered finalized, this has no effect with Ethereum',\n type: 'number',\n },\n config: {\n alias: 'c',\n demandOption: false,\n describe: 'Specify configuration file',\n type: 'string',\n },\n 'db-schema': {\n demandOption: false,\n describe: 'Db schema name of the project',\n type: 'string',\n },\n debug: {\n demandOption: false,\n describe:\n 'Show debug information to console output. will forcefully set log level to debug',\n type: 'boolean',\n default: false,\n },\n 'dictionary-resolver': {\n demandOption: false,\n describe: 'Use SubQuery Network dictionary resolver',\n type: 'string',\n },\n 'dictionary-timeout': {\n demandOption: false,\n describe: 'Max timeout for dictionary query',\n type: 'number',\n },\n 'disable-historical': {\n demandOption: false,\n default: false,\n describe: 'Disable storing historical state entities',\n type: 'boolean',\n },\n ipfs: {\n demandOption: false,\n describe: 'IPFS gateway endpoint',\n type: 'string',\n },\n local: {\n deprecated: true,\n type: 'boolean',\n demandOption: false,\n describe: 'Use local mode',\n },\n 'log-level': {\n demandOption: false,\n describe: 'Specify log level to print. Ignored when --debug is used',\n type: 'string',\n choices: ['fatal', 'error', 'warn', 'info', 'debug', 'trace', 'silent'],\n },\n 'mmr-path': {\n alias: 'm',\n demandOption: false,\n describe: 'Local path of the merkle mountain range (.mmr) file',\n type: 'string',\n },\n 'multi-chain': {\n demandOption: false,\n default: false,\n describe:\n 'Enables indexing multiple subquery projects into the same database schema',\n type: 'boolean',\n },\n 'network-dictionary': {\n alias: 'd',\n demandOption: false,\n describe: 'Specify the dictionary api for this network',\n type: 'string',\n },\n 'network-endpoint': {\n demandOption: false,\n type: 'string',\n describe: 'Blockchain network endpoint to connect',\n },\n 'output-fmt': {\n demandOption: false,\n describe: 'Print log as json or plain text',\n type: 'string',\n choices: ['json', 'colored'],\n },\n port: {\n alias: 'p',\n demandOption: false,\n describe: 'The port the service will bind to',\n type: 'number',\n },\n profiler: {\n demandOption: false,\n describe: 'Show profiler information to console output',\n type: 'boolean',\n default: false,\n },\n 'proof-of-index': {\n demandOption: false,\n describe: 'Enable/disable proof of index',\n type: 'boolean',\n default: false,\n },\n 'mmr-store-type': {\n demandOption: false,\n describe: 'Store MMR in either a file or a postgres DB',\n type: 'string',\n choices: ['file', 'postgres'],\n default: 'postgres',\n },\n 'query-limit': {\n demandOption: false,\n describe:\n 'The limit of items a project can query with store.getByField at once',\n type: 'number',\n default: 100,\n },\n 'scale-batch-size': {\n type: 'boolean',\n demandOption: false,\n describe: 'scale batch size based on memory usage',\n default: false,\n },\n 'pg-ca': {\n demandOption: false,\n describe:\n 'Postgres ca certificate - to enable TLS/SSL connections to your PostgreSQL, path to the server certificate file are required, e.g /path/to/server-certificates/root.crt',\n type: 'string',\n },\n 'pg-key': {\n demandOption: false,\n describe:\n 'Postgres client key - Path to key file e.g /path/to/client-key/postgresql.key',\n type: 'string',\n },\n 'pg-cert': {\n demandOption: false,\n describe:\n 'Postgres client certificate - Path to client certificate e.g /path/to/client-certificates/postgresql.crt',\n type: 'string',\n },\n 'store-cache-threshold': {\n demandOption: false,\n describe:\n 'Store cache will flush data to the database when number of records excess this threshold',\n type: 'number',\n },\n 'store-cache-upper-limit': {\n demandOption: false,\n describe:\n 'Defines the upper limit to the store cache size. When this limit is reached indexing will wait for the cache to be flushed before continuing.',\n type: 'number',\n },\n 'store-get-cache-size': {\n demandOption: false,\n describe: 'Store get cache size for each model',\n type: 'number',\n },\n 'store-cache-async': {\n demandOption: false,\n describe:\n 'If enabled the store cache will flush data asyncronously relative to indexing data',\n type: 'boolean',\n },\n 'store-flush-interval': {\n demandOption: false,\n describe:\n 'The interval, in seconds, at which data is flushed from the cache. ' +\n 'This ensures that data is persisted regularly when there is either not much data or the project is up to date.',\n type: 'number',\n default: 5,\n },\n subquery: {\n alias: 'f',\n demandOption: true,\n default: process.cwd(),\n describe: 'Local path or IPFS cid of the subquery project',\n type: 'string',\n },\n 'subquery-name': {\n deprecated: true,\n demandOption: false,\n describe: 'Name of the subquery project',\n type: 'string',\n },\n subscription: {\n demandOption: false,\n describe: 'Enable subscription by create notification triggers',\n type: 'boolean',\n default: false,\n },\n timeout: {\n demandOption: false,\n describe: 'Timeout for indexer sandbox to execute the mapping functions',\n type: 'number',\n },\n 'timestamp-field': {\n demandOption: false,\n describe: 'Enable/disable created_at and updated_at in schema',\n type: 'boolean',\n default: false,\n },\n 'unfinalized-blocks': {\n demandOption: false,\n default: false,\n describe: 'Enable to fetch and index unfinalized blocks',\n type: 'boolean',\n },\n unsafe: {\n type: 'boolean',\n demandOption: false,\n describe: 'Allows usage of any built-in module within the sandbox',\n },\n workers: {\n alias: 'w',\n demandOption: false,\n describe:\n 'Number of worker threads to use for fetching and processing blocks. Disabled by default.',\n type: 'number',\n },\n root: {\n describe:\n 'This is a hidden flag only used from the main thread to workers. It provides a root directory for the project. This is a temp directory with IPFS and GitHub projects.',\n type: 'string',\n },\n 'query-address-limit': {\n describe:\n 'Set the limit for address on dictionary queries for dynamic datasources',\n type: 'number',\n default: 100,\n },\n })\n .hide('root'); // root is hidden because its for internal use\n"]}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@subql/node-ethereum",
|
|
3
|
-
"version": "2.9.3-
|
|
3
|
+
"version": "2.9.3-4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Ian He",
|
|
6
|
-
"license": "
|
|
6
|
+
"license": "GPL-3.0",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"prebuild": "rimraf dist",
|
|
9
9
|
"build": "rm -rf dist && tsc -b",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"@nestjs/platform-express": "^9.4.0",
|
|
26
26
|
"@nestjs/schedule": "^3.0.1",
|
|
27
27
|
"@subql/common": "^2.3.0",
|
|
28
|
-
"@subql/common-ethereum": "2.2.0",
|
|
28
|
+
"@subql/common-ethereum": "2.2.1-0",
|
|
29
29
|
"@subql/node-core": "^3.1.2",
|
|
30
30
|
"@subql/testing": "^2.0.0",
|
|
31
31
|
"@subql/types": "^2.1.2",
|
|
32
|
-
"@subql/types-ethereum": "2.2.3-
|
|
32
|
+
"@subql/types-ethereum": "2.2.3-2",
|
|
33
33
|
"@willsoto/nestjs-prometheus": "^4.4.0",
|
|
34
34
|
"cacheable-lookup": "6",
|
|
35
35
|
"cron-converter": "^1.0.2",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"/dist",
|
|
68
68
|
"/bin"
|
|
69
69
|
],
|
|
70
|
-
"stableVersion": "2.9.3-
|
|
70
|
+
"stableVersion": "2.9.3-3"
|
|
71
71
|
}
|