@subql/node-ethereum 3.0.3 → 3.0.4-1
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/CHANGELOG.md +9 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/indexer/blockDispatcher/block-dispatcher.service.d.ts +2 -2
- package/dist/indexer/blockDispatcher/block-dispatcher.service.js +4 -3
- package/dist/indexer/blockDispatcher/block-dispatcher.service.js.map +1 -1
- package/dist/indexer/blockDispatcher/worker-block-dispatcher.service.d.ts +2 -2
- package/dist/indexer/blockDispatcher/worker-block-dispatcher.service.js +4 -3
- package/dist/indexer/blockDispatcher/worker-block-dispatcher.service.js.map +1 -1
- package/dist/indexer/fetch.module.js +5 -3
- package/dist/indexer/fetch.module.js.map +1 -1
- package/dist/indexer/project.service.d.ts +2 -2
- package/dist/indexer/project.service.js +8 -6
- package/dist/indexer/project.service.js.map +1 -1
- package/dist/indexer/project.service.test.js +1 -1
- package/dist/indexer/project.service.test.js.map +1 -1
- package/dist/indexer/worker/worker.js +1 -1
- package/dist/indexer/worker/worker.js.map +1 -1
- package/dist/init.js +1 -1
- package/dist/init.js.map +1 -1
- package/dist/subcommands/testing.service.js +1 -1
- package/dist/subcommands/testing.service.js.map +1 -1
- package/dist/yargs.d.ts +1 -2
- package/dist/yargs.js +2 -3
- package/dist/yargs.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnApplicationShutdown } from '@nestjs/common';
|
|
2
2
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
|
3
|
-
import { NodeConfig, SmartBatchService, StoreCacheService, StoreService, IProjectService, PoiService, BlockDispatcher, ProcessBlockResponse, ApiService, IProjectUpgradeService } from '@subql/node-core';
|
|
3
|
+
import { NodeConfig, SmartBatchService, StoreCacheService, StoreService, IProjectService, PoiService, BlockDispatcher, ProcessBlockResponse, ApiService, IProjectUpgradeService, PoiSyncService } from '@subql/node-core';
|
|
4
4
|
import { EthereumProjectDs, SubqueryProject } from '../../configure/SubqueryProject';
|
|
5
5
|
import { DynamicDsService } from '../dynamic-ds.service';
|
|
6
6
|
import { IndexerManager } from '../indexer.manager';
|
|
@@ -10,7 +10,7 @@ import { BlockContent } from '../types';
|
|
|
10
10
|
*/
|
|
11
11
|
export declare class BlockDispatcherService extends BlockDispatcher<BlockContent, EthereumProjectDs> implements OnApplicationShutdown {
|
|
12
12
|
private indexerManager;
|
|
13
|
-
constructor(apiService: ApiService, nodeConfig: NodeConfig, indexerManager: IndexerManager, eventEmitter: EventEmitter2, projectService: IProjectService<EthereumProjectDs>, projectUpgradeService: IProjectUpgradeService, smartBatchService: SmartBatchService, storeService: StoreService, storeCacheService: StoreCacheService, poiService: PoiService, project: SubqueryProject, dynamicDsService: DynamicDsService);
|
|
13
|
+
constructor(apiService: ApiService, nodeConfig: NodeConfig, indexerManager: IndexerManager, eventEmitter: EventEmitter2, projectService: IProjectService<EthereumProjectDs>, projectUpgradeService: IProjectUpgradeService, smartBatchService: SmartBatchService, storeService: StoreService, storeCacheService: StoreCacheService, poiService: PoiService, poiSyncService: PoiSyncService, project: SubqueryProject, dynamicDsService: DynamicDsService);
|
|
14
14
|
protected getBlockHeight(block: BlockContent): number;
|
|
15
15
|
protected indexBlock(block: BlockContent): Promise<ProcessBlockResponse>;
|
|
16
16
|
}
|
|
@@ -25,8 +25,8 @@ const indexer_manager_1 = require("../indexer.manager");
|
|
|
25
25
|
* @description Intended to behave the same as WorkerBlockDispatcherService but doesn't use worker threads or any parallel processing
|
|
26
26
|
*/
|
|
27
27
|
let BlockDispatcherService = class BlockDispatcherService extends node_core_1.BlockDispatcher {
|
|
28
|
-
constructor(apiService, nodeConfig, indexerManager, eventEmitter, projectService, projectUpgradeService, smartBatchService, storeService, storeCacheService, poiService, project, dynamicDsService) {
|
|
29
|
-
super(nodeConfig, eventEmitter, projectService, projectUpgradeService, smartBatchService, storeService, storeCacheService, poiService, project, dynamicDsService, apiService.fetchBlocks.bind(apiService));
|
|
28
|
+
constructor(apiService, nodeConfig, indexerManager, eventEmitter, projectService, projectUpgradeService, smartBatchService, storeService, storeCacheService, poiService, poiSyncService, project, dynamicDsService) {
|
|
29
|
+
super(nodeConfig, eventEmitter, projectService, projectUpgradeService, smartBatchService, storeService, storeCacheService, poiService, poiSyncService, project, dynamicDsService, apiService.fetchBlocks.bind(apiService));
|
|
30
30
|
this.indexerManager = indexerManager;
|
|
31
31
|
}
|
|
32
32
|
getBlockHeight(block) {
|
|
@@ -40,7 +40,7 @@ BlockDispatcherService = __decorate([
|
|
|
40
40
|
(0, common_1.Injectable)(),
|
|
41
41
|
__param(4, (0, common_1.Inject)('IProjectService')),
|
|
42
42
|
__param(5, (0, common_1.Inject)('IProjectUpgradeService')),
|
|
43
|
-
__param(
|
|
43
|
+
__param(11, (0, common_1.Inject)('ISubqueryProject')),
|
|
44
44
|
__metadata("design:paramtypes", [node_core_1.ApiService,
|
|
45
45
|
node_core_1.NodeConfig,
|
|
46
46
|
indexer_manager_1.IndexerManager,
|
|
@@ -48,6 +48,7 @@ BlockDispatcherService = __decorate([
|
|
|
48
48
|
node_core_1.StoreService,
|
|
49
49
|
node_core_1.StoreCacheService,
|
|
50
50
|
node_core_1.PoiService,
|
|
51
|
+
node_core_1.PoiSyncService,
|
|
51
52
|
SubqueryProject_1.SubqueryProject,
|
|
52
53
|
dynamic_ds_service_1.DynamicDsService])
|
|
53
54
|
], BlockDispatcherService);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-dispatcher.service.js","sourceRoot":"","sources":["../../../src/indexer/blockDispatcher/block-dispatcher.service.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;;;;;;;AAEnC,2CAA2E;AAC3E,yDAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"block-dispatcher.service.js","sourceRoot":"","sources":["../../../src/indexer/blockDispatcher/block-dispatcher.service.ts"],"names":[],"mappings":";AAAA,8DAA8D;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,0BAAc;QACO,iCAAe;QAClC,qCAAgB;GAnBzB,sBAAsB,CAiDlC;AAjDY,wDAAsB","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common';\nimport { EventEmitter2 } from '@nestjs/event-emitter';\nimport {\n NodeConfig,\n SmartBatchService,\n StoreCacheService,\n StoreService,\n IProjectService,\n PoiService,\n BlockDispatcher,\n ProcessBlockResponse,\n ApiService,\n IProjectUpgradeService,\n PoiSyncService,\n} from '@subql/node-core';\nimport {\n EthereumProjectDs,\n SubqueryProject,\n} from '../../configure/SubqueryProject';\nimport { DynamicDsService } from '../dynamic-ds.service';\nimport { IndexerManager } from '../indexer.manager';\nimport { BlockContent } from '../types';\n\n/**\n * @description Intended to behave the same as WorkerBlockDispatcherService but doesn't use worker threads or any parallel processing\n */\n@Injectable()\nexport class BlockDispatcherService\n extends BlockDispatcher<BlockContent, EthereumProjectDs>\n implements OnApplicationShutdown\n{\n constructor(\n apiService: ApiService,\n nodeConfig: NodeConfig,\n private indexerManager: IndexerManager,\n eventEmitter: EventEmitter2,\n @Inject('IProjectService')\n projectService: IProjectService<EthereumProjectDs>,\n @Inject('IProjectUpgradeService')\n projectUpgradeService: IProjectUpgradeService,\n smartBatchService: SmartBatchService,\n storeService: StoreService,\n storeCacheService: StoreCacheService,\n poiService: PoiService,\n poiSyncService: PoiSyncService,\n @Inject('ISubqueryProject') project: SubqueryProject,\n dynamicDsService: DynamicDsService,\n ) {\n super(\n nodeConfig,\n eventEmitter,\n projectService,\n projectUpgradeService,\n smartBatchService,\n storeService,\n storeCacheService,\n poiService,\n poiSyncService,\n project,\n dynamicDsService,\n apiService.fetchBlocks.bind(apiService),\n );\n }\n\n protected getBlockHeight(block: BlockContent): number {\n return block.number;\n }\n\n protected async indexBlock(\n block: BlockContent,\n ): Promise<ProcessBlockResponse> {\n return this.indexerManager.indexBlock(\n block,\n await this.projectService.getDataSources(this.getBlockHeight(block)),\n );\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnApplicationShutdown } from '@nestjs/common';
|
|
2
2
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
|
3
|
-
import { NodeConfig, SmartBatchService, StoreService, PoiService, StoreCacheService, IProjectService, WorkerBlockDispatcher, ConnectionPoolStateManager, IProjectUpgradeService } from '@subql/node-core';
|
|
3
|
+
import { NodeConfig, SmartBatchService, StoreService, PoiService, StoreCacheService, IProjectService, WorkerBlockDispatcher, ConnectionPoolStateManager, IProjectUpgradeService, PoiSyncService } from '@subql/node-core';
|
|
4
4
|
import { EthereumProjectDs, SubqueryProject } from '../../configure/SubqueryProject';
|
|
5
5
|
import { EthereumApiConnection } from '../../ethereum/api.connection';
|
|
6
6
|
import { DynamicDsService } from '../dynamic-ds.service';
|
|
@@ -10,7 +10,7 @@ type IndexerWorker = IIndexerWorker & {
|
|
|
10
10
|
terminate: () => Promise<number>;
|
|
11
11
|
};
|
|
12
12
|
export declare class WorkerBlockDispatcherService extends WorkerBlockDispatcher<EthereumProjectDs, IndexerWorker> implements OnApplicationShutdown {
|
|
13
|
-
constructor(nodeConfig: NodeConfig, eventEmitter: EventEmitter2, projectService: IProjectService<EthereumProjectDs>, projectUpgadeService: IProjectUpgradeService, smartBatchService: SmartBatchService, storeService: StoreService, storeCacheService: StoreCacheService, poiService: PoiService, project: SubqueryProject, dynamicDsService: DynamicDsService, unfinalizedBlocksSevice: UnfinalizedBlocksService, connectionPoolState: ConnectionPoolStateManager<EthereumApiConnection>);
|
|
13
|
+
constructor(nodeConfig: NodeConfig, eventEmitter: EventEmitter2, projectService: IProjectService<EthereumProjectDs>, projectUpgadeService: IProjectUpgradeService, smartBatchService: SmartBatchService, storeService: StoreService, storeCacheService: StoreCacheService, poiService: PoiService, poiSyncService: PoiSyncService, project: SubqueryProject, dynamicDsService: DynamicDsService, unfinalizedBlocksSevice: UnfinalizedBlocksService, connectionPoolState: ConnectionPoolStateManager<EthereumApiConnection>);
|
|
14
14
|
protected fetchBlock(worker: IndexerWorker, height: number): Promise<void>;
|
|
15
15
|
}
|
|
16
16
|
export {};
|
|
@@ -31,8 +31,8 @@ async function createIndexerWorker(store, dynamicDsService, unfinalizedBlocksSer
|
|
|
31
31
|
return indexerWorker;
|
|
32
32
|
}
|
|
33
33
|
let WorkerBlockDispatcherService = class WorkerBlockDispatcherService extends node_core_1.WorkerBlockDispatcher {
|
|
34
|
-
constructor(nodeConfig, eventEmitter, projectService, projectUpgadeService, smartBatchService, storeService, storeCacheService, poiService, project, dynamicDsService, unfinalizedBlocksSevice, connectionPoolState) {
|
|
35
|
-
super(nodeConfig, eventEmitter, projectService, projectUpgadeService, smartBatchService, storeService, storeCacheService, poiService, project, dynamicDsService, () => createIndexerWorker(storeService.getStore(), dynamicDsService, unfinalizedBlocksSevice, connectionPoolState, project.root, projectService.startHeight));
|
|
34
|
+
constructor(nodeConfig, eventEmitter, projectService, projectUpgadeService, smartBatchService, storeService, storeCacheService, poiService, poiSyncService, project, dynamicDsService, unfinalizedBlocksSevice, connectionPoolState) {
|
|
35
|
+
super(nodeConfig, eventEmitter, projectService, projectUpgadeService, smartBatchService, storeService, storeCacheService, poiService, poiSyncService, project, dynamicDsService, () => createIndexerWorker(storeService.getStore(), dynamicDsService, unfinalizedBlocksSevice, connectionPoolState, project.root, projectService.startHeight));
|
|
36
36
|
}
|
|
37
37
|
async fetchBlock(worker, height) {
|
|
38
38
|
const start = new Date();
|
|
@@ -54,12 +54,13 @@ WorkerBlockDispatcherService = __decorate([
|
|
|
54
54
|
(0, common_1.Injectable)(),
|
|
55
55
|
__param(2, (0, common_1.Inject)('IProjectService')),
|
|
56
56
|
__param(3, (0, common_1.Inject)('IProjectUpgradeService')),
|
|
57
|
-
__param(
|
|
57
|
+
__param(9, (0, common_1.Inject)('ISubqueryProject')),
|
|
58
58
|
__metadata("design:paramtypes", [node_core_1.NodeConfig,
|
|
59
59
|
event_emitter_1.EventEmitter2, Object, Object, node_core_1.SmartBatchService,
|
|
60
60
|
node_core_1.StoreService,
|
|
61
61
|
node_core_1.StoreCacheService,
|
|
62
62
|
node_core_1.PoiService,
|
|
63
|
+
node_core_1.PoiSyncService,
|
|
63
64
|
SubqueryProject_1.SubqueryProject,
|
|
64
65
|
dynamic_ds_service_1.DynamicDsService,
|
|
65
66
|
unfinalizedBlocks_service_1.UnfinalizedBlocksService,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-block-dispatcher.service.js","sourceRoot":"","sources":["../../../src/indexer/blockDispatcher/worker-block-dispatcher.service.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;;;;;;;;;;AAEnC,gDAAwB;AACxB,2CAA2E;AAC3E,yDAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"worker-block-dispatcher.service.js","sourceRoot":"","sources":["../../../src/indexer/blockDispatcher/worker-block-dispatcher.service.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;;;;;;;;;;AAEnC,gDAAwB;AACxB,2CAA2E;AAC3E,yDAAsD;AACtD,gDAqB0B;AAE1B,qEAGyC;AAEzC,8DAAyD;AAEzD,4EAAwE;AAOxE,KAAK,UAAU,mBAAmB,CAChC,KAAY,EACZ,gBAAsD,EACtD,wBAAiE,EACjE,mBAAsE,EACtE,IAAY,EACZ,WAAmB;IAEnB,MAAM,aAAa,GAAG,kBAAM,CAAC,MAAM,CAIjC,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,wCAAwC,CAAC,EACjE,CAAC,GAAG,+BAAmB,EAAE,YAAY,CAAC,8DAEjC,IAAA,8BAAkB,EAAC,KAAK,CAAC,GACzB,IAAA,kCAAsB,EAAC,gBAAgB,CAAC,KAC3C,wBAAwB,EACtB,wBAAwB,CAAC,6BAA6B,CAAC,IAAI,CACzD,wBAAwB,CACzB,KACA,IAAA,4CAAgC,EAAC,mBAAm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,eAAM,EAAC,kBAAkB,CAAC,CAAA;qCAXf,sBAAU;QACR,6BAAa,kBAKR,6BAAiB;QACtB,wBAAY;QACP,6BAAiB;QACxB,sBAAU;QACN,0BAAc;QACO,iCAAe;QAClC,qCAAgB;QACT,oDAAwB;QAC5B,sCAA0B;GAnBtC,4BAA4B,CAgExC;AAhEY,oEAA4B","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport path from 'path';\nimport { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common';\nimport { EventEmitter2 } from '@nestjs/event-emitter';\nimport {\n NodeConfig,\n Worker,\n SmartBatchService,\n StoreService,\n PoiService,\n StoreCacheService,\n IProjectService,\n IDynamicDsService,\n HostStore,\n HostDynamicDS,\n WorkerBlockDispatcher,\n IUnfinalizedBlocksService,\n ConnectionPoolStateManager,\n connectionPoolStateHostFunctions,\n baseWorkerFunctions,\n storeHostFunctions,\n dynamicDsHostFunctions,\n IProjectUpgradeService,\n HostUnfinalizedBlocks,\n PoiSyncService,\n} from '@subql/node-core';\nimport { Store } from '@subql/types-core';\nimport {\n EthereumProjectDs,\n SubqueryProject,\n} from '../../configure/SubqueryProject';\nimport { EthereumApiConnection } from '../../ethereum/api.connection';\nimport { DynamicDsService } from '../dynamic-ds.service';\nimport { BlockContent } from '../types';\nimport { UnfinalizedBlocksService } from '../unfinalizedBlocks.service';\nimport { IIndexerWorker, IInitIndexerWorker } from '../worker/worker';\n\ntype IndexerWorker = IIndexerWorker & {\n terminate: () => Promise<number>;\n};\n\nasync function createIndexerWorker(\n store: Store,\n dynamicDsService: IDynamicDsService<EthereumProjectDs>,\n unfinalizedBlocksService: IUnfinalizedBlocksService<BlockContent>,\n connectionPoolState: ConnectionPoolStateManager<EthereumApiConnection>,\n root: string,\n startHeight: number,\n): Promise<IndexerWorker> {\n const indexerWorker = Worker.create<\n IInitIndexerWorker,\n HostDynamicDS<EthereumProjectDs> & HostStore & HostUnfinalizedBlocks\n >(\n path.resolve(__dirname, '../../../dist/indexer/worker/worker.js'),\n [...baseWorkerFunctions, 'initWorker'],\n {\n ...storeHostFunctions(store),\n ...dynamicDsHostFunctions(dynamicDsService),\n unfinalizedBlocksProcess:\n unfinalizedBlocksService.processUnfinalizedBlockHeader.bind(\n unfinalizedBlocksService,\n ),\n ...connectionPoolStateHostFunctions(connectionPoolState),\n },\n root,\n );\n\n await indexerWorker.initWorker(startHeight);\n\n return indexerWorker;\n}\n\n@Injectable()\nexport class WorkerBlockDispatcherService\n extends WorkerBlockDispatcher<EthereumProjectDs, IndexerWorker>\n implements OnApplicationShutdown\n{\n constructor(\n nodeConfig: NodeConfig,\n eventEmitter: EventEmitter2,\n @Inject('IProjectService')\n projectService: IProjectService<EthereumProjectDs>,\n @Inject('IProjectUpgradeService')\n projectUpgadeService: IProjectUpgradeService,\n smartBatchService: SmartBatchService,\n storeService: StoreService,\n storeCacheService: StoreCacheService,\n poiService: PoiService,\n poiSyncService: PoiSyncService,\n @Inject('ISubqueryProject') project: SubqueryProject,\n dynamicDsService: DynamicDsService,\n unfinalizedBlocksSevice: UnfinalizedBlocksService,\n connectionPoolState: ConnectionPoolStateManager<EthereumApiConnection>,\n ) {\n super(\n nodeConfig,\n eventEmitter,\n projectService,\n projectUpgadeService,\n smartBatchService,\n storeService,\n storeCacheService,\n poiService,\n poiSyncService,\n project,\n dynamicDsService,\n () =>\n createIndexerWorker(\n storeService.getStore(),\n dynamicDsService,\n unfinalizedBlocksSevice,\n connectionPoolState,\n project.root,\n projectService.startHeight,\n ),\n );\n }\n\n protected async fetchBlock(\n worker: IndexerWorker,\n height: number,\n ): Promise<void> {\n const start = new Date();\n await worker.fetchBlock(height, null);\n const end = new Date();\n\n // const waitTime = end.getTime() - start.getTime();\n // if (waitTime > 1000) {\n // logger.info(\n // `Waiting to fetch block ${height}: ${chalk.red(`${waitTime}ms`)}`,\n // );\n // } else if (waitTime > 200) {\n // logger.info(\n // `Waiting to fetch block ${height}: ${chalk.yellow(`${waitTime}ms`)}`,\n // );\n // }\n }\n}\n"]}
|
|
@@ -62,9 +62,9 @@ FetchModule = __decorate([
|
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
provide: 'IBlockDispatcher',
|
|
65
|
-
useFactory: (nodeConfig, eventEmitter, projectService, projectUpgradeService, apiService, indexerManager, smartBatchService, storeService, storeCacheService, poiService, project, dynamicDsService, unfinalizedBlocks, connectionPoolState) => nodeConfig.workers !== undefined
|
|
66
|
-
? new blockDispatcher_1.WorkerBlockDispatcherService(nodeConfig, eventEmitter, projectService, projectUpgradeService, smartBatchService, storeService, storeCacheService, poiService, project, dynamicDsService, unfinalizedBlocks, connectionPoolState)
|
|
67
|
-
: new blockDispatcher_1.BlockDispatcherService(apiService, nodeConfig, indexerManager, eventEmitter, projectService, projectUpgradeService, smartBatchService, storeService, storeCacheService, poiService, project, dynamicDsService),
|
|
65
|
+
useFactory: (nodeConfig, eventEmitter, projectService, projectUpgradeService, apiService, indexerManager, smartBatchService, storeService, storeCacheService, poiService, poiSyncService, project, dynamicDsService, unfinalizedBlocks, connectionPoolState) => nodeConfig.workers !== undefined
|
|
66
|
+
? new blockDispatcher_1.WorkerBlockDispatcherService(nodeConfig, eventEmitter, projectService, projectUpgradeService, smartBatchService, storeService, storeCacheService, poiService, poiSyncService, project, dynamicDsService, unfinalizedBlocks, connectionPoolState)
|
|
67
|
+
: new blockDispatcher_1.BlockDispatcherService(apiService, nodeConfig, indexerManager, eventEmitter, projectService, projectUpgradeService, smartBatchService, storeService, storeCacheService, poiService, poiSyncService, project, dynamicDsService),
|
|
68
68
|
inject: [
|
|
69
69
|
node_core_1.NodeConfig,
|
|
70
70
|
event_emitter_1.EventEmitter2,
|
|
@@ -76,6 +76,7 @@ FetchModule = __decorate([
|
|
|
76
76
|
node_core_1.StoreService,
|
|
77
77
|
node_core_1.StoreCacheService,
|
|
78
78
|
node_core_1.PoiService,
|
|
79
|
+
node_core_1.PoiSyncService,
|
|
79
80
|
'ISubqueryProject',
|
|
80
81
|
dynamic_ds_service_1.DynamicDsService,
|
|
81
82
|
unfinalizedBlocks_service_1.UnfinalizedBlocksService,
|
|
@@ -98,6 +99,7 @@ FetchModule = __decorate([
|
|
|
98
99
|
ds_processor_service_1.DsProcessorService,
|
|
99
100
|
dynamic_ds_service_1.DynamicDsService,
|
|
100
101
|
node_core_1.PoiService,
|
|
102
|
+
node_core_1.PoiSyncService,
|
|
101
103
|
{
|
|
102
104
|
useClass: project_service_1.ProjectService,
|
|
103
105
|
provide: 'IProjectService',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.module.js","sourceRoot":"","sources":["../../src/indexer/fetch.module.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;AAEnC,2CAAwC;AACxC,yDAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"fetch.module.js","sourceRoot":"","sources":["../../src/indexer/fetch.module.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;AAEnC,2CAAwC;AACxC,yDAAsD;AACtD,gDAa0B;AAG1B,2EAAsE;AACtE,uDAG2B;AAC3B,6DAAyD;AACzD,iEAA4D;AAC5D,6DAAwD;AACxD,mDAA+C;AAC/C,uDAAmD;AACnD,uDAAmD;AACnD,uDAAmD;AACnD,2EAAuE;AAoJhE,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,WAAW;IAlJvB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT,wBAAY;YACZ,6BAAiB;YACjB;gBACE,OAAO,EAAE,sBAAU;gBACnB,UAAU,EAAE,KAAK,EACf,OAAwB,EACxB,qBAAmE,EACnE,YAA2B,EAC3B,UAAsB,EACtB,EAAE;oBACF,MAAM,UAAU,GAAG,IAAI,yCAAkB,CACvC,OAAO,EACP,qBAAqB,EACrB,YAAY,EACZ,UAAU,CACX,CAAC;oBACF,MAAM,UAAU,CAAC,IAAI,EA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B,EACjB,UAAU,EACV,cAAc,EACd,OAAO,EACP,gBAAgB,CACjB;gBACP,MAAM,EAAE;oBACN,sBAAU;oBACV,6BAAa;oBACb,iBAAiB;oBACjB,wBAAwB;oBACxB,sBAAU;oBACV,gCAAc;oBACd,6BAAiB;oBACjB,wBAAY;oBACZ,6BAAiB;oBACjB,sBAAU;oBACV,0BAAc;oBACd,kBAAkB;oBAClB,qCAAgB;oBAChB,oDAAwB;oBACxB,sCAA0B;iBAC3B;aACF;YACD,4BAAY;YACZ,iCAAqB;YACrB,oCAAwB;YACxB,+BAAmB;YACnB;gBACE,OAAO,EAAE,sCAAiB;gBAC1B,UAAU,EAAE,KAAK,EACf,OAAwB,EACxB,UAAsB,EACtB,YAA2B,EAC3B,EAAE;oBACF,MAAM,iBAAiB,GAAG,MAAM,sCAAiB,CAAC,MAAM,CACtD,OAAO,EACP,UAAU,EACV,YAAY,CACb,CAAC;oBACF,OAAO,iBAAiB,CAAC;gBAC3B,CAAC;gBACD,MAAM,EAAE,CAAC,kBAAkB,EAAE,sBAAU,EAAE,6BAAa,CAAC;aACxD;YACD,gCAAc;YACd,yCAAkB;YAClB,qCAAgB;YAChB,sBAAU;YACV,0BAAc;YACd;gBACE,QAAQ,EAAE,gCAAc;gBACxB,OAAO,EAAE,iBAAiB;aAC3B;YACD,oDAAwB;SACzB;QACD,OAAO,EAAE,CAAC,wBAAY,EAAE,6BAAiB,CAAC;KAC3C,CAAC;GACW,WAAW,CAAG;AAAd,kCAAW","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { Module } from '@nestjs/common';\nimport { EventEmitter2 } from '@nestjs/event-emitter';\nimport {\n PoiBenchmarkService,\n IndexingBenchmarkService,\n StoreService,\n PoiService,\n ApiService,\n NodeConfig,\n ConnectionPoolService,\n ConnectionPoolStateManager,\n SmartBatchService,\n StoreCacheService,\n IProjectUpgradeService,\n PoiSyncService,\n} from '@subql/node-core';\nimport { SubqueryProject } from '../configure/SubqueryProject';\nimport { EthereumApiConnection } from '../ethereum/api.connection';\nimport { EthereumApiService } from '../ethereum/api.service.ethereum';\nimport {\n BlockDispatcherService,\n WorkerBlockDispatcherService,\n} from './blockDispatcher';\nimport { DictionaryService } from './dictionary.service';\nimport { DsProcessorService } from './ds-processor.service';\nimport { DynamicDsService } from './dynamic-ds.service';\nimport { FetchService } from './fetch.service';\nimport { IndexerManager } from './indexer.manager';\nimport { ProjectService } from './project.service';\nimport { SandboxService } from './sandbox.service';\nimport { UnfinalizedBlocksService } from './unfinalizedBlocks.service';\n\n@Module({\n providers: [\n StoreService,\n StoreCacheService,\n {\n provide: ApiService,\n useFactory: async (\n project: SubqueryProject,\n connectionPoolService: ConnectionPoolService<EthereumApiConnection>,\n eventEmitter: EventEmitter2,\n nodeConfig: NodeConfig,\n ) => {\n const apiService = new EthereumApiService(\n project,\n connectionPoolService,\n eventEmitter,\n nodeConfig,\n );\n await apiService.init();\n return apiService;\n },\n inject: [\n 'ISubqueryProject',\n ConnectionPoolService,\n EventEmitter2,\n NodeConfig,\n ],\n },\n IndexerManager,\n ConnectionPoolStateManager,\n ConnectionPoolService,\n {\n provide: SmartBatchService,\n useFactory: (nodeConfig: NodeConfig) => {\n return new SmartBatchService(nodeConfig.batchSize);\n },\n inject: [NodeConfig],\n },\n {\n provide: SmartBatchService,\n useFactory: (nodeConfig: NodeConfig) => {\n return new SmartBatchService(nodeConfig.batchSize);\n },\n inject: [NodeConfig],\n },\n {\n provide: 'IBlockDispatcher',\n useFactory: (\n nodeConfig: NodeConfig,\n eventEmitter: EventEmitter2,\n projectService: ProjectService,\n projectUpgradeService: IProjectUpgradeService,\n apiService: EthereumApiService,\n indexerManager: IndexerManager,\n smartBatchService: SmartBatchService,\n storeService: StoreService,\n storeCacheService: StoreCacheService,\n poiService: PoiService,\n poiSyncService: PoiSyncService,\n project: SubqueryProject,\n dynamicDsService: DynamicDsService,\n unfinalizedBlocks: UnfinalizedBlocksService,\n connectionPoolState: ConnectionPoolStateManager<EthereumApiConnection>,\n ) =>\n nodeConfig.workers !== undefined\n ? new WorkerBlockDispatcherService(\n nodeConfig,\n eventEmitter,\n projectService,\n projectUpgradeService,\n smartBatchService,\n storeService,\n storeCacheService,\n poiService,\n poiSyncService,\n project,\n dynamicDsService,\n unfinalizedBlocks,\n connectionPoolState,\n )\n : new BlockDispatcherService(\n apiService,\n nodeConfig,\n indexerManager,\n eventEmitter,\n projectService,\n projectUpgradeService,\n smartBatchService,\n storeService,\n storeCacheService,\n poiService,\n poiSyncService,\n project,\n dynamicDsService,\n ),\n inject: [\n NodeConfig,\n EventEmitter2,\n 'IProjectService',\n 'IProjectUpgradeService',\n ApiService,\n IndexerManager,\n SmartBatchService,\n StoreService,\n StoreCacheService,\n PoiService,\n PoiSyncService,\n 'ISubqueryProject',\n DynamicDsService,\n UnfinalizedBlocksService,\n ConnectionPoolStateManager,\n ],\n },\n FetchService,\n ConnectionPoolService,\n IndexingBenchmarkService,\n PoiBenchmarkService,\n {\n provide: DictionaryService,\n useFactory: async (\n project: SubqueryProject,\n nodeConfig: NodeConfig,\n eventEmitter: EventEmitter2,\n ) => {\n const dictionaryService = await DictionaryService.create(\n project,\n nodeConfig,\n eventEmitter,\n );\n return dictionaryService;\n },\n inject: ['ISubqueryProject', NodeConfig, EventEmitter2],\n },\n SandboxService,\n DsProcessorService,\n DynamicDsService,\n PoiService,\n PoiSyncService,\n {\n useClass: ProjectService,\n provide: 'IProjectService',\n },\n UnfinalizedBlocksService,\n ],\n exports: [StoreService, StoreCacheService],\n})\nexport class FetchModule {}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
|
2
|
-
import { PoiService, BaseProjectService, StoreService, NodeConfig, IProjectUpgradeService } from '@subql/node-core';
|
|
2
|
+
import { PoiService, PoiSyncService, BaseProjectService, StoreService, NodeConfig, IProjectUpgradeService } from '@subql/node-core';
|
|
3
3
|
import { Sequelize } from '@subql/x-sequelize';
|
|
4
4
|
import { EthereumProjectDs, SubqueryProject } from '../configure/SubqueryProject';
|
|
5
5
|
import { EthereumApiService } from '../ethereum';
|
|
@@ -9,7 +9,7 @@ import { UnfinalizedBlocksService } from './unfinalizedBlocks.service';
|
|
|
9
9
|
export declare class ProjectService extends BaseProjectService<EthereumApiService, EthereumProjectDs> {
|
|
10
10
|
protected readonly projectUpgradeService: IProjectUpgradeService<SubqueryProject>;
|
|
11
11
|
protected packageVersion: any;
|
|
12
|
-
constructor(dsProcessorService: DsProcessorService, apiService: EthereumApiService, poiService: PoiService, sequelize: Sequelize, project: SubqueryProject, projectUpgradeService: IProjectUpgradeService<SubqueryProject>, storeService: StoreService, nodeConfig: NodeConfig, dynamicDsService: DynamicDsService, eventEmitter: EventEmitter2, unfinalizedBlockService: UnfinalizedBlocksService);
|
|
12
|
+
constructor(dsProcessorService: DsProcessorService, apiService: EthereumApiService, poiService: PoiService, poiSyncService: PoiSyncService, sequelize: Sequelize, project: SubqueryProject, projectUpgradeService: IProjectUpgradeService<SubqueryProject>, storeService: StoreService, nodeConfig: NodeConfig, dynamicDsService: DynamicDsService, eventEmitter: EventEmitter2, unfinalizedBlockService: UnfinalizedBlocksService);
|
|
13
13
|
protected getBlockTimestamp(height: number): Promise<Date>;
|
|
14
14
|
protected onProjectChange(project: SubqueryProject): void | Promise<void>;
|
|
15
15
|
}
|
|
@@ -28,8 +28,8 @@ const unfinalizedBlocks_service_1 = require("./unfinalizedBlocks.service");
|
|
|
28
28
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
29
29
|
const { version: packageVersion } = require('../../package.json');
|
|
30
30
|
let ProjectService = class ProjectService extends node_core_1.BaseProjectService {
|
|
31
|
-
constructor(dsProcessorService, apiService, poiService, sequelize, project, projectUpgradeService, storeService, nodeConfig, dynamicDsService, eventEmitter, unfinalizedBlockService) {
|
|
32
|
-
super(dsProcessorService, apiService, poiService, sequelize, project, projectUpgradeService, storeService, nodeConfig, dynamicDsService, eventEmitter, unfinalizedBlockService);
|
|
31
|
+
constructor(dsProcessorService, apiService, poiService, poiSyncService, sequelize, project, projectUpgradeService, storeService, nodeConfig, dynamicDsService, eventEmitter, unfinalizedBlockService) {
|
|
32
|
+
super(dsProcessorService, apiService, poiService, poiSyncService, sequelize, project, projectUpgradeService, storeService, nodeConfig, dynamicDsService, eventEmitter, unfinalizedBlockService);
|
|
33
33
|
this.projectUpgradeService = projectUpgradeService;
|
|
34
34
|
this.packageVersion = packageVersion;
|
|
35
35
|
}
|
|
@@ -46,13 +46,15 @@ ProjectService = __decorate([
|
|
|
46
46
|
(0, common_1.Injectable)(),
|
|
47
47
|
__param(1, (0, common_1.Inject)(node_core_1.ApiService)),
|
|
48
48
|
__param(2, (0, common_1.Inject)(worker_threads_1.isMainThread ? node_core_1.PoiService : 'Null')),
|
|
49
|
-
__param(3, (0, common_1.Inject)(worker_threads_1.isMainThread ?
|
|
50
|
-
__param(4, (0, common_1.Inject)('
|
|
51
|
-
__param(5, (0, common_1.Inject)('
|
|
52
|
-
__param(6, (0, common_1.Inject)(
|
|
49
|
+
__param(3, (0, common_1.Inject)(worker_threads_1.isMainThread ? node_core_1.PoiSyncService : 'Null')),
|
|
50
|
+
__param(4, (0, common_1.Inject)(worker_threads_1.isMainThread ? x_sequelize_1.Sequelize : 'Null')),
|
|
51
|
+
__param(5, (0, common_1.Inject)('ISubqueryProject')),
|
|
52
|
+
__param(6, (0, common_1.Inject)('IProjectUpgradeService')),
|
|
53
|
+
__param(7, (0, common_1.Inject)(worker_threads_1.isMainThread ? node_core_1.StoreService : 'Null')),
|
|
53
54
|
__metadata("design:paramtypes", [ds_processor_service_1.DsProcessorService,
|
|
54
55
|
ethereum_1.EthereumApiService,
|
|
55
56
|
node_core_1.PoiService,
|
|
57
|
+
node_core_1.PoiSyncService,
|
|
56
58
|
x_sequelize_1.Sequelize,
|
|
57
59
|
SubqueryProject_1.SubqueryProject, Object, node_core_1.StoreService,
|
|
58
60
|
node_core_1.NodeConfig,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.service.js","sourceRoot":"","sources":["../../src/indexer/project.service.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;;;;;;;AAEnC,mDAA8C;AAC9C,2CAAoD;AACpD,yDAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"project.service.js","sourceRoot":"","sources":["../../src/indexer/project.service.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;;;;;;;AAEnC,mDAA8C;AAC9C,2CAAoD;AACpD,yDAAsD;AACtD,gDAQ0B;AAC1B,oDAA+C;AAC/C,kEAGsC;AACtC,0CAAiD;AACjD,iEAA4D;AAC5D,6DAAwD;AACxD,2EAAuE;AAEvE,8DAA8D;AAC9D,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAG3D,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,8BAGnC;IAGC,YACE,kBAAsC,EAClB,UAA8B,EACN,UAAsB,EAElE,cAA8B,EACa,SAAoB,EACnC,OAAwB,EAEjC,qBAA8D,EACnC,YAA0B,EACxE,UAAsB,EACtB,gBAAkC,EAClC,YAA2B,EAC3B,uBAAiD;QAEjD,KAAK,CACH,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,cAAc,EACd,SAAS,EACT,OAAO,EACP,qBAAqB,EACrB,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,uBAAuB,CACxB,CAAC;QApBiB,0BAAqB,GAArB,qBAAqB,CAAyC;QAXzE,mBAAc,GAAG,cAAc,CAAC;IAgC1C,CAAC;IAES,KAAK,CAAC,iBAAiB,CAAC,MAAc;QAC9C,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAEnE,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,0CAA0C;IACrF,CAAC;IAES,eAAe,CAAC,OAAwB;QAChD,+DAA+D;QAC/D,IAAI,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC;IACxC,CAAC;CACF,CAAA;AAhDY,cAAc;IAD1B,IAAA,mBAAU,GAAE;IASR,WAAA,IAAA,eAAM,EAAC,sBAAU,CAAC,CAAA;IAClB,WAAA,IAAA,eAAM,EAAC,6BAAY,CAAC,CAAC,CAAC,sBAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IAC1C,WAAA,IAAA,eAAM,EAAC,6BAAY,CAAC,CAAC,CAAC,0BAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IAE9C,WAAA,IAAA,eAAM,EAAC,6BAAY,CAAC,CAAC,CAAC,uBAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IACzC,WAAA,IAAA,eAAM,EAAC,kBAAkB,CAAC,CAAA;IAC1B,WAAA,IAAA,eAAM,EAAC,wBAAwB,CAAC,CAAA;IAEhC,WAAA,IAAA,eAAM,EAAC,6BAAY,CAAC,CAAC,CAAC,wBAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;qCATzB,yCAAkB;QACN,6BAAkB;QACM,sBAAU;QAElD,0BAAc;QACwB,uBAAS;QAC1B,iCAAe,UAGQ,wBAAY;QAC5D,sBAAU;QACJ,qCAAgB;QACpB,6BAAa;QACF,oDAAwB;GApBxC,cAAc,CAgD1B;AAhDY,wCAAc","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { isMainThread } from 'worker_threads';\nimport { Inject, Injectable } from '@nestjs/common';\nimport { EventEmitter2 } from '@nestjs/event-emitter';\nimport {\n PoiService,\n PoiSyncService,\n BaseProjectService,\n StoreService,\n NodeConfig,\n IProjectUpgradeService,\n ApiService,\n} from '@subql/node-core';\nimport { Sequelize } from '@subql/x-sequelize';\nimport {\n EthereumProjectDs,\n SubqueryProject,\n} from '../configure/SubqueryProject';\nimport { EthereumApiService } from '../ethereum';\nimport { DsProcessorService } from './ds-processor.service';\nimport { DynamicDsService } from './dynamic-ds.service';\nimport { UnfinalizedBlocksService } from './unfinalizedBlocks.service';\n\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst { version: packageVersion } = require('../../package.json');\n\n@Injectable()\nexport class ProjectService extends BaseProjectService<\n EthereumApiService,\n EthereumProjectDs\n> {\n protected packageVersion = packageVersion;\n\n constructor(\n dsProcessorService: DsProcessorService,\n @Inject(ApiService) apiService: EthereumApiService,\n @Inject(isMainThread ? PoiService : 'Null') poiService: PoiService,\n @Inject(isMainThread ? PoiSyncService : 'Null')\n poiSyncService: PoiSyncService,\n @Inject(isMainThread ? Sequelize : 'Null') sequelize: Sequelize,\n @Inject('ISubqueryProject') project: SubqueryProject,\n @Inject('IProjectUpgradeService')\n protected readonly projectUpgradeService: IProjectUpgradeService<SubqueryProject>,\n @Inject(isMainThread ? StoreService : 'Null') storeService: StoreService,\n nodeConfig: NodeConfig,\n dynamicDsService: DynamicDsService,\n eventEmitter: EventEmitter2,\n unfinalizedBlockService: UnfinalizedBlocksService,\n ) {\n super(\n dsProcessorService,\n apiService,\n poiService,\n poiSyncService,\n sequelize,\n project,\n projectUpgradeService,\n storeService,\n nodeConfig,\n dynamicDsService,\n eventEmitter,\n unfinalizedBlockService,\n );\n }\n\n protected async getBlockTimestamp(height: number): Promise<Date> {\n const block = await this.apiService.unsafeApi.api.getBlock(height);\n\n return new Date(block.timestamp * 1000); // TODO test and make sure its in MS not S\n }\n\n protected onProjectChange(project: SubqueryProject): void | Promise<void> {\n // TODO update this when implementing skipBlock feature for Eth\n this.apiService.updateBlockFetching();\n }\n}\n"]}
|
|
@@ -16,7 +16,7 @@ describe('ProjectService', () => {
|
|
|
16
16
|
let projectService;
|
|
17
17
|
beforeEach(() => {
|
|
18
18
|
const apiService = mockApiService();
|
|
19
|
-
projectService = new project_service_1.ProjectService(null, apiService, null, null, null, null, null, {}, null, null, null);
|
|
19
|
+
projectService = new project_service_1.ProjectService(null, apiService, null, null, null, null, null, null, {}, null, null, null);
|
|
20
20
|
});
|
|
21
21
|
it('can get a block timestamps', async () => {
|
|
22
22
|
const timestamp = await projectService.getBlockTimestamp(4000000);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.service.test.js","sourceRoot":"","sources":["../../src/indexer/project.service.test.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;AAEnC,yDAAsD;AACtD,0CAA8D;AAC9D,uDAAmD;AAEnD,MAAM,cAAc,GAAG,GAAuB,EAAE;IAC9C,MAAM,MAAM,GAAG,IAAI,sBAAW,CAC5B,sCAAsC,EACtC,EAAE,EACF,IAAI,6BAAa,EAAE,CACpB,CAAC;IAEF,uBAAuB;IAEvB,OAAO;QACL,SAAS,EAAE,MAAM;KACX,CAAC;AACX,CAAC,CAAC;AAEF,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,IAAI,cAA8B,CAAC;IAEnC,UAAU,CAAC,GAAG,EAAE;QACd,MAAM,UAAU,GAAG,cAAc,EAAE,CAAC;QAEpC,cAAc,GAAG,IAAI,gCAAc,CACjC,IAAI,EACJ,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,EAAS,EACT,IAAI,EACJ,IAAI,EACJ,IAAI,CACL,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC1C,MAAM,SAAS,GAAG,MAAO,cAAsB,CAAC,iBAAiB,CAC/D,OAAS,CACV,CAAC;QAEF,MAAM,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,0BAA0B,CAAC,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { EventEmitter2 } from '@nestjs/event-emitter';\nimport { EthereumApi, EthereumApiService } from '../ethereum';\nimport { ProjectService } from './project.service';\n\nconst mockApiService = (): EthereumApiService => {\n const ethApi = new EthereumApi(\n 'https://eth.api.onfinality.io/public',\n 20,\n new EventEmitter2(),\n );\n\n // await ethApi.init();\n\n return {\n unsafeApi: ethApi,\n } as any;\n};\n\ndescribe('ProjectService', () => {\n let projectService: ProjectService;\n\n beforeEach(() => {\n const apiService = mockApiService();\n\n projectService = new ProjectService(\n null,\n apiService,\n null,\n null,\n null,\n null,\n null,\n {} as any,\n null,\n null,\n null,\n );\n });\n\n it('can get a block timestamps', async () => {\n const timestamp = await (projectService as any).getBlockTimestamp(\n 4_000_000,\n );\n\n expect(timestamp).toEqual(new Date('2017-07-09T20:52:47.000Z'));\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"project.service.test.js","sourceRoot":"","sources":["../../src/indexer/project.service.test.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;AAEnC,yDAAsD;AACtD,0CAA8D;AAC9D,uDAAmD;AAEnD,MAAM,cAAc,GAAG,GAAuB,EAAE;IAC9C,MAAM,MAAM,GAAG,IAAI,sBAAW,CAC5B,sCAAsC,EACtC,EAAE,EACF,IAAI,6BAAa,EAAE,CACpB,CAAC;IAEF,uBAAuB;IAEvB,OAAO;QACL,SAAS,EAAE,MAAM;KACX,CAAC;AACX,CAAC,CAAC;AAEF,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,IAAI,cAA8B,CAAC;IAEnC,UAAU,CAAC,GAAG,EAAE;QACd,MAAM,UAAU,GAAG,cAAc,EAAE,CAAC;QAEpC,cAAc,GAAG,IAAI,gCAAc,CACjC,IAAI,EACJ,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,EAAS,EACT,IAAI,EACJ,IAAI,EACJ,IAAI,CACL,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC1C,MAAM,SAAS,GAAG,MAAO,cAAsB,CAAC,iBAAiB,CAC/D,OAAS,CACV,CAAC;QAEF,MAAM,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,0BAA0B,CAAC,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { EventEmitter2 } from '@nestjs/event-emitter';\nimport { EthereumApi, EthereumApiService } from '../ethereum';\nimport { ProjectService } from './project.service';\n\nconst mockApiService = (): EthereumApiService => {\n const ethApi = new EthereumApi(\n 'https://eth.api.onfinality.io/public',\n 20,\n new EventEmitter2(),\n );\n\n // await ethApi.init();\n\n return {\n unsafeApi: ethApi,\n } as any;\n};\n\ndescribe('ProjectService', () => {\n let projectService: ProjectService;\n\n beforeEach(() => {\n const apiService = mockApiService();\n\n projectService = new ProjectService(\n null,\n apiService,\n null,\n null,\n null,\n null,\n null,\n null,\n {} as any,\n null,\n null,\n null,\n );\n });\n\n it('can get a block timestamps', async () => {\n const timestamp = await (projectService as any).getBlockTimestamp(\n 4_000_000,\n );\n\n expect(timestamp).toEqual(new Date('2017-07-09T20:52:47.000Z'));\n });\n});\n"]}
|
|
@@ -19,7 +19,7 @@ const logger = (0, node_core_1.getLogger)(`worker #${node_worker_threads_1.threa
|
|
|
19
19
|
async function initWorker(startHeight) {
|
|
20
20
|
try {
|
|
21
21
|
const app = await core_1.NestFactory.create(worker_module_1.WorkerModule, {
|
|
22
|
-
logger: new node_core_1.NestLogger(argv.debug), // TIP: If the worker is crashing comment out this line for better logging
|
|
22
|
+
logger: new node_core_1.NestLogger(!!argv.debug), // TIP: If the worker is crashing comment out this line for better logging
|
|
23
23
|
});
|
|
24
24
|
await app.init();
|
|
25
25
|
const projectService = app.get('IProjectService');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../../../src/indexer/worker/worker.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;AAEnC,iEAAiE;AACjE,kDAAkD;AAClD,wCAAwC;AACxC,oDAAqD;AACrD,wCAAwC;AACxC,uCAA2C;AAE3C,MAAM,EAAE,IAAI,EAAE,GAAG,oBAAY,CAAC;AAE9B,IAAA,mBAAU,EACR,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,SAA+B,EACpC,IAAI,CAAC,QAA8B,CACpC,CAAC;AAEF,6DAA+C;AAC/C,uCAA2C;AAC3C,gDAM0B;AAE1B,mDAA+C;AAC/C,qDAAiD;AAEjD,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,WAAW,8BAAQ,EAAE,CAAC,CAAC;AAEhD,KAAK,UAAU,UAAU,CAAC,WAAmB;IAC3C,IAAI;QACF,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAC,4BAAY,EAAE;YACjD,MAAM,EAAE,IAAI,sBAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,0EAA0E;
|
|
1
|
+
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../../../src/indexer/worker/worker.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;AAEnC,iEAAiE;AACjE,kDAAkD;AAClD,wCAAwC;AACxC,oDAAqD;AACrD,wCAAwC;AACxC,uCAA2C;AAE3C,MAAM,EAAE,IAAI,EAAE,GAAG,oBAAY,CAAC;AAE9B,IAAA,mBAAU,EACR,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,SAA+B,EACpC,IAAI,CAAC,QAA8B,CACpC,CAAC;AAEF,6DAA+C;AAC/C,uCAA2C;AAC3C,gDAM0B;AAE1B,mDAA+C;AAC/C,qDAAiD;AAEjD,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,WAAW,8BAAQ,EAAE,CAAC,CAAC;AAEhD,KAAK,UAAU,UAAU,CAAC,WAAmB;IAC3C,IAAI;QACF,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAC,4BAAY,EAAE;YACjD,MAAM,EAAE,IAAI,sBAAU,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,0EAA0E;SACjH,CAAC,CAAC;QAEH,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAEjB,MAAM,cAAc,GAAmB,GAAG,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAClE,uGAAuG;QACvG,MAAM,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAEvC,MAAM,aAAa,GAAG,GAAG,CAAC,GAAG,CAAC,8BAAa,CAAC,CAAC;QAE7C,IAAA,8BAAkB,EAAC,GAAG,EAAE,aAAa,CAAC,CAAC;KACxC;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,CAAC,CAAC,CAAC;QACzC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,wBAAwB,CAAC,CAAC;QAC1C,MAAM,CAAC,CAAC;KACT;AACH,CAAC;AAQA,MAAc,CAAC,IAAI,GAAG,IAAA,4BAAgB,EAAC,EAAE,EAAE;IAC1C,UAAU;CACX,CAAC,CAAC","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\n// initlogger and yargs must be imported before all other imports\n// making sure logger is defined before its called\n// eslint-disable-next-line import/order\nimport { initLogger } from '@subql/node-core/logger';\n// eslint-disable-next-line import/order\nimport { yargsOptions } from '../../yargs';\n\nconst { argv } = yargsOptions;\n\ninitLogger(\n argv.debug,\n argv.outputFmt as 'json' | 'colored',\n argv.logLevel as string | undefined,\n);\n\nimport { threadId } from 'node:worker_threads';\nimport { NestFactory } from '@nestjs/core';\nimport {\n getLogger,\n NestLogger,\n createWorkerHost,\n IBaseIndexerWorker,\n initWorkerServices,\n} from '@subql/node-core';\nimport { ProjectService } from '../project.service';\nimport { WorkerModule } from './worker.module';\nimport { WorkerService } from './worker.service';\n\nconst logger = getLogger(`worker #${threadId}`);\n\nasync function initWorker(startHeight: number): Promise<void> {\n try {\n const app = await NestFactory.create(WorkerModule, {\n logger: new NestLogger(!!argv.debug), // TIP: If the worker is crashing comment out this line for better logging\n });\n\n await app.init();\n\n const projectService: ProjectService = app.get('IProjectService');\n // Initialise async services, we do this here rather than in factories so we can capture one off events\n await projectService.init(startHeight);\n\n const workerService = app.get(WorkerService);\n\n initWorkerServices(app, workerService);\n } catch (e) {\n console.log('Failed to start worker', e);\n logger.error(e, 'Failed to start worker');\n throw e;\n }\n}\n\nexport type IIndexerWorker = IBaseIndexerWorker;\n\nexport type IInitIndexerWorker = IIndexerWorker & {\n initWorker: typeof initWorker;\n};\n\n(global as any).host = createWorkerHost([], {\n initWorker,\n});\n"]}
|
package/dist/init.js
CHANGED
|
@@ -32,7 +32,7 @@ async function bootstrap() {
|
|
|
32
32
|
}
|
|
33
33
|
try {
|
|
34
34
|
const app = await core_1.NestFactory.create(app_module_1.AppModule, {
|
|
35
|
-
logger: new node_core_1.NestLogger(debug),
|
|
35
|
+
logger: new node_core_1.NestLogger(!!debug),
|
|
36
36
|
});
|
|
37
37
|
await app.init();
|
|
38
38
|
const projectService = app.get('IProjectService');
|
package/dist/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;AAEnC,uCAA2C;AAC3C,0CAAiE;AACjE,gDAAyD;AACzD,6CAAyC;AACzC,2DAAuD;AAEvD,mCAAuC;AACvC,MAAM,KAAK,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC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C,CAAC,CAAC,KAAK,CAAC;SAChC,CAAC,CAAC;QACH,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAEjB,MAAM,cAAc,GAAmB,GAAG,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAClE,MAAM,YAAY,GAAG,GAAG,CAAC,GAAG,CAAC,4BAAY,CAAC,CAAC;QAE3C,yGAAyG;QACzG,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC;QAC5B,MAAM,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QAEpD,GAAG,CAAC,mBAAmB,EAAE,CAAC;QAE1B,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAEvB,MAAM,CAAC,IAAI,CAAC,yBAAyB,IAAI,EAAE,CAAC,CAAC;KAC9C;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,sBAAsB,CAAC,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;AACH,CAAC;AA/CD,8BA+CC","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { NestFactory } from '@nestjs/core';\nimport { findAvailablePort, notifyUpdates } from '@subql/common';\nimport { getLogger, NestLogger } from '@subql/node-core';\nimport { AppModule } from './app.module';\nimport { FetchService } from './indexer/fetch.service';\nimport { ProjectService } from './indexer/project.service';\nimport { yargsOptions } from './yargs';\nconst pjson = require('../package.json');\n\nconst { argv } = yargsOptions;\n\nconst DEFAULT_PORT = 3000;\nconst logger = getLogger('subql-node');\n\nnotifyUpdates(pjson, logger);\n\nexport async function bootstrap(): Promise<void> {\n logger.info(`Current ${pjson.name} version is ${pjson.version}`);\n const debug = argv.debug;\n\n const validate = (x: any) => {\n const p = parseInt(x);\n return isNaN(p) ? null : p;\n };\n\n const port = validate(argv.port) ?? (await findAvailablePort(DEFAULT_PORT));\n if (!port) {\n logger.error(\n `Unable to find available port (tried ports in range (${port}..${\n port + 10\n })). Try setting a free port manually by setting the --port flag`,\n );\n process.exit(1);\n }\n\n if (argv.unsafe) {\n logger.warn(\n 'UNSAFE MODE IS ENABLED. This is not recommended for most projects and will not be supported by our hosted service',\n );\n }\n\n try {\n const app = await NestFactory.create(AppModule, {\n logger: new NestLogger(!!debug),\n });\n await app.init();\n\n const projectService: ProjectService = app.get('IProjectService');\n const fetchService = app.get(FetchService);\n\n // Initialise async services, we do this here rather than in factories, so we can capture one off eventss\n await projectService.init();\n await fetchService.init(projectService.startHeight);\n\n app.enableShutdownHooks();\n\n await app.listen(port);\n\n logger.info(`Node started on port: ${port}`);\n } catch (e) {\n logger.error(e, 'Node failed to start');\n process.exit(1);\n }\n}\n"]}
|
|
@@ -26,7 +26,7 @@ let TestingService = class TestingService extends node_core_1.TestingService {
|
|
|
26
26
|
}
|
|
27
27
|
async getTestRunner() {
|
|
28
28
|
const testContext = await core_1.NestFactory.createApplicationContext(testing_module_1.TestingModule, {
|
|
29
|
-
logger: new node_core_1.NestLogger(this.nodeConfig.debug),
|
|
29
|
+
logger: new node_core_1.NestLogger(!!this.nodeConfig.debug),
|
|
30
30
|
});
|
|
31
31
|
await testContext.init();
|
|
32
32
|
const projectService = testContext.get('IProjectService');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.service.js","sourceRoot":"","sources":["../../src/subcommands/testing.service.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;;;;;;;AAEnC,2CAAoD;AACpD,uCAA2C;AAE3C,gDAK0B;AAC1B,kEAGsC;AAMtC,qDAAiD;AAG1C,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,0BAKnC;IACC,YACE,UAAsB,EACM,OAAwB;QAEpD,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,aAAa;QAWjB,MAAM,WAAW,GAAG,MA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f,sBAAU;QACe,iCAAe;GAR3C,cAAc,CA+C1B;AA/CY,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 { NestFactory } from '@nestjs/core';\n\nimport {\n NodeConfig,\n TestingService as BaseTestingService,\n NestLogger,\n TestRunner,\n} from '@subql/node-core';\nimport {\n EthereumProjectDs,\n SubqueryProject,\n} from '../configure/SubqueryProject';\nimport { EthereumApi } from '../ethereum';\nimport SafeEthProvider from '../ethereum/safe-api';\nimport { IndexerManager } from '../indexer/indexer.manager';\nimport { ProjectService } from '../indexer/project.service';\nimport { BlockContent } from '../indexer/types';\nimport { TestingModule } from './testing.module';\n\n@Injectable()\nexport class TestingService extends BaseTestingService<\n EthereumApi,\n SafeEthProvider,\n BlockContent,\n EthereumProjectDs\n> {\n constructor(\n nodeConfig: NodeConfig,\n @Inject('ISubqueryProject') project: SubqueryProject,\n ) {\n super(nodeConfig, project);\n }\n\n async getTestRunner(): Promise<\n [\n close: () => Promise<void>,\n runner: TestRunner<\n EthereumApi,\n SafeEthProvider,\n BlockContent,\n EthereumProjectDs\n >,\n ]\n > {\n const testContext = await NestFactory.createApplicationContext(\n TestingModule,\n {\n logger: new NestLogger(!!this.nodeConfig.debug),\n },\n );\n\n await testContext.init();\n\n const projectService: ProjectService = testContext.get('IProjectService');\n\n await projectService.init();\n\n return [testContext.close.bind(testContext), testContext.get(TestRunner)];\n }\n\n async indexBlock(\n block: BlockContent,\n handler: string,\n indexerManager: IndexerManager,\n ): Promise<void> {\n await indexerManager.indexBlock(block, this.getDsWithHandler(handler));\n }\n}\n"]}
|
package/dist/yargs.d.ts
CHANGED
package/dist/yargs.js
CHANGED
|
@@ -76,9 +76,8 @@ exports.yargsOptions = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)
|
|
|
76
76
|
},
|
|
77
77
|
debug: {
|
|
78
78
|
demandOption: false,
|
|
79
|
-
describe:
|
|
80
|
-
type: '
|
|
81
|
-
default: false,
|
|
79
|
+
describe: `Enable debug logging for specific scopes, this will override log-level. "*" will enable debug everywhere, or comma separated strings for specific scopes. e.g. "SQL,dictionary"`,
|
|
80
|
+
type: 'string',
|
|
82
81
|
},
|
|
83
82
|
'dictionary-resolver': {
|
|
84
83
|
demandOption: false,
|
package/dist/yargs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yargs.js","sourceRoot":"","sources":["../src/yargs.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;AAEnC,oDAAqD;AAErD,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;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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AE,KAAK;QACnB,QAAQ,EAAE,wDAAwD;QAClE,sHAAsH;KACvH;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-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { initLogger } from '@subql/node-core/logger';\nimport { boolean } from 'yargs';\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: '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 describe: 'Disable storing historical state entities',\n type: 'boolean',\n // NOTE: don't set a default for this. It will break apply args from manifest. The default should be set in NodeConfig\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 '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 'primary-network-endpoint': {\n demandOption: false,\n type: 'string',\n describe:\n 'Primary blockchain endpoint, used as the first choice for connections.',\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-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 skipTransactions: {\n demandOption: false,\n describe: `If the project contains only event handlers and doesn't require transaction information then this can be used to skip fetching transactions reducing bandwith and memory. This will be automatically disabled if handlers other than EventHandlers are detected.`,\n type: 'boolean',\n // NOTE: don't set a default for this. It will break apply args from manifest. The default should be set in NodeConfig\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 describe: 'Enable to fetch and index unfinalized blocks',\n type: 'boolean',\n // NOTE: don't set a default for this. It will break apply args from manifest. The default should be set in NodeConfig\n },\n unsafe: {\n type: 'boolean',\n demandOption: false,\n describe: 'Allows usage of any built-in module within the sandbox',\n // NOTE: don't set a default for this. It will break apply args from manifest. The default should be set in NodeConfig\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":"","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AAO,EAAE,GAAG;KACb;CACF,CAAC;KACD,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,8CAA8C","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { initLogger } from '@subql/node-core/logger';\nimport { boolean } from 'yargs';\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 string,\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 string,\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: `Enable debug logging for specific scopes, this will override log-level. \"*\" will enable debug everywhere, or comma separated strings for specific scopes. e.g. \"SQL,dictionary\"`,\n type: 'string',\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 describe: 'Disable storing historical state entities',\n type: 'boolean',\n // NOTE: don't set a default for this. It will break apply args from manifest. The default should be set in NodeConfig\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 '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 'primary-network-endpoint': {\n demandOption: false,\n type: 'string',\n describe:\n 'Primary blockchain endpoint, used as the first choice for connections.',\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-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 skipTransactions: {\n demandOption: false,\n describe: `If the project contains only event handlers and doesn't require transaction information then this can be used to skip fetching transactions reducing bandwith and memory. This will be automatically disabled if handlers other than EventHandlers are detected.`,\n type: 'boolean',\n // NOTE: don't set a default for this. It will break apply args from manifest. The default should be set in NodeConfig\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 describe: 'Enable to fetch and index unfinalized blocks',\n type: 'boolean',\n // NOTE: don't set a default for this. It will break apply args from manifest. The default should be set in NodeConfig\n },\n unsafe: {\n type: 'boolean',\n demandOption: false,\n describe: 'Allows usage of any built-in module within the sandbox',\n // NOTE: don't set a default for this. It will break apply args from manifest. The default should be set in NodeConfig\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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@subql/node-ethereum",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4-1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Ian He",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -24,11 +24,10 @@
|
|
|
24
24
|
"@nestjs/event-emitter": "^2.0.0",
|
|
25
25
|
"@nestjs/platform-express": "^9.4.0",
|
|
26
26
|
"@nestjs/schedule": "^3.0.1",
|
|
27
|
-
"@subql/common": "3.1.
|
|
28
|
-
"@subql/common-ethereum": "3.0.
|
|
29
|
-
"@subql/node-core": "
|
|
27
|
+
"@subql/common": "3.1.2",
|
|
28
|
+
"@subql/common-ethereum": "3.0.3-0",
|
|
29
|
+
"@subql/node-core": "^6.0.1",
|
|
30
30
|
"@subql/testing": "^2.0.2",
|
|
31
|
-
"@subql/types": "^3.1.1",
|
|
32
31
|
"@subql/types-ethereum": "3.0.2",
|
|
33
32
|
"cacheable-lookup": "6",
|
|
34
33
|
"cron-converter": "^1.0.2",
|
|
@@ -65,5 +64,6 @@
|
|
|
65
64
|
"files": [
|
|
66
65
|
"/dist",
|
|
67
66
|
"/bin"
|
|
68
|
-
]
|
|
67
|
+
],
|
|
68
|
+
"stableVersion": "3.0.4-0"
|
|
69
69
|
}
|