@subql/node-ethereum 1.0.3-1 → 1.0.3-3

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.
Files changed (64) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/app.module.js.map +1 -1
  3. package/dist/configure/SubqueryProject.d.ts +9 -11
  4. package/dist/configure/SubqueryProject.js.map +1 -1
  5. package/dist/configure/configure.module.js.map +1 -1
  6. package/dist/ethereum/api.service.ethereum.d.ts +2 -1
  7. package/dist/ethereum/api.service.ethereum.js.map +1 -1
  8. package/dist/ethereum/ethers/web/index.d.ts +4 -3
  9. package/dist/ethereum/ethers/web/types.d.ts +3 -2
  10. package/dist/indexer/blockDispatcher/block-dispatcher.service.d.ts +1 -1
  11. package/dist/indexer/blockDispatcher/block-dispatcher.service.js +1 -1
  12. package/dist/indexer/blockDispatcher/block-dispatcher.service.js.map +1 -1
  13. package/dist/indexer/blockDispatcher/worker-block-dispatcher.service.d.ts +2 -2
  14. package/dist/indexer/blockDispatcher/worker-block-dispatcher.service.js.map +1 -1
  15. package/dist/indexer/dictionary.service.js.map +1 -1
  16. package/dist/indexer/ds-processor.service.js.map +1 -1
  17. package/dist/indexer/dynamic-ds.service.js.map +1 -1
  18. package/dist/indexer/fetch.module.js +0 -7
  19. package/dist/indexer/fetch.module.js.map +1 -1
  20. package/dist/indexer/fetch.service.js +3 -5
  21. package/dist/indexer/fetch.service.js.map +1 -1
  22. package/dist/indexer/indexer.manager.d.ts +6 -5
  23. package/dist/indexer/indexer.manager.js +8 -9
  24. package/dist/indexer/indexer.manager.js.map +1 -1
  25. package/dist/indexer/indexer.module.js.map +1 -1
  26. package/dist/indexer/project.service.d.ts +1 -1
  27. package/dist/indexer/project.service.js.map +1 -1
  28. package/dist/indexer/sandbox.service.js +1 -1
  29. package/dist/indexer/sandbox.service.js.map +1 -1
  30. package/dist/indexer/types.d.ts +2 -2
  31. package/dist/indexer/unfinalizedBlocks.service.d.ts +1 -1
  32. package/dist/indexer/unfinalizedBlocks.service.js.map +1 -1
  33. package/dist/indexer/worker/worker.d.ts +10 -10
  34. package/dist/indexer/worker/worker.js.map +1 -1
  35. package/dist/indexer/worker/worker.module.js.map +1 -1
  36. package/dist/indexer/worker/worker.service.d.ts +7 -5
  37. package/dist/indexer/worker/worker.service.js +8 -4
  38. package/dist/indexer/worker/worker.service.js.map +1 -1
  39. package/dist/indexer/worker/worker.unfinalizedBlocks.service.d.ts +1 -1
  40. package/dist/indexer/worker/worker.unfinalizedBlocks.service.js.map +1 -1
  41. package/dist/main.js +3 -1
  42. package/dist/main.js.map +1 -1
  43. package/dist/meta/meta.controller.js.map +1 -1
  44. package/dist/meta/meta.module.js.map +1 -1
  45. package/dist/meta/meta.service.js.map +1 -1
  46. package/dist/subcommands/forceClean.module.js.map +1 -1
  47. package/dist/subcommands/forceClean.service.js.map +1 -1
  48. package/dist/subcommands/reindex.module.js.map +1 -1
  49. package/dist/subcommands/reindex.service.js.map +1 -1
  50. package/dist/subcommands/testing.init.d.ts +1 -0
  51. package/dist/subcommands/testing.init.js +34 -0
  52. package/dist/subcommands/testing.init.js.map +1 -0
  53. package/dist/subcommands/testing.module.d.ts +4 -0
  54. package/dist/subcommands/testing.module.js +77 -0
  55. package/dist/subcommands/testing.module.js.map +1 -0
  56. package/dist/subcommands/testing.service.d.ts +9 -0
  57. package/dist/subcommands/testing.service.js +43 -0
  58. package/dist/subcommands/testing.service.js.map +1 -0
  59. package/dist/utils/reindex.js +0 -4
  60. package/dist/utils/reindex.js.map +1 -1
  61. package/dist/yargs.d.ts +9 -7
  62. package/dist/yargs.js +21 -9
  63. package/dist/yargs.js.map +1 -1
  64. package/package.json +8 -8
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ // Copyright 2020-2022 OnFinality Limited authors & contributors
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
5
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
7
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
8
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
9
+ };
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.TestingModule = exports.TestingFeatureModule = void 0;
12
+ const common_1 = require("@nestjs/common");
13
+ const event_emitter_1 = require("@nestjs/event-emitter");
14
+ const schedule_1 = require("@nestjs/schedule");
15
+ const node_core_1 = require("@subql/node-core");
16
+ const configure_module_1 = require("../configure/configure.module");
17
+ const ethereum_1 = require("../ethereum");
18
+ const ds_processor_service_1 = require("../indexer/ds-processor.service");
19
+ const dynamic_ds_service_1 = require("../indexer/dynamic-ds.service");
20
+ const fetch_module_1 = require("../indexer/fetch.module");
21
+ const indexer_manager_1 = require("../indexer/indexer.manager");
22
+ const project_service_1 = require("../indexer/project.service");
23
+ const sandbox_service_1 = require("../indexer/sandbox.service");
24
+ const unfinalizedBlocks_service_1 = require("../indexer/unfinalizedBlocks.service");
25
+ const meta_module_1 = require("../meta/meta.module");
26
+ const testing_service_1 = require("./testing.service");
27
+ let TestingFeatureModule = class TestingFeatureModule {
28
+ };
29
+ TestingFeatureModule = __decorate([
30
+ (0, common_1.Module)({
31
+ providers: [
32
+ node_core_1.StoreService,
33
+ testing_service_1.TestingService,
34
+ event_emitter_1.EventEmitter2,
35
+ node_core_1.PoiService,
36
+ sandbox_service_1.SandboxService,
37
+ ds_processor_service_1.DsProcessorService,
38
+ dynamic_ds_service_1.DynamicDsService,
39
+ unfinalizedBlocks_service_1.UnfinalizedBlocksService,
40
+ project_service_1.ProjectService,
41
+ node_core_1.ConnectionPoolService,
42
+ {
43
+ provide: 'IProjectService',
44
+ useClass: project_service_1.ProjectService,
45
+ },
46
+ {
47
+ provide: node_core_1.ApiService,
48
+ useFactory: async (project, connectionPoolService, eventEmitter) => {
49
+ const apiService = new ethereum_1.EthereumApiService(project, connectionPoolService, eventEmitter);
50
+ await apiService.init();
51
+ return apiService;
52
+ },
53
+ inject: ['ISubqueryProject', node_core_1.ConnectionPoolService, event_emitter_1.EventEmitter2],
54
+ },
55
+ indexer_manager_1.IndexerManager,
56
+ ],
57
+ imports: [meta_module_1.MetaModule, fetch_module_1.FetchModule],
58
+ controllers: [],
59
+ })
60
+ ], TestingFeatureModule);
61
+ exports.TestingFeatureModule = TestingFeatureModule;
62
+ let TestingModule = class TestingModule {
63
+ };
64
+ TestingModule = __decorate([
65
+ (0, common_1.Module)({
66
+ imports: [
67
+ node_core_1.DbModule.forRoot(),
68
+ configure_module_1.ConfigureModule.register(),
69
+ event_emitter_1.EventEmitterModule.forRoot(),
70
+ schedule_1.ScheduleModule.forRoot(),
71
+ TestingFeatureModule,
72
+ ],
73
+ controllers: [],
74
+ })
75
+ ], TestingModule);
76
+ exports.TestingModule = TestingModule;
77
+ //# sourceMappingURL=testing.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.module.js","sourceRoot":"","sources":["../../src/subcommands/testing.module.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,sCAAsC;;;;;;;;;AAEtC,2CAAwC;AACxC,yDAA0E;AAC1E,+CAAkD;AAClD,gDAM0B;AAC1B,oEAAgE;AAEhE,0CAAiD;AAEjD,0EAAqE;AACrE,sEAAiE;AACjE,0DAAsD;AACtD,gEAA4D;AAC5D,gEAA4D;AAC5D,gEAA4D;AAC5D,oFAAgF;AAChF,qDAAiD;AACjD,uDAAmD;AAyC5C,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAAG,CAAA;AAAvB,oBAAoB;IAvChC,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;SACf;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-2022 OnFinality Limited authors & contributors\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Module } from '@nestjs/common';\nimport { EventEmitter2, EventEmitterModule } from '@nestjs/event-emitter';\nimport { ScheduleModule } from '@nestjs/schedule';\nimport {\n ApiService,\n ConnectionPoolService,\n DbModule,\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 ],\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"]}
@@ -0,0 +1,9 @@
1
+ import { ApiService, NodeConfig, StoreService, TestingService as BaseTestingService } from '@subql/node-core';
2
+ import { EthereumBlockWrapper } from '@subql/types-ethereum';
3
+ import { Sequelize } from 'sequelize';
4
+ import { SubqlProjectDs, SubqueryProject } from '../configure/SubqueryProject';
5
+ import { IndexerManager } from '../indexer/indexer.manager';
6
+ export declare class TestingService extends BaseTestingService<EthereumBlockWrapper, SubqlProjectDs> {
7
+ constructor(sequelize: Sequelize, nodeConfig: NodeConfig, storeService: StoreService, project: SubqueryProject, apiService: ApiService, indexerManager: IndexerManager);
8
+ indexBlock(block: EthereumBlockWrapper, handler: string): Promise<void>;
9
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ // Copyright 2020-2022 OnFinality Limited authors & contributors
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
5
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
7
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
8
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
9
+ };
10
+ var __metadata = (this && this.__metadata) || function (k, v) {
11
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
12
+ };
13
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
14
+ return function (target, key) { decorator(target, key, paramIndex); }
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.TestingService = void 0;
18
+ const common_1 = require("@nestjs/common");
19
+ const node_core_1 = require("@subql/node-core");
20
+ const sequelize_1 = require("sequelize");
21
+ const SubqueryProject_1 = require("../configure/SubqueryProject");
22
+ const indexer_manager_1 = require("../indexer/indexer.manager");
23
+ const logger = (0, node_core_1.getLogger)('subql-testing');
24
+ let TestingService = class TestingService extends node_core_1.TestingService {
25
+ constructor(sequelize, nodeConfig, storeService, project, apiService, indexerManager) {
26
+ super(sequelize, nodeConfig, storeService, project, apiService, indexerManager);
27
+ }
28
+ async indexBlock(block, handler) {
29
+ await this.indexerManager.indexBlock(block, this.getDsWithHandler(handler));
30
+ }
31
+ };
32
+ TestingService = __decorate([
33
+ (0, common_1.Injectable)(),
34
+ __param(3, (0, common_1.Inject)('ISubqueryProject')),
35
+ __metadata("design:paramtypes", [sequelize_1.Sequelize,
36
+ node_core_1.NodeConfig,
37
+ node_core_1.StoreService,
38
+ SubqueryProject_1.SubqueryProject,
39
+ node_core_1.ApiService,
40
+ indexer_manager_1.IndexerManager])
41
+ ], TestingService);
42
+ exports.TestingService = TestingService;
43
+ //# sourceMappingURL=testing.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.service.js","sourceRoot":"","sources":["../../src/subcommands/testing.service.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,sCAAsC;;;;;;;;;;;;;;;AAEtC,2CAAoD;AACpD,gDAM0B;AAE1B,yCAAsC;AACtC,kEAA+E;AAC/E,gEAA4D;AAE5D,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,eAAe,CAAC,CAAC;AAGnC,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,0BAGnC;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;AA5BY,cAAc;IAD1B,IAAA,mBAAU,GAAE;IASR,WAAA,IAAA,eAAM,EAAC,kBAAkB,CAAC,CAAA;qCAHhB,qBAAS;QACR,sBAAU;QACR,wBAAY;QACW,iCAAe;QACxC,sBAAU;QACN,gCAAc;GAVrB,cAAc,CA4B1B;AA5BY,wCAAc","sourcesContent":["// Copyright 2020-2022 OnFinality Limited authors & contributors\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Inject, Injectable } from '@nestjs/common';\nimport {\n ApiService,\n NodeConfig,\n StoreService,\n getLogger,\n TestingService as BaseTestingService,\n} from '@subql/node-core';\nimport { EthereumBlockWrapper } from '@subql/types-ethereum';\nimport { Sequelize } from 'sequelize';\nimport { SubqlProjectDs, SubqueryProject } from '../configure/SubqueryProject';\nimport { IndexerManager } from '../indexer/indexer.manager';\n\nconst logger = getLogger('subql-testing');\n\n@Injectable()\nexport class TestingService extends BaseTestingService<\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"]}
@@ -6,10 +6,6 @@ exports.reindex = void 0;
6
6
  const node_core_1 = require("@subql/node-core");
7
7
  const logger = (0, node_core_1.getLogger)('Reindex');
8
8
  async function reindex(startHeight, blockOffset, targetBlockHeight, lastProcessedHeight, storeService, unfinalizedBlockService, dynamicDsService, mmrService, sequelize, forceCleanService) {
9
- if (!storeService.historical) {
10
- logger.warn('Unable to reindex, historical state not enabled');
11
- return;
12
- }
13
9
  if (!lastProcessedHeight || lastProcessedHeight < targetBlockHeight) {
14
10
  logger.warn(`Skipping reindexing to block ${targetBlockHeight}: current indexing height ${lastProcessedHeight} is behind requested block`);
15
11
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"reindex.js","sourceRoot":"","sources":["../../src/utils/reindex.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,sCAAsC;;;AAEtC,gDAAuE;AAMvE,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,SAAS,CAAC,CAAC;AAE7B,KAAK,UAAU,OAAO,CAC3B,WAAmB,EACnB,WAA+B,EAC/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,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YAE1D,MAAM,WAAW,CAAC,MAAM,EAAE,CAAC;YAC3B,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;SAChC;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;YACvC,MAAM,WAAW,CAAC,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,CAAC;SACX;KACF;AACH,CAAC;AA3DD,0BA2DC","sourcesContent":["// Copyright 2020-2022 OnFinality Limited authors & contributors\n// SPDX-License-Identifier: Apache-2.0\n\nimport { getLogger, MmrService, StoreService } from '@subql/node-core';\nimport { Sequelize } from 'sequelize';\nimport { DynamicDsService } from '../indexer/dynamic-ds.service';\nimport { UnfinalizedBlocksService } from '../indexer/unfinalizedBlocks.service';\nimport { ForceCleanService } from '../subcommands/forceClean.service';\n\nconst logger = getLogger('Reindex');\n\nexport async function reindex(\n startHeight: number,\n blockOffset: number | undefined,\n targetBlockHeight: number,\n lastProcessedHeight: number,\n storeService: StoreService,\n unfinalizedBlockService: UnfinalizedBlocksService,\n dynamicDsService: DynamicDsService,\n mmrService: MmrService,\n sequelize: Sequelize,\n forceCleanService?: ForceCleanService,\n): Promise<void> {\n if (!storeService.historical) {\n logger.warn('Unable to reindex, historical state not enabled');\n return;\n }\n if (!lastProcessedHeight || lastProcessedHeight < targetBlockHeight) {\n logger.warn(\n `Skipping reindexing to block ${targetBlockHeight}: current indexing height ${lastProcessedHeight} is behind requested block`,\n );\n return;\n }\n\n // if startHeight is greater than the targetHeight, just force clean\n if (targetBlockHeight < startHeight) {\n logger.info(\n `targetHeight: ${targetBlockHeight} is less than startHeight: ${startHeight}. Hence executing force-clean`,\n );\n if (!forceCleanService) {\n logger.error('ForceCleanService not provided, cannot force clean');\n process.exit(1);\n }\n await forceCleanService.forceClean();\n } else {\n logger.info(`Reindexing to block: ${targetBlockHeight}`);\n const transaction = await sequelize.transaction();\n try {\n await Promise.all([\n storeService.rewind(targetBlockHeight, transaction),\n unfinalizedBlockService.resetUnfinalizedBlocks(),\n unfinalizedBlockService.resetLastFinalizedVerifiedHeight(),\n dynamicDsService.resetDynamicDatasource(targetBlockHeight),\n ]);\n\n if (blockOffset) {\n await mmrService.deleteMmrNode(targetBlockHeight + 1, blockOffset);\n }\n\n // Flush metadata changes from above Promise.all\n await storeService.storeCache.metadata.flush(transaction);\n\n await transaction.commit();\n logger.info('Reindex Success');\n } catch (err) {\n logger.error(err, 'Reindexing failed');\n await transaction.rollback();\n throw err;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"reindex.js","sourceRoot":"","sources":["../../src/utils/reindex.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,sCAAsC;;;AAEtC,gDAAuE;AAMvE,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,SAAS,CAAC,CAAC;AAE7B,KAAK,UAAU,OAAO,CAC3B,WAAmB,EACnB,WAA+B,EAC/B,iBAAyB,EACzB,mBAA2B,EAC3B,YAA0B,EAC1B,uBAAiD,EACjD,gBAAkC,EAClC,UAAsB,EACtB,SAAoB,EACpB,iBAAqC;IAErC,IAAI,CAAC,mBAAmB,IAAI,mBAAmB,GAAG,iBAAiB,EAAE;QACnE,MAAM,CAAC,IAAI,CACT,gCAAgC,iBAAiB,6BAA6B,mBAAmB,4BAA4B,CAC9H,CAAC;QACF,OAAO;KACR;IAED,oEAAoE;IACpE,IAAI,iBAAiB,GAAG,WAAW,EAAE;QACnC,MAAM,CAAC,IAAI,CACT,iBAAiB,iBAAiB,8BAA8B,WAAW,+BAA+B,CAC3G,CAAC;QACF,IAAI,CAAC,iBAAiB,EAAE;YACtB,MAAM,CAAC,KAAK,CAAC,oDAAoD,CAAC,CAAC;YACnE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACjB;QACD,MAAM,iBAAiB,CAAC,UAAU,EAAE,CAAC;KACtC;SAAM;QACL,MAAM,CAAC,IAAI,CAAC,wBAAwB,iBAAiB,EAAE,CAAC,CAAC;QACzD,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,WAAW,EAAE,CAAC;QAClD,IAAI;YACF,MAAM,OAAO,CAAC,GAAG,CAAC;gBAChB,YAAY,CAAC,MAAM,CAAC,iBAAiB,EAAE,WAAW,CAAC;gBACnD,uBAAuB,CAAC,sBAAsB,EAAE;gBAChD,uBAAuB,CAAC,gCAAgC,EAAE;gBAC1D,gBAAgB,CAAC,sBAAsB,CAAC,iBAAiB,CAAC;aAC3D,CAAC,CAAC;YAEH,IAAI,WAAW,EAAE;gBACf,MAAM,UAAU,CAAC,aAAa,CAAC,iBAAiB,GAAG,CAAC,EAAE,WAAW,CAAC,CAAC;aACpE;YAED,gDAAgD;YAChD,MAAM,YAAY,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YAE1D,MAAM,WAAW,CAAC,MAAM,EAAE,CAAC;YAC3B,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;SAChC;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;YACvC,MAAM,WAAW,CAAC,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,CAAC;SACX;KACF;AACH,CAAC;AAvDD,0BAuDC","sourcesContent":["// Copyright 2020-2022 OnFinality Limited authors & contributors\n// SPDX-License-Identifier: Apache-2.0\n\nimport { getLogger, MmrService, StoreService } from '@subql/node-core';\nimport { Sequelize } from 'sequelize';\nimport { DynamicDsService } from '../indexer/dynamic-ds.service';\nimport { UnfinalizedBlocksService } from '../indexer/unfinalizedBlocks.service';\nimport { ForceCleanService } from '../subcommands/forceClean.service';\n\nconst logger = getLogger('Reindex');\n\nexport async function reindex(\n startHeight: number,\n blockOffset: number | undefined,\n targetBlockHeight: number,\n lastProcessedHeight: number,\n storeService: StoreService,\n unfinalizedBlockService: UnfinalizedBlocksService,\n dynamicDsService: DynamicDsService,\n mmrService: MmrService,\n sequelize: Sequelize,\n forceCleanService?: ForceCleanService,\n): Promise<void> {\n if (!lastProcessedHeight || lastProcessedHeight < targetBlockHeight) {\n logger.warn(\n `Skipping reindexing to block ${targetBlockHeight}: current indexing height ${lastProcessedHeight} is behind requested block`,\n );\n return;\n }\n\n // if startHeight is greater than the targetHeight, just force clean\n if (targetBlockHeight < startHeight) {\n logger.info(\n `targetHeight: ${targetBlockHeight} is less than startHeight: ${startHeight}. Hence executing force-clean`,\n );\n if (!forceCleanService) {\n logger.error('ForceCleanService not provided, cannot force clean');\n process.exit(1);\n }\n await forceCleanService.forceClean();\n } else {\n logger.info(`Reindexing to block: ${targetBlockHeight}`);\n const transaction = await sequelize.transaction();\n try {\n await Promise.all([\n storeService.rewind(targetBlockHeight, transaction),\n unfinalizedBlockService.resetUnfinalizedBlocks(),\n unfinalizedBlockService.resetLastFinalizedVerifiedHeight(),\n dynamicDsService.resetDynamicDatasource(targetBlockHeight),\n ]);\n\n if (blockOffset) {\n await mmrService.deleteMmrNode(targetBlockHeight + 1, blockOffset);\n }\n\n // Flush metadata changes from above Promise.all\n await storeService.storeCache.metadata.flush(transaction);\n\n await transaction.commit();\n logger.info('Reindex Success');\n } catch (err) {\n logger.error(err, 'Reindexing failed');\n await transaction.rollback();\n throw err;\n }\n }\n}\n"]}
package/dist/yargs.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- export declare const yargsOptions: import("yargs").Argv<import("yargs").Omit<unknown, "batch-size" | "block-confirmations" | "config" | "db-schema" | "debug" | "dictionary-timeout" | "disable-historical" | "ipfs" | "local" | "log-level" | "mmr-path" | "multi-chain" | "network-dictionary" | "network-endpoint" | "output-fmt" | "port" | "profiler" | "proof-of-index" | "query-limit" | "scale-batch-size" | "dictionary-resolver" | "pg-ca" | "pg-key" | "pg-cert" | "store-cache-threshold" | "store-get-cache-size" | "store-cache-async" | "subquery" | "subquery-name" | "subscription" | "timeout" | "timestamp-field" | "unfinalized-blocks" | "unsafe" | "workers"> & import("yargs").InferredOptionTypes<{
1
+ export declare const yargsOptions: import("yargs").Argv<import("yargs").Omit<{
2
+ targetHeight: number;
3
+ }, "batch-size" | "block-confirmations" | "config" | "db-schema" | "debug" | "dictionary-resolver" | "dictionary-timeout" | "disable-historical" | "ipfs" | "local" | "log-level" | "mmr-path" | "multi-chain" | "network-dictionary" | "network-endpoint" | "output-fmt" | "port" | "profiler" | "proof-of-index" | "query-limit" | "scale-batch-size" | "pg-ca" | "pg-key" | "pg-cert" | "store-cache-threshold" | "store-get-cache-size" | "store-cache-async" | "subquery" | "subquery-name" | "subscription" | "timeout" | "timestamp-field" | "unfinalized-blocks" | "unsafe" | "workers"> & import("yargs").InferredOptionTypes<{
2
4
  'batch-size': {
3
5
  demandOption: false;
4
6
  describe: string;
@@ -27,6 +29,12 @@ export declare const yargsOptions: import("yargs").Argv<import("yargs").Omit<unk
27
29
  type: "boolean";
28
30
  default: boolean;
29
31
  };
32
+ 'dictionary-resolver': {
33
+ demandOption: false;
34
+ describe: string;
35
+ type: "boolean";
36
+ default: boolean;
37
+ };
30
38
  'dictionary-timeout': {
31
39
  demandOption: false;
32
40
  describe: string;
@@ -114,12 +122,6 @@ export declare const yargsOptions: import("yargs").Argv<import("yargs").Omit<unk
114
122
  describe: string;
115
123
  default: boolean;
116
124
  };
117
- 'dictionary-resolver': {
118
- demandOption: false;
119
- describe: string;
120
- type: "boolean";
121
- default: boolean;
122
- };
123
125
  'pg-ca': {
124
126
  demandOption: false;
125
127
  describe: string;
package/dist/yargs.js CHANGED
@@ -11,6 +11,18 @@ const helpers_1 = require("yargs/helpers");
11
11
  const yargs_1 = __importDefault(require("yargs/yargs"));
12
12
  exports.yargsOptions = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
13
13
  .env('SUBQL_NODE')
14
+ .command({
15
+ command: 'test',
16
+ describe: 'Run tests for a SubQuery application',
17
+ builder: {},
18
+ handler: (argv) => {
19
+ (0, logger_1.initLogger)(argv.debug, argv.outputFmt, argv.logLevel);
20
+ // lazy import to make sure logger is instantiated before all other services
21
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
22
+ const { testingInit } = require('./subcommands/testing.init');
23
+ return testingInit();
24
+ },
25
+ })
14
26
  .command({
15
27
  command: 'force-clean',
16
28
  describe: 'Clean the database dropping project schemas and tables. Once the command is executed, the application would exit upon completion.',
@@ -68,6 +80,12 @@ exports.yargsOptions = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)
68
80
  type: 'boolean',
69
81
  default: false,
70
82
  },
83
+ 'dictionary-resolver': {
84
+ demandOption: false,
85
+ describe: 'Use SubQuery Network dictionary resolver',
86
+ type: 'boolean',
87
+ default: false,
88
+ },
71
89
  'dictionary-timeout': {
72
90
  demandOption: false,
73
91
  describe: 'Max timeout for dictionary query',
@@ -155,15 +173,9 @@ exports.yargsOptions = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)
155
173
  describe: 'scale batch size based on memory usage',
156
174
  default: false,
157
175
  },
158
- 'dictionary-resolver': {
159
- demandOption: false,
160
- describe: 'Use subquery network dictionary resolver',
161
- type: 'boolean',
162
- default: false,
163
- },
164
176
  'pg-ca': {
165
177
  demandOption: false,
166
- describe: 'Postgres ca certificate - to enables TLS/SSL connections to your PostgreSQL, path to the server certificate file are required, e.g /path/to/server-certificates/root.crt',
178
+ describe: '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',
167
179
  type: 'string',
168
180
  },
169
181
  'pg-key': {
@@ -178,7 +190,7 @@ exports.yargsOptions = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)
178
190
  },
179
191
  'store-cache-threshold': {
180
192
  demandOption: false,
181
- describe: 'Store cache will flush when number of records excess this threshold',
193
+ describe: 'Store cache will flush data to the database when number of records excess this threshold',
182
194
  type: 'number',
183
195
  },
184
196
  'store-get-cache-size': {
@@ -188,7 +200,7 @@ exports.yargsOptions = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)
188
200
  },
189
201
  'store-cache-async': {
190
202
  demandOption: false,
191
- describe: 'If enabled writing data to the store is asynchronous with regards to block processing',
203
+ describe: 'If enabled the store cache will flush data asyncronously relative to indexing data',
192
204
  type: 'boolean',
193
205
  },
194
206
  subquery: {
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,aAAa;IACtB,QAAQ,EACN,mIAAmI;IACrI,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;QAChB,IAAA,mBAAU,EACR,IAAI,CAAC,KAAgB,EACrB,IAAI,CAAC,SAA+B,EACpC,IAAI,CAAC,QAA8B,CACpC,CAAC;QAEF,4EAA4E;QAC5E,8DAA8D;QAC9D,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;QACpE,OAAO,cAAc,EAAE,CAAC;IAC1B,CAAC;CACF,CAAC;KACD,OAAO,CAAC;IACP,OAAO,EAAE,SAAS;IAClB,QAAQ,EACN,gMAAgM;IAClM,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,KAAK,CAAC,OAAO,CAAC,cAAc,EAAE;QAC5B,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,kBAAkB;QAC/B,OAAO,EAAE,IAAI;KACd,CAAC;IACJ,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;QAChB,IAAA,mBAAU,EACR,IAAI,CAAC,KAAgB,E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,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;CACF,CAAC,CAAC","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: '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 .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-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 '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 'dictionary-resolver': {\n demandOption: false,\n describe: 'Use subquery network dictionary resolver',\n type: 'boolean',\n default: false,\n },\n 'pg-ca': {\n demandOption: false,\n describe:\n 'Postgres ca certificate - to enables 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 when number of records excess this threshold',\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 writing data to the store is asynchronous with regards to block processing',\n type: 'boolean',\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 });\n"]}
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;QAChB,IAAA,mBAAU,EACR,IAAI,CAAC,KAAgB,EACrB,IAAI,CAAC,SAA+B,EACpC,IAAI,CAAC,QAA8B,CACpC,CAAC;QACF,4EAA4E;QAC5E,8DAA8D;QAC9D,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;QAC9D,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;CACF,CAAC;KACD,OAAO,CAAC;IACP,OAAO,EAAE,aAAa;IACtB,QAAQ,EACN,mIAAmI;IACrI,OAAO,EAAE,EAAE;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AAY,EAAE,KAAK;QACnB,QAAQ,EACN,0FAA0F;QAC5F,IAAI,EAAE,QAAQ;KACf;CACF,CAAC,CAAC","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 .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: 'boolean',\n default: false,\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 '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-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 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 });\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@subql/node-ethereum",
3
- "version": "1.0.3-1",
3
+ "version": "1.0.3-3",
4
4
  "description": "",
5
5
  "author": "Ian He",
6
6
  "license": "Apache-2.0",
@@ -24,11 +24,12 @@
24
24
  "@nestjs/event-emitter": "^1.3.0",
25
25
  "@nestjs/platform-express": "^8.2.6",
26
26
  "@nestjs/schedule": "^1.0.2",
27
- "@subql/common": "^1.8.1",
28
- "@subql/common-ethereum": "1.0.0",
29
- "@subql/node-core": "1.11.2-storeCache-0.0.6",
30
- "@subql/types-ethereum": "1.0.1",
31
- "@subql/utils": "^1.4.1",
27
+ "@subql/common": "^2.0.0",
28
+ "@subql/common-ethereum": "1.0.1-0",
29
+ "@subql/node-core": "dev",
30
+ "@subql/testing": "^2.0.0",
31
+ "@subql/types-ethereum": "1.0.2-0",
32
+ "@subql/utils": "^2.0.0",
32
33
  "@subql/x-merkle-mountain-range": "2.0.0-0.1.2",
33
34
  "@willsoto/nestjs-prometheus": "^4.4.0",
34
35
  "algosdk": "^1.13.1",
@@ -48,7 +49,6 @@
48
49
  "rxjs": "^7.5.2",
49
50
  "sequelize": "6.28.0",
50
51
  "tar": "^6.1.11",
51
- "typescript": "^4.4.4",
52
52
  "web3-providers-http": "^1.8.0",
53
53
  "web3-providers-ws": "^1.8.0",
54
54
  "yargs": "^16.2.0"
@@ -75,5 +75,5 @@
75
75
  "/dist",
76
76
  "/bin"
77
77
  ],
78
- "stableVersion": "1.0.3-0"
78
+ "stableVersion": "1.0.3-2"
79
79
  }