@subql/node-stellar 4.0.4 → 4.1.0
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 +7 -1
- 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 -5
- package/dist/indexer/blockDispatcher/block-dispatcher.service.js.map +1 -1
- package/dist/indexer/blockDispatcher/worker-block-dispatcher.service.d.ts +3 -3
- package/dist/indexer/blockDispatcher/worker-block-dispatcher.service.js +5 -6
- package/dist/indexer/blockDispatcher/worker-block-dispatcher.service.js.map +1 -1
- package/dist/indexer/fetch.module.js +4 -4
- package/dist/indexer/fetch.module.js.map +1 -1
- package/dist/indexer/fetch.service.d.ts +2 -2
- package/dist/indexer/fetch.service.js +4 -4
- package/dist/indexer/fetch.service.js.map +1 -1
- package/dist/indexer/unfinalizedBlocks.service.d.ts +3 -3
- package/dist/indexer/unfinalizedBlocks.service.js +7 -4
- package/dist/indexer/unfinalizedBlocks.service.js.map +1 -1
- package/dist/indexer/worker/worker.service.d.ts +3 -7
- package/dist/indexer/worker/worker.service.js +2 -3
- package/dist/indexer/worker/worker.service.js.map +1 -1
- package/dist/subcommands/reindex.module.js +6 -1
- package/dist/subcommands/reindex.module.js.map +1 -1
- package/dist/subcommands/testing.module.js +6 -0
- package/dist/subcommands/testing.module.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnApplicationShutdown } from '@nestjs/common';
|
|
2
2
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
|
3
|
-
import { NodeConfig,
|
|
3
|
+
import { NodeConfig, IStoreModelProvider, StoreService, IProjectService, BlockDispatcher, ProcessBlockResponse, ApiService, IProjectUpgradeService, PoiSyncService, IBlock } from '@subql/node-core';
|
|
4
4
|
import { StellarBlockWrapper, SubqlDatasource } from '@subql/types-stellar';
|
|
5
5
|
import { SubqueryProject } from '../../configure/SubqueryProject';
|
|
6
6
|
import { IndexerManager } from '../indexer.manager';
|
|
@@ -9,6 +9,6 @@ import { IndexerManager } from '../indexer.manager';
|
|
|
9
9
|
*/
|
|
10
10
|
export declare class BlockDispatcherService extends BlockDispatcher<StellarBlockWrapper, SubqlDatasource> implements OnApplicationShutdown {
|
|
11
11
|
private indexerManager;
|
|
12
|
-
constructor(apiService: ApiService, nodeConfig: NodeConfig, indexerManager: IndexerManager, eventEmitter: EventEmitter2, projectService: IProjectService<SubqlDatasource>, projectUpgradeService: IProjectUpgradeService, storeService: StoreService,
|
|
12
|
+
constructor(apiService: ApiService, nodeConfig: NodeConfig, indexerManager: IndexerManager, eventEmitter: EventEmitter2, projectService: IProjectService<SubqlDatasource>, projectUpgradeService: IProjectUpgradeService, storeService: StoreService, storeModelProvider: IStoreModelProvider, poiSyncService: PoiSyncService, project: SubqueryProject);
|
|
13
13
|
protected indexBlock(block: IBlock<StellarBlockWrapper>): Promise<ProcessBlockResponse>;
|
|
14
14
|
}
|
|
@@ -24,8 +24,8 @@ const indexer_manager_1 = require("../indexer.manager");
|
|
|
24
24
|
*/
|
|
25
25
|
let BlockDispatcherService = class BlockDispatcherService extends node_core_1.BlockDispatcher {
|
|
26
26
|
indexerManager;
|
|
27
|
-
constructor(apiService, nodeConfig, indexerManager, eventEmitter, projectService, projectUpgradeService, storeService,
|
|
28
|
-
super(nodeConfig, eventEmitter, projectService, projectUpgradeService, storeService,
|
|
27
|
+
constructor(apiService, nodeConfig, indexerManager, eventEmitter, projectService, projectUpgradeService, storeService, storeModelProvider, poiSyncService, project) {
|
|
28
|
+
super(nodeConfig, eventEmitter, projectService, projectUpgradeService, storeService, storeModelProvider, poiSyncService, project, apiService.fetchBlocks.bind(apiService));
|
|
29
29
|
this.indexerManager = indexerManager;
|
|
30
30
|
}
|
|
31
31
|
async indexBlock(block) {
|
|
@@ -36,13 +36,12 @@ BlockDispatcherService = __decorate([
|
|
|
36
36
|
(0, common_1.Injectable)(),
|
|
37
37
|
__param(4, (0, common_1.Inject)('IProjectService')),
|
|
38
38
|
__param(5, (0, common_1.Inject)('IProjectUpgradeService')),
|
|
39
|
+
__param(7, (0, common_1.Inject)('IStoreModelProvider')),
|
|
39
40
|
__param(9, (0, common_1.Inject)('ISubqueryProject')),
|
|
40
41
|
__metadata("design:paramtypes", [node_core_1.ApiService,
|
|
41
42
|
node_core_1.NodeConfig,
|
|
42
43
|
indexer_manager_1.IndexerManager,
|
|
43
|
-
event_emitter_1.EventEmitter2, Object, Object, node_core_1.StoreService,
|
|
44
|
-
node_core_1.StoreCacheService,
|
|
45
|
-
node_core_1.PoiSyncService, Object])
|
|
44
|
+
event_emitter_1.EventEmitter2, Object, Object, node_core_1.StoreService, Object, node_core_1.PoiSyncService, Object])
|
|
46
45
|
], BlockDispatcherService);
|
|
47
46
|
exports.BlockDispatcherService = BlockDispatcherService;
|
|
48
47
|
//# sourceMappingURL=block-dispatcher.service.js.map
|
|
@@ -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,gDAW0B;AAG1B,wDAAoD;AAEpD;;GAEG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBACX,SAAQ,2BAAqD;IAMnD;IAHV,YACE,UAAsB,EACtB,UAAsB,EACd,cAA8B,EACtC,YAA2B,EAE3B,cAAgD,EAEhD,qBAA6C,EAC7C,YAA0B,
|
|
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,gDAW0B;AAG1B,wDAAoD;AAEpD;;GAEG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBACX,SAAQ,2BAAqD;IAMnD;IAHV,YACE,UAAsB,EACtB,UAAsB,EACd,cAA8B,EACtC,YAA2B,EAE3B,cAAgD,EAEhD,qBAA6C,EAC7C,YAA0B,EACK,kBAAuC,EACtE,cAA8B,EACF,OAAwB;QAEpD,KAAK,CACH,UAAU,EACV,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,OAAO,EACP,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CACxC,CAAC;QArBM,mBAAc,GAAd,cAAc,CAAgB;IAsBxC,CAAC;IAES,KAAK,CAAC,UAAU,CACxB,KAAkC;QAElC,OAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CACnC,KAAK,EACL,MAAM,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,WAAW,CAAC,CACxE,CAAC;IACJ,CAAC;CACF,CAAA;AAvCY,sBAAsB;IADlC,IAAA,mBAAU,GAAE;IAUR,WAAA,IAAA,eAAM,EAAC,iBAAiB,CAAC,CAAA;IAEzB,WAAA,IAAA,eAAM,EAAC,wBAAwB,CAAC,CAAA;IAGhC,WAAA,IAAA,eAAM,EAAC,qBAAqB,CAAC,CAAA;IAE7B,WAAA,IAAA,eAAM,EAAC,kBAAkB,CAAC,CAAA;qCAXf,sBAAU;QACV,sBAAU;QACE,gCAAc;QACxB,6BAAa,kBAKb,wBAAY,UAEV,0BAAc;GAfrB,sBAAsB,CAuClC;AAvCY,wDAAsB","sourcesContent":["// Copyright 2020-2024 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 IStoreModelProvider,\n StoreService,\n IProjectService,\n BlockDispatcher,\n ProcessBlockResponse,\n ApiService,\n IProjectUpgradeService,\n PoiSyncService,\n IBlock,\n} from '@subql/node-core';\nimport { StellarBlockWrapper, SubqlDatasource } from '@subql/types-stellar';\nimport { SubqueryProject } from '../../configure/SubqueryProject';\nimport { IndexerManager } from '../indexer.manager';\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<StellarBlockWrapper, SubqlDatasource>\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<SubqlDatasource>,\n @Inject('IProjectUpgradeService')\n projectUpgradeService: IProjectUpgradeService,\n storeService: StoreService,\n @Inject('IStoreModelProvider') storeModelProvider: IStoreModelProvider,\n poiSyncService: PoiSyncService,\n @Inject('ISubqueryProject') project: SubqueryProject,\n ) {\n super(\n nodeConfig,\n eventEmitter,\n projectService,\n projectUpgradeService,\n storeService,\n storeModelProvider,\n poiSyncService,\n project,\n apiService.fetchBlocks.bind(apiService),\n );\n }\n\n protected async indexBlock(\n block: IBlock<StellarBlockWrapper>,\n ): Promise<ProcessBlockResponse> {\n return this.indexerManager.indexBlock(\n block,\n await this.projectService.getDataSources(block.getHeader().blockHeight),\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, StoreService, PoiSyncService,
|
|
3
|
+
import { NodeConfig, StoreService, PoiSyncService, IStoreModelProvider, IProjectService, WorkerBlockDispatcher, IProjectUpgradeService, ConnectionPoolStateManager, InMemoryCacheService, MonitorServiceInterface, Header } from '@subql/node-core';
|
|
4
4
|
import { StellarBlockWrapper, SubqlDatasource } from '@subql/types-stellar';
|
|
5
5
|
import { SubqueryProject } from '../../configure/SubqueryProject';
|
|
6
6
|
import { StellarApiConnection } from '../../stellar/api.connection';
|
|
@@ -11,7 +11,7 @@ type IndexerWorker = IIndexerWorker & {
|
|
|
11
11
|
terminate: () => Promise<number>;
|
|
12
12
|
};
|
|
13
13
|
export declare class WorkerBlockDispatcherService extends WorkerBlockDispatcher<SubqlDatasource, IndexerWorker, StellarBlockWrapper> implements OnApplicationShutdown {
|
|
14
|
-
constructor(nodeConfig: NodeConfig, eventEmitter: EventEmitter2, projectService: IProjectService<SubqlDatasource>, projectUpgradeService: IProjectUpgradeService, cacheService: InMemoryCacheService, storeService: StoreService,
|
|
15
|
-
|
|
14
|
+
constructor(nodeConfig: NodeConfig, eventEmitter: EventEmitter2, projectService: IProjectService<SubqlDatasource>, projectUpgradeService: IProjectUpgradeService, cacheService: InMemoryCacheService, storeService: StoreService, storeModelProvider: IStoreModelProvider, poiSyncService: PoiSyncService, project: SubqueryProject, dynamicDsService: DynamicDsService, unfinalizedBlocksSevice: UnfinalizedBlocksService, connectionPoolState: ConnectionPoolStateManager<StellarApiConnection>, monitorService?: MonitorServiceInterface);
|
|
15
|
+
fetchBlock(worker: IndexerWorker, height: number): Promise<Header>;
|
|
16
16
|
}
|
|
17
17
|
export {};
|
|
@@ -26,23 +26,22 @@ const dynamic_ds_service_1 = require("../dynamic-ds.service");
|
|
|
26
26
|
const unfinalizedBlocks_service_1 = require("../unfinalizedBlocks.service");
|
|
27
27
|
const logger = (0, node_core_1.getLogger)('WorkerBlockDispatcherService');
|
|
28
28
|
let WorkerBlockDispatcherService = class WorkerBlockDispatcherService extends node_core_1.WorkerBlockDispatcher {
|
|
29
|
-
constructor(nodeConfig, eventEmitter, projectService, projectUpgradeService, cacheService, storeService,
|
|
30
|
-
super(nodeConfig, eventEmitter, projectService, projectUpgradeService, storeService,
|
|
29
|
+
constructor(nodeConfig, eventEmitter, projectService, projectUpgradeService, cacheService, storeService, storeModelProvider, poiSyncService, project, dynamicDsService, unfinalizedBlocksSevice, connectionPoolState, monitorService) {
|
|
30
|
+
super(nodeConfig, eventEmitter, projectService, projectUpgradeService, storeService, storeModelProvider, poiSyncService, project, () => (0, node_core_1.createIndexerWorker)(path_1.default.resolve(__dirname, '../../../dist/indexer/worker/worker.js'), [], storeService.getStore(), cacheService.getCache(), dynamicDsService, unfinalizedBlocksSevice, connectionPoolState, project.root, projectService.startHeight, monitorService), monitorService);
|
|
31
31
|
}
|
|
32
32
|
async fetchBlock(worker, height) {
|
|
33
|
-
|
|
33
|
+
return worker.fetchBlock(height, 0 /* Unused with stellar*/);
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
WorkerBlockDispatcherService = __decorate([
|
|
37
37
|
(0, common_1.Injectable)(),
|
|
38
38
|
__param(2, (0, common_1.Inject)('IProjectService')),
|
|
39
39
|
__param(3, (0, common_1.Inject)('IProjectUpgradeService')),
|
|
40
|
+
__param(6, (0, common_1.Inject)('IStoreModelProvider')),
|
|
40
41
|
__param(8, (0, common_1.Inject)('ISubqueryProject')),
|
|
41
42
|
__metadata("design:paramtypes", [node_core_1.NodeConfig,
|
|
42
43
|
event_emitter_1.EventEmitter2, Object, Object, node_core_1.InMemoryCacheService,
|
|
43
|
-
node_core_1.StoreService,
|
|
44
|
-
node_core_1.StoreCacheService,
|
|
45
|
-
node_core_1.PoiSyncService, Object, dynamic_ds_service_1.DynamicDsService,
|
|
44
|
+
node_core_1.StoreService, Object, node_core_1.PoiSyncService, Object, dynamic_ds_service_1.DynamicDsService,
|
|
46
45
|
unfinalizedBlocks_service_1.UnfinalizedBlocksService,
|
|
47
46
|
node_core_1.ConnectionPoolStateManager, Object])
|
|
48
47
|
], WorkerBlockDispatcherService);
|
|
@@ -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,gDAc0B;AAK1B,8DAAyD;AACzD,4EAAwE;AAGxE,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,8BAA8B,CAAC,CAAC;AAOlD,IAAM,4BAA4B,GAAlC,MAAM,4BACX,SAAQ,iCAIP;IAGD,YACE,UAAsB,EACtB,YAA2B,EAE3B,cAAgD,EAEhD,qBAA6C,EAC7C,YAAkC,EAClC,YAA0B,EACK,kBAAuC,EACtE,cAA8B,EACF,OAAwB,EACpD,gBAAkC,EAClC,uBAAiD,EACjD,mBAAqE,EACrE,cAAwC;QAExC,KAAK,CACH,UAAU,EACV,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,OAAO,EACP,GAAG,EAAE,CACH,IAAA,+BAAmB,EAMjB,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,wCAAwC,CAAC,EACjE,EAAE,EACF,YAAY,CAAC,QAAQ,EAAE,EACvB,YAAY,CAAC,QAAQ,EAAE,EACvB,gBAAgB,EAChB,uBAAuB,EACvB,mBAAmB,EACnB,OAAO,CAAC,IAAI,EACZ,cAAc,CAAC,WAAW,EAC1B,cAAc,CACf,EACH,cAAc,CACf,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,MAAqB,EAAE,MAAc;QACpD,OAAO,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,wBAAwB,CAAC,CAAC;IAC/D,CAAC;CACF,CAAA;AA3DY,4BAA4B;IADxC,IAAA,mBAAU,GAAE;IAYR,WAAA,IAAA,eAAM,EAAC,iBAAiB,CAAC,CAAA;IAEzB,WAAA,IAAA,eAAM,EAAC,wBAAwB,CAAC,CAAA;IAIhC,WAAA,IAAA,eAAM,EAAC,qBAAqB,CAAC,CAAA;IAE7B,WAAA,IAAA,eAAM,EAAC,kBAAkB,CAAC,CAAA;qCAVf,sBAAU;QACR,6BAAa,kBAKb,gCAAoB;QACpB,wBAAY,UAEV,0BAAc,UAEZ,qCAAgB;QACT,oDAAwB;QAC5B,sCAA0B;GAtBtC,4BAA4B,CA2DxC;AA3DY,oEAA4B","sourcesContent":["// Copyright 2020-2024 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 getLogger,\n NodeConfig,\n StoreService,\n PoiSyncService,\n IStoreModelProvider,\n IProjectService,\n WorkerBlockDispatcher,\n IProjectUpgradeService,\n ConnectionPoolStateManager,\n createIndexerWorker,\n InMemoryCacheService,\n MonitorServiceInterface,\n Header,\n} from '@subql/node-core';\nimport { StellarBlockWrapper, SubqlDatasource } from '@subql/types-stellar';\nimport { SubqueryProject } from '../../configure/SubqueryProject';\nimport { StellarApiConnection } from '../../stellar/api.connection';\nimport { StellarBlockWrapped } from '../../stellar/block.stellar';\nimport { DynamicDsService } from '../dynamic-ds.service';\nimport { UnfinalizedBlocksService } from '../unfinalizedBlocks.service';\nimport { IIndexerWorker } from '../worker/worker';\n\nconst logger = getLogger('WorkerBlockDispatcherService');\n\ntype IndexerWorker = IIndexerWorker & {\n terminate: () => Promise<number>;\n};\n\n@Injectable()\nexport class WorkerBlockDispatcherService\n extends WorkerBlockDispatcher<\n SubqlDatasource,\n IndexerWorker,\n StellarBlockWrapper\n >\n implements OnApplicationShutdown\n{\n constructor(\n nodeConfig: NodeConfig,\n eventEmitter: EventEmitter2,\n @Inject('IProjectService')\n projectService: IProjectService<SubqlDatasource>,\n @Inject('IProjectUpgradeService')\n projectUpgradeService: IProjectUpgradeService,\n cacheService: InMemoryCacheService,\n storeService: StoreService,\n @Inject('IStoreModelProvider') storeModelProvider: IStoreModelProvider,\n poiSyncService: PoiSyncService,\n @Inject('ISubqueryProject') project: SubqueryProject,\n dynamicDsService: DynamicDsService,\n unfinalizedBlocksSevice: UnfinalizedBlocksService,\n connectionPoolState: ConnectionPoolStateManager<StellarApiConnection>,\n monitorService?: MonitorServiceInterface,\n ) {\n super(\n nodeConfig,\n eventEmitter,\n projectService,\n projectUpgradeService,\n storeService,\n storeModelProvider,\n poiSyncService,\n project,\n () =>\n createIndexerWorker<\n IIndexerWorker,\n StellarApiConnection,\n StellarBlockWrapped,\n SubqlDatasource\n >(\n path.resolve(__dirname, '../../../dist/indexer/worker/worker.js'),\n [],\n storeService.getStore(),\n cacheService.getCache(),\n dynamicDsService,\n unfinalizedBlocksSevice,\n connectionPoolState,\n project.root,\n projectService.startHeight,\n monitorService,\n ),\n monitorService,\n );\n }\n\n async fetchBlock(worker: IndexerWorker, height: number): Promise<Header> {\n return worker.fetchBlock(height, 0 /* Unused with stellar*/);\n }\n}\n"]}
|
|
@@ -45,9 +45,9 @@ FetchModule = __decorate([
|
|
|
45
45
|
indexer_manager_1.IndexerManager,
|
|
46
46
|
{
|
|
47
47
|
provide: 'IBlockDispatcher',
|
|
48
|
-
useFactory: (nodeConfig, eventEmitter, projectService, projectUpgradeService, apiService, indexerManager, cacheService, storeService,
|
|
49
|
-
? new blockDispatcher_1.WorkerBlockDispatcherService(nodeConfig, eventEmitter, projectService, projectUpgradeService, cacheService, storeService,
|
|
50
|
-
: new blockDispatcher_1.BlockDispatcherService(apiService, nodeConfig, indexerManager, eventEmitter, projectService, projectUpgradeService, storeService,
|
|
48
|
+
useFactory: (nodeConfig, eventEmitter, projectService, projectUpgradeService, apiService, indexerManager, cacheService, storeService, storeModelProvider, poiSyncService, project, dynamicDsService, unfinalizedBlocks, connectionPoolState, monitorService) => nodeConfig.workers
|
|
49
|
+
? new blockDispatcher_1.WorkerBlockDispatcherService(nodeConfig, eventEmitter, projectService, projectUpgradeService, cacheService, storeService, storeModelProvider, poiSyncService, project, dynamicDsService, unfinalizedBlocks, connectionPoolState, monitorService)
|
|
50
|
+
: new blockDispatcher_1.BlockDispatcherService(apiService, nodeConfig, indexerManager, eventEmitter, projectService, projectUpgradeService, storeService, storeModelProvider, poiSyncService, project),
|
|
51
51
|
inject: [
|
|
52
52
|
node_core_1.NodeConfig,
|
|
53
53
|
event_emitter_1.EventEmitter2,
|
|
@@ -57,7 +57,7 @@ FetchModule = __decorate([
|
|
|
57
57
|
indexer_manager_1.IndexerManager,
|
|
58
58
|
node_core_1.InMemoryCacheService,
|
|
59
59
|
node_core_1.StoreService,
|
|
60
|
-
|
|
60
|
+
'IStoreModelProvider',
|
|
61
61
|
node_core_1.PoiSyncService,
|
|
62
62
|
'ISubqueryProject',
|
|
63
63
|
dynamic_ds_service_1.DynamicDsService,
|
|
@@ -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,wEAAmE;AACnE,uDAG2B;AAC3B,6CAAwD;AACxD,iEAA4D;AAC5D,6DAAwD;AACxD,mDAA+C;AAC/C,uDAAmD;AACnD,uDAAmD;AACnD,2EAAuE;AA4GhE,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,WAAW;IA1GvB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,sBAAU,CAAC;QACrB,SAAS,EAAE;YACT;gBACE,OAAO,EAAE,sBAAU;gBACnB,UAAU,EAAE,KAAK,EACf,OAAwB,EACxB,qBAA4C,EAC5C,qBAAkE,EAClE,YAA2B,EAC3B,UAAsB,EACtB,EAAE;oBACF,MAAM,UAAU,GAAG,IAAI,uCAAiB,CACtC,OAAO,EACP,qBAAqB,EACrB,YAAY,EACZ,UAAU,CACX,CAAC;oBACF,MAAM,UAAU,CAAC,IAAI,EAAE,CAAC;oBACxB,OAAO,UAAU,CAAC;gBACpB,CAAC;gBACD,MAAM,EAAE;oBACN,kBAAkB;oBAClB,wBAAwB;oBACxB,iCAAqB;oBACrB,6BAAa;oBACb,sBAAU;iBACX;aACF;YACD,gCAAc;YACd;gBACE,OAAO,EAAE,kBAAkB;gBAC3B,UAAU,EAAE,CACV,UAAsB,EACtB,YAA2B,EAC3B,cAA8B,EAC9B,qBAA6C,EAC7C,UAAsB,EACtB,cAA8B,EAC9B,YAAkC,EAClC,YAA0B,EAC1B,kBAAuC,EACvC,cAA8B,EAC9B,OAAwB,EACxB,gBAAkC,EAClC,iBAA2C,EAC3C,mBAAqE,EACrE,cAA+B,EAC/B,EAAE,CACF,UAAU,CAAC,OAAO;oBAChB,CAAC,CAAC,IAAI,8CAA4B,CAC9B,UAAU,EACV,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,OAAO,EACP,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,CACf;oBACH,CAAC,CAAC,IAAI,wCAAsB,CACxB,UAAU,EACV,UAAU,EACV,cAAc,EACd,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,OAAO,CACR;gBACP,MAAM,EAAE;oBACN,sBAAU;oBACV,6BAAa;oBACb,iBAAiB;oBACjB,wBAAwB;oBACxB,sBAAU;oBACV,gCAAc;oBACd,gCAAoB;oBACpB,wBAAY;oBACZ,qBAAqB;oBACrB,0BAAc;oBACd,kBAAkB;oBAClB,qCAAgB;oBAChB,oDAAwB;oBACxB,sCAA0B;oBAC1B,0BAAc;iBACf;aACF;YACD,4BAAY;YACZ,qCAAwB;YACxB,yCAAkB;YAClB,qCAAgB;YAChB;gBACE,QAAQ,EAAE,gCAAc;gBACxB,OAAO,EAAE,iBAAiB;aAC3B;YACD,oDAAwB;SACzB;KACF,CAAC;GACW,WAAW,CAAG;AAAd,kCAAW","sourcesContent":["// Copyright 2020-2024 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 StoreService,\n PoiSyncService,\n ApiService,\n ConnectionPoolService,\n IStoreModelProvider,\n ConnectionPoolStateManager,\n NodeConfig,\n IProjectUpgradeService,\n ProjectUpgradeService,\n InMemoryCacheService,\n MonitorService,\n CoreModule,\n} from '@subql/node-core';\nimport { SubqueryProject } from '../configure/SubqueryProject';\nimport { StellarApiConnection } from '../stellar/api.connection';\nimport { StellarApiService } from '../stellar/api.service.stellar';\nimport {\n BlockDispatcherService,\n WorkerBlockDispatcherService,\n} from './blockDispatcher';\nimport { StellarDictionaryService } from './dictionary';\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 { UnfinalizedBlocksService } from './unfinalizedBlocks.service';\n\n@Module({\n imports: [CoreModule],\n providers: [\n {\n provide: ApiService,\n useFactory: async (\n project: SubqueryProject,\n projectUpgradeService: ProjectUpgradeService,\n connectionPoolService: ConnectionPoolService<StellarApiConnection>,\n eventEmitter: EventEmitter2,\n nodeConfig: NodeConfig,\n ) => {\n const apiService = new StellarApiService(\n project,\n connectionPoolService,\n eventEmitter,\n nodeConfig,\n );\n await apiService.init();\n return apiService;\n },\n inject: [\n 'ISubqueryProject',\n 'IProjectUpgradeService',\n ConnectionPoolService,\n EventEmitter2,\n NodeConfig,\n ],\n },\n IndexerManager,\n {\n provide: 'IBlockDispatcher',\n useFactory: (\n nodeConfig: NodeConfig,\n eventEmitter: EventEmitter2,\n projectService: ProjectService,\n projectUpgradeService: IProjectUpgradeService,\n apiService: ApiService,\n indexerManager: IndexerManager,\n cacheService: InMemoryCacheService,\n storeService: StoreService,\n storeModelProvider: IStoreModelProvider,\n poiSyncService: PoiSyncService,\n project: SubqueryProject,\n dynamicDsService: DynamicDsService,\n unfinalizedBlocks: UnfinalizedBlocksService,\n connectionPoolState: ConnectionPoolStateManager<StellarApiConnection>,\n monitorService?: MonitorService,\n ) =>\n nodeConfig.workers\n ? new WorkerBlockDispatcherService(\n nodeConfig,\n eventEmitter,\n projectService,\n projectUpgradeService,\n cacheService,\n storeService,\n storeModelProvider,\n poiSyncService,\n project,\n dynamicDsService,\n unfinalizedBlocks,\n connectionPoolState,\n monitorService,\n )\n : new BlockDispatcherService(\n apiService,\n nodeConfig,\n indexerManager,\n eventEmitter,\n projectService,\n projectUpgradeService,\n storeService,\n storeModelProvider,\n poiSyncService,\n project,\n ),\n inject: [\n NodeConfig,\n EventEmitter2,\n 'IProjectService',\n 'IProjectUpgradeService',\n ApiService,\n IndexerManager,\n InMemoryCacheService,\n StoreService,\n 'IStoreModelProvider',\n PoiSyncService,\n 'ISubqueryProject',\n DynamicDsService,\n UnfinalizedBlocksService,\n ConnectionPoolStateManager,\n MonitorService,\n ],\n },\n FetchService,\n StellarDictionaryService,\n DsProcessorService,\n DynamicDsService,\n {\n useClass: ProjectService,\n provide: 'IProjectService',\n },\n UnfinalizedBlocksService,\n ],\n})\nexport class FetchModule {}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
|
2
2
|
import { SchedulerRegistry } from '@nestjs/schedule';
|
|
3
|
-
import { NodeConfig, BaseFetchService, ApiService, Header,
|
|
3
|
+
import { NodeConfig, BaseFetchService, ApiService, Header, IStoreModelProvider } from '@subql/node-core';
|
|
4
4
|
import { StellarBlock, SubqlDatasource } from '@subql/types-stellar';
|
|
5
5
|
import { StellarApi } from '../stellar';
|
|
6
6
|
import { IStellarBlockDispatcher } from './blockDispatcher';
|
|
@@ -9,7 +9,7 @@ import { ProjectService } from './project.service';
|
|
|
9
9
|
import { UnfinalizedBlocksService } from './unfinalizedBlocks.service';
|
|
10
10
|
export declare class FetchService extends BaseFetchService<SubqlDatasource, IStellarBlockDispatcher, StellarBlock> {
|
|
11
11
|
private apiService;
|
|
12
|
-
constructor(apiService: ApiService, nodeConfig: NodeConfig, projectService: ProjectService, blockDispatcher: IStellarBlockDispatcher, dictionaryService: StellarDictionaryService, unfinalizedBlocksService: UnfinalizedBlocksService, eventEmitter: EventEmitter2, schedulerRegistry: SchedulerRegistry,
|
|
12
|
+
constructor(apiService: ApiService, nodeConfig: NodeConfig, projectService: ProjectService, blockDispatcher: IStellarBlockDispatcher, dictionaryService: StellarDictionaryService, unfinalizedBlocksService: UnfinalizedBlocksService, eventEmitter: EventEmitter2, schedulerRegistry: SchedulerRegistry, storeModelProvider: IStoreModelProvider);
|
|
13
13
|
get api(): StellarApi;
|
|
14
14
|
protected getFinalizedHeader(): Promise<Header>;
|
|
15
15
|
protected getBestHeight(): Promise<number>;
|
|
@@ -28,8 +28,8 @@ const BLOCK_TIME_VARIANCE = 5000;
|
|
|
28
28
|
const INTERVAL_PERCENT = 0.9;
|
|
29
29
|
let FetchService = class FetchService extends node_core_1.BaseFetchService {
|
|
30
30
|
apiService;
|
|
31
|
-
constructor(apiService, nodeConfig, projectService, blockDispatcher, dictionaryService, unfinalizedBlocksService, eventEmitter, schedulerRegistry,
|
|
32
|
-
super(nodeConfig, projectService, blockDispatcher, dictionaryService, eventEmitter, schedulerRegistry, unfinalizedBlocksService,
|
|
31
|
+
constructor(apiService, nodeConfig, projectService, blockDispatcher, dictionaryService, unfinalizedBlocksService, eventEmitter, schedulerRegistry, storeModelProvider) {
|
|
32
|
+
super(nodeConfig, projectService, blockDispatcher, dictionaryService, eventEmitter, schedulerRegistry, unfinalizedBlocksService, storeModelProvider);
|
|
33
33
|
this.apiService = apiService;
|
|
34
34
|
}
|
|
35
35
|
get api() {
|
|
@@ -65,13 +65,13 @@ FetchService = __decorate([
|
|
|
65
65
|
(0, common_1.Injectable)(),
|
|
66
66
|
__param(2, (0, common_1.Inject)('IProjectService')),
|
|
67
67
|
__param(3, (0, common_1.Inject)('IBlockDispatcher')),
|
|
68
|
+
__param(8, (0, common_1.Inject)('IStoreModelProvider')),
|
|
68
69
|
__metadata("design:paramtypes", [node_core_1.ApiService,
|
|
69
70
|
node_core_1.NodeConfig,
|
|
70
71
|
project_service_1.ProjectService, Object, dictionary_1.StellarDictionaryService,
|
|
71
72
|
unfinalizedBlocks_service_1.UnfinalizedBlocksService,
|
|
72
73
|
event_emitter_1.EventEmitter2,
|
|
73
|
-
schedule_1.SchedulerRegistry,
|
|
74
|
-
node_core_1.StoreCacheService])
|
|
74
|
+
schedule_1.SchedulerRegistry, Object])
|
|
75
75
|
], FetchService);
|
|
76
76
|
exports.FetchService = FetchService;
|
|
77
77
|
//# sourceMappingURL=fetch.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.service.js","sourceRoot":"","sources":["../../src/indexer/fetch.service.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;;;;;;;AAEnC,2CAAoD;AACpD,yDAAsD;AACtD,+CAAqD;AAErD,0DAAuE;AACvE,gDAO0B;AAG1B,4DAA8E;AAE9E,6CAAwD;AACxD,uDAAmD;AACnD,2EAAuE;AAEvE,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAEjC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAGtB,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,4BAIjC;IAEW;IADV,YACU,UAAsB,EAC9B,UAAsB,EACK,cAA8B,EAEzD,eAAwC,EACxC,iBAA2C,EAC3C,wBAAkD,EAClD,YAA2B,EAC3B,iBAAoC,
|
|
1
|
+
{"version":3,"file":"fetch.service.js","sourceRoot":"","sources":["../../src/indexer/fetch.service.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;;;;;;;AAEnC,2CAAoD;AACpD,yDAAsD;AACtD,+CAAqD;AAErD,0DAAuE;AACvE,gDAO0B;AAG1B,4DAA8E;AAE9E,6CAAwD;AACxD,uDAAmD;AACnD,2EAAuE;AAEvE,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAEjC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAGtB,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,4BAIjC;IAEW;IADV,YACU,UAAsB,EAC9B,UAAsB,EACK,cAA8B,EAEzD,eAAwC,EACxC,iBAA2C,EAC3C,wBAAkD,EAClD,YAA2B,EAC3B,iBAAoC,EACL,kBAAuC;QAEtE,KAAK,CACH,UAAU,EACV,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,CACnB,CAAC;QApBM,eAAU,GAAV,UAAU,CAAY;IAqBhC,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;IACnC,CAAC;IAES,KAAK,CAAC,kBAAkB;QAChC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;QACjD,OAAO,IAAA,oCAAoB,EAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAES,KAAK,CAAC,aAAa;QAC3B,OAAO,IAAI,CAAC,GAAG,CAAC,kBAAkB,EAAE,CAAC;IACvC,CAAC;IAED,4DAA4D;IAClD,KAAK,CAAC,gBAAgB;QAC9B,MAAM,cAAc,GAAG,IAAA,4BAAY,EAAC,IAAI,CAAC,GAAG,CAAC,GAAG,gBAAgB,CAAC;QAEjE,OAAO,IAAI,CAAC,GAAG,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;IACvD,CAAC;IAES,KAAK,CAAC,UAAU;QACxB,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3D,CAAC;IAES,UAAU;QAClB,OAAO,IAAA,sBAAU,EACf,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,EACvC,2BAAU,EACV,mCAAkB,CAAC,KAAK,CACzB,CAAC;IACJ,CAAC;IAES,KAAK,CAAC,mBAAmB;QACjC,MAAM,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACjE,CAAC;IAES,KAAK,CAAC,WAAW;QACzB,2CAA2C;QAC3C,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;CACF,CAAA;AArEY,YAAY;IADxB,IAAA,mBAAU,GAAE;IASR,WAAA,IAAA,eAAM,EAAC,iBAAiB,CAAC,CAAA;IACzB,WAAA,IAAA,eAAM,EAAC,kBAAkB,CAAC,CAAA;IAM1B,WAAA,IAAA,eAAM,EAAC,qBAAqB,CAAC,CAAA;qCATV,sBAAU;QAClB,sBAAU;QACqB,gCAAc,UAGtC,qCAAwB;QACjB,oDAAwB;QACpC,6BAAa;QACR,4BAAiB;GAd3B,YAAY,CAqExB;AArEY,oCAAY","sourcesContent":["// Copyright 2020-2024 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { Inject, Injectable } from '@nestjs/common';\nimport { EventEmitter2 } from '@nestjs/event-emitter';\nimport { SchedulerRegistry } from '@nestjs/schedule';\n\nimport { StellarHandlerKind, isCustomDs } from '@subql/common-stellar';\nimport {\n NodeConfig,\n BaseFetchService,\n ApiService,\n getModulos,\n Header,\n IStoreModelProvider,\n} from '@subql/node-core';\nimport { StellarBlock, SubqlDatasource } from '@subql/types-stellar';\nimport { StellarApi } from '../stellar';\nimport { calcInterval, stellarBlockToHeader } from '../stellar/utils.stellar';\nimport { IStellarBlockDispatcher } from './blockDispatcher';\nimport { StellarDictionaryService } from './dictionary';\nimport { ProjectService } from './project.service';\nimport { UnfinalizedBlocksService } from './unfinalizedBlocks.service';\n\nconst BLOCK_TIME_VARIANCE = 5000;\n\nconst INTERVAL_PERCENT = 0.9;\n\n@Injectable()\nexport class FetchService extends BaseFetchService<\n SubqlDatasource,\n IStellarBlockDispatcher,\n StellarBlock\n> {\n constructor(\n private apiService: ApiService,\n nodeConfig: NodeConfig,\n @Inject('IProjectService') projectService: ProjectService,\n @Inject('IBlockDispatcher')\n blockDispatcher: IStellarBlockDispatcher,\n dictionaryService: StellarDictionaryService,\n unfinalizedBlocksService: UnfinalizedBlocksService,\n eventEmitter: EventEmitter2,\n schedulerRegistry: SchedulerRegistry,\n @Inject('IStoreModelProvider') storeModelProvider: IStoreModelProvider,\n ) {\n super(\n nodeConfig,\n projectService,\n blockDispatcher,\n dictionaryService,\n eventEmitter,\n schedulerRegistry,\n unfinalizedBlocksService,\n storeModelProvider,\n );\n }\n\n get api(): StellarApi {\n return this.apiService.unsafeApi;\n }\n\n protected async getFinalizedHeader(): Promise<Header> {\n const block = await this.api.getFinalizedBlock();\n return stellarBlockToHeader(block);\n }\n\n protected async getBestHeight(): Promise<number> {\n return this.api.getBestBlockHeight();\n }\n\n // eslint-disable-next-line @typescript-eslint/require-await\n protected async getChainInterval(): Promise<number> {\n const CHAIN_INTERVAL = calcInterval(this.api) * INTERVAL_PERCENT;\n\n return Math.min(BLOCK_TIME_VARIANCE, CHAIN_INTERVAL);\n }\n\n protected async getChainId(): Promise<string> {\n return Promise.resolve(this.api.getChainId().toString());\n }\n\n protected getModulos(): number[] {\n return getModulos(\n this.projectService.getAllDataSources(),\n isCustomDs,\n StellarHandlerKind.Block,\n );\n }\n\n protected async initBlockDispatcher(): Promise<void> {\n await this.blockDispatcher.init(this.resetForNewDs.bind(this));\n }\n\n protected async preLoopHook(): Promise<void> {\n // Stellar doesn't need to do anything here\n return Promise.resolve();\n }\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ApiService, BaseUnfinalizedBlocksService, Header, NodeConfig,
|
|
1
|
+
import { ApiService, BaseUnfinalizedBlocksService, Header, NodeConfig, IStoreModelProvider } from '@subql/node-core';
|
|
2
2
|
import { BlockWrapper } from '@subql/types-stellar';
|
|
3
3
|
export declare class UnfinalizedBlocksService extends BaseUnfinalizedBlocksService<BlockWrapper> {
|
|
4
4
|
private readonly apiService;
|
|
5
|
-
constructor(apiService: ApiService, nodeConfig: NodeConfig,
|
|
5
|
+
constructor(apiService: ApiService, nodeConfig: NodeConfig, storeModelProvider: IStoreModelProvider);
|
|
6
6
|
protected getFinalizedHead(): Promise<Header>;
|
|
7
7
|
protected getHeaderForHash(hash: string): Promise<Header>;
|
|
8
|
-
|
|
8
|
+
getHeaderForHeight(height: number): Promise<Header>;
|
|
9
9
|
}
|
|
@@ -10,6 +10,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
10
10
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
11
11
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
12
12
|
};
|
|
13
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
14
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
15
|
+
};
|
|
13
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
17
|
exports.UnfinalizedBlocksService = void 0;
|
|
15
18
|
const common_1 = require("@nestjs/common");
|
|
@@ -18,8 +21,8 @@ const utils_stellar_1 = require("../stellar/utils.stellar");
|
|
|
18
21
|
const logger = (0, node_core_1.getLogger)('unfinalized');
|
|
19
22
|
let UnfinalizedBlocksService = class UnfinalizedBlocksService extends node_core_1.BaseUnfinalizedBlocksService {
|
|
20
23
|
apiService;
|
|
21
|
-
constructor(apiService, nodeConfig,
|
|
22
|
-
super(nodeConfig,
|
|
24
|
+
constructor(apiService, nodeConfig, storeModelProvider) {
|
|
25
|
+
super(nodeConfig, storeModelProvider);
|
|
23
26
|
this.apiService = apiService;
|
|
24
27
|
}
|
|
25
28
|
async getFinalizedHead() {
|
|
@@ -54,9 +57,9 @@ __decorate([
|
|
|
54
57
|
], UnfinalizedBlocksService.prototype, "getHeaderForHeight", null);
|
|
55
58
|
UnfinalizedBlocksService = __decorate([
|
|
56
59
|
(0, common_1.Injectable)(),
|
|
60
|
+
__param(2, (0, common_1.Inject)('IStoreModelProvider')),
|
|
57
61
|
__metadata("design:paramtypes", [node_core_1.ApiService,
|
|
58
|
-
node_core_1.NodeConfig,
|
|
59
|
-
node_core_1.StoreCacheService])
|
|
62
|
+
node_core_1.NodeConfig, Object])
|
|
60
63
|
], UnfinalizedBlocksService);
|
|
61
64
|
exports.UnfinalizedBlocksService = UnfinalizedBlocksService;
|
|
62
65
|
//# sourceMappingURL=unfinalizedBlocks.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unfinalizedBlocks.service.js","sourceRoot":"","sources":["../../src/indexer/unfinalizedBlocks.service.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC
|
|
1
|
+
{"version":3,"file":"unfinalizedBlocks.service.js","sourceRoot":"","sources":["../../src/indexer/unfinalizedBlocks.service.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;;;;;;;AAEnC,2CAAoD;AACpD,gDAQ0B;AAE1B,4DAAgE;AAEhE,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,aAAa,CAAC,CAAC;AAGjC,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,wCAA0C;IAEnE;IADnB,YACmB,UAAsB,EACvC,UAAsB,EACS,kBAAuC;QAEtE,KAAK,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;QAJrB,eAAU,GAAV,UAAU,CAAY;IAKzC,CAAC;IAGe,AAAN,KAAK,CAAC,gBAAgB;QAC9B,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;QACrE,OAAO,IAAA,oCAAoB,EAAC,cAAc,CAAC,CAAC;IAC9C,CAAC;IAGe,AAAN,KAAK,CAAC,gBAAgB,CAAC,IAAY;QAC3C,OAAO,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IACrD,CAAC;IAGK,AAAN,KAAK,CAAC,kBAAkB,CAAC,MAAc;QACrC,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnE,OAAO,IAAA,oCAAoB,EAAC,KAAK,CAAC,CAAC;IACrC,CAAC;CACF,CAAA;AAfiB;IADf,IAAA,0BAAc,GAAE;;;;gEAIhB;AAGe;IADf,IAAA,0BAAc,GAAE;;;;gEAGhB;AAGK;IADL,IAAA,0BAAc,GAAE;;;;kEAIhB;AAxBU,wBAAwB;IADpC,IAAA,mBAAU,GAAE;IAKR,WAAA,IAAA,eAAM,EAAC,qBAAqB,CAAC,CAAA;qCAFD,sBAAU;QAC3B,sBAAU;GAHb,wBAAwB,CAyBpC;AAzBY,4DAAwB","sourcesContent":["// Copyright 2020-2024 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { Inject, Injectable } from '@nestjs/common';\nimport {\n ApiService,\n BaseUnfinalizedBlocksService,\n Header,\n NodeConfig,\n IStoreModelProvider,\n getLogger,\n mainThreadOnly,\n} from '@subql/node-core';\nimport { BlockWrapper } from '@subql/types-stellar';\nimport { stellarBlockToHeader } from '../stellar/utils.stellar';\n\nconst logger = getLogger('unfinalized');\n\n@Injectable()\nexport class UnfinalizedBlocksService extends BaseUnfinalizedBlocksService<BlockWrapper> {\n constructor(\n private readonly apiService: ApiService,\n nodeConfig: NodeConfig,\n @Inject('IStoreModelProvider') storeModelProvider: IStoreModelProvider,\n ) {\n super(nodeConfig, storeModelProvider);\n }\n\n @mainThreadOnly()\n protected async getFinalizedHead(): Promise<Header> {\n const finalizedBlock = await this.apiService.api.getFinalizedBlock();\n return stellarBlockToHeader(finalizedBlock);\n }\n\n @mainThreadOnly()\n protected async getHeaderForHash(hash: string): Promise<Header> {\n return this.getHeaderForHeight(parseInt(hash, 10));\n }\n\n @mainThreadOnly()\n async getHeaderForHeight(height: number): Promise<Header> {\n const block = (await this.apiService.api.fetchBlocks([height]))[0];\n return stellarBlockToHeader(block);\n }\n}\n"]}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { SubqlStellarDataSource } from '@subql/common-stellar';
|
|
2
|
-
import { NodeConfig, IProjectService, ProcessBlockResponse, ApiService, BaseWorkerService, IProjectUpgradeService, IBlock } from '@subql/node-core';
|
|
2
|
+
import { NodeConfig, IProjectService, ProcessBlockResponse, ApiService, BaseWorkerService, IProjectUpgradeService, IBlock, Header } from '@subql/node-core';
|
|
3
3
|
import { BlockWrapper, SubqlDatasource } from '@subql/types-stellar';
|
|
4
4
|
import { IndexerManager } from '../indexer.manager';
|
|
5
|
-
export type FetchBlockResponse =
|
|
6
|
-
parentHash: string;
|
|
7
|
-
} | undefined;
|
|
5
|
+
export type FetchBlockResponse = Header;
|
|
8
6
|
export type WorkerStatusResponse = {
|
|
9
7
|
threadId: number;
|
|
10
8
|
isIndexing: boolean;
|
|
@@ -16,8 +14,6 @@ export declare class WorkerService extends BaseWorkerService<BlockWrapper, Fetch
|
|
|
16
14
|
private indexerManager;
|
|
17
15
|
constructor(apiService: ApiService, indexerManager: IndexerManager, projectService: IProjectService<SubqlDatasource>, projectUpgradeService: IProjectUpgradeService, nodeConfig: NodeConfig);
|
|
18
16
|
protected fetchChainBlock(heights: number, extra: {}): Promise<IBlock<BlockWrapper>>;
|
|
19
|
-
protected toBlockResponse(block: BlockWrapper):
|
|
20
|
-
parentHash: string;
|
|
21
|
-
};
|
|
17
|
+
protected toBlockResponse(block: BlockWrapper): Header;
|
|
22
18
|
protected processFetchedBlock(block: IBlock<BlockWrapper>, dataSources: SubqlStellarDataSource[]): Promise<ProcessBlockResponse>;
|
|
23
19
|
}
|
|
@@ -18,6 +18,7 @@ exports.WorkerService = void 0;
|
|
|
18
18
|
const node_worker_threads_1 = require("node:worker_threads");
|
|
19
19
|
const common_1 = require("@nestjs/common");
|
|
20
20
|
const node_core_1 = require("@subql/node-core");
|
|
21
|
+
const utils_stellar_1 = require("../../stellar/utils.stellar");
|
|
21
22
|
const indexer_manager_1 = require("../indexer.manager");
|
|
22
23
|
const logger = (0, node_core_1.getLogger)(`Worker Service #${node_worker_threads_1.threadId}`);
|
|
23
24
|
let WorkerService = class WorkerService extends node_core_1.BaseWorkerService {
|
|
@@ -33,9 +34,7 @@ let WorkerService = class WorkerService extends node_core_1.BaseWorkerService {
|
|
|
33
34
|
return block;
|
|
34
35
|
}
|
|
35
36
|
toBlockResponse(block) {
|
|
36
|
-
return
|
|
37
|
-
parentHash: block.block.prev_hash,
|
|
38
|
-
};
|
|
37
|
+
return (0, utils_stellar_1.stellarBlockToHeader)(block.block);
|
|
39
38
|
}
|
|
40
39
|
async processFetchedBlock(block, dataSources) {
|
|
41
40
|
return this.indexerManager.indexBlock(block, dataSources);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.service.js","sourceRoot":"","sources":["../../../src/indexer/worker/worker.service.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;;;;;;;AAEnC,6DAA+C;AAC/C,2CAAoD;AAEpD,
|
|
1
|
+
{"version":3,"file":"worker.service.js","sourceRoot":"","sources":["../../../src/indexer/worker/worker.service.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;;;;;;;AAEnC,6DAA+C;AAC/C,2CAAoD;AAEpD,gDAU0B;AAE1B,+DAAmE;AACnE,wDAAoD;AAWpD,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,mBAAmB,8BAAQ,EAAE,CAAC,CAAC;AAGjD,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,6BAKlC;IAEW;IACA;IAFV,YACU,UAAsB,EACtB,cAA8B,EAEtC,cAAgD,EAEhD,qBAA6C,EAC7C,UAAsB;QAEtB,KAAK,CAAC,cAAc,EAAE,qBAAqB,EAAE,UAAU,CAAC,CAAC;QARjD,eAAU,GAAV,UAAU,CAAY;QACtB,mBAAc,GAAd,cAAc,CAAgB;IAQxC,CAAC;IACS,KAAK,CAAC,eAAe,CAC7B,OAAe,EACf,KAAS;QAET,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAC7D,OAAO,KAAK,CAAC;IACf,CAAC;IAES,eAAe,CAAC,KAAmB;QAC3C,OAAO,IAAA,oCAAoB,EAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAES,KAAK,CAAC,mBAAmB,CACjC,KAA2B,EAC3B,WAAqC;QAErC,OAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IAC5D,CAAC;CACF,CAAA;AAnCY,aAAa;IADzB,IAAA,mBAAU,GAAE;IAUR,WAAA,IAAA,eAAM,EAAC,iBAAiB,CAAC,CAAA;IAEzB,WAAA,IAAA,eAAM,EAAC,wBAAwB,CAAC,CAAA;qCAJb,sBAAU;QACN,gCAAc,kBAK1B,sBAAU;GAbb,aAAa,CAmCzB;AAnCY,sCAAa","sourcesContent":["// Copyright 2020-2024 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { threadId } from 'node:worker_threads';\nimport { Inject, Injectable } from '@nestjs/common';\nimport { SubqlStellarDataSource } from '@subql/common-stellar';\nimport {\n NodeConfig,\n getLogger,\n IProjectService,\n ProcessBlockResponse,\n ApiService,\n BaseWorkerService,\n IProjectUpgradeService,\n IBlock,\n Header,\n} from '@subql/node-core';\nimport { BlockWrapper, SubqlDatasource } from '@subql/types-stellar';\nimport { stellarBlockToHeader } from '../../stellar/utils.stellar';\nimport { IndexerManager } from '../indexer.manager';\n\nexport type FetchBlockResponse = Header;\n\nexport type WorkerStatusResponse = {\n threadId: number;\n isIndexing: boolean;\n fetchedBlocks: number;\n toFetchBlocks: number;\n};\n\nconst logger = getLogger(`Worker Service #${threadId}`);\n\n@Injectable()\nexport class WorkerService extends BaseWorkerService<\n BlockWrapper,\n FetchBlockResponse,\n SubqlStellarDataSource,\n {}\n> {\n constructor(\n private apiService: ApiService,\n private indexerManager: IndexerManager,\n @Inject('IProjectService')\n projectService: IProjectService<SubqlDatasource>,\n @Inject('IProjectUpgradeService')\n projectUpgradeService: IProjectUpgradeService,\n nodeConfig: NodeConfig,\n ) {\n super(projectService, projectUpgradeService, nodeConfig);\n }\n protected async fetchChainBlock(\n heights: number,\n extra: {},\n ): Promise<IBlock<BlockWrapper>> {\n const [block] = await this.apiService.fetchBlocks([heights]);\n return block;\n }\n\n protected toBlockResponse(block: BlockWrapper): Header {\n return stellarBlockToHeader(block.block);\n }\n\n protected async processFetchedBlock(\n block: IBlock<BlockWrapper>,\n dataSources: SubqlStellarDataSource[],\n ): Promise<ProcessBlockResponse> {\n return this.indexerManager.indexBlock(block, dataSources);\n }\n}\n"]}
|
|
@@ -13,6 +13,7 @@ const common_1 = require("@nestjs/common");
|
|
|
13
13
|
const event_emitter_1 = require("@nestjs/event-emitter");
|
|
14
14
|
const schedule_1 = require("@nestjs/schedule");
|
|
15
15
|
const node_core_1 = require("@subql/node-core");
|
|
16
|
+
const x_sequelize_1 = require("@subql/x-sequelize");
|
|
16
17
|
const configure_module_1 = require("../configure/configure.module");
|
|
17
18
|
const ds_processor_service_1 = require("../indexer/ds-processor.service");
|
|
18
19
|
const dynamic_ds_service_1 = require("../indexer/dynamic-ds.service");
|
|
@@ -22,7 +23,11 @@ let ReindexFeatureModule = class ReindexFeatureModule {
|
|
|
22
23
|
ReindexFeatureModule = __decorate([
|
|
23
24
|
(0, common_1.Module)({
|
|
24
25
|
providers: [
|
|
25
|
-
|
|
26
|
+
{
|
|
27
|
+
provide: 'IStoreModelProvider',
|
|
28
|
+
useFactory: node_core_1.storeModelFactory,
|
|
29
|
+
inject: [node_core_1.NodeConfig, event_emitter_1.EventEmitter2, schedule_1.SchedulerRegistry, x_sequelize_1.Sequelize],
|
|
30
|
+
},
|
|
26
31
|
node_core_1.StoreService,
|
|
27
32
|
node_core_1.ReindexService,
|
|
28
33
|
node_core_1.ForceCleanService,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reindex.module.js","sourceRoot":"","sources":["../../src/subcommands/reindex.module.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;AAEnC,2CAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"reindex.module.js","sourceRoot":"","sources":["../../src/subcommands/reindex.module.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;AAEnC,2CAAwC;AACxC,yDAA0E;AAC1E,+CAAqD;AACrD,gDAQ0B;AAC1B,oDAA+C;AAC/C,oEAAgE;AAChE,0EAAqE;AACrE,sEAAiE;AACjE,oFAAgF;AA8BzE,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAAG,CAAA;AAAvB,oBAAoB;IA5BhC,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT;gBACE,OAAO,EAAE,qBAAqB;gBAC9B,UAAU,EAAE,6BAAiB;gBAC7B,MAAM,EAAE,CAAC,sBAAU,EAAE,6BAAa,EAAE,4BAAiB,EAAE,uBAAS,CAAC;aAClE;YACD,wBAAY;YACZ,0BAAc;YACd,6BAAiB;YACjB;gBACE,OAAO,EAAE,0BAA0B;gBACnC,QAAQ,EAAE,oDAAwB;aACnC;YACD;gBACE,OAAO,EAAE,kBAAkB;gBAC3B,QAAQ,EAAE,qCAAgB;aAC3B;YACD,yCAAkB;YAClB;gBACE,8EAA8E;gBAC9E,OAAO,EAAE,sBAAU;gBACnB,UAAU,EAAE,GAAG,EAAE,CAAC,SAAS;aAC5B;YACD,4BAAiB;SAClB;QACD,WAAW,EAAE,EAAE;KAChB,CAAC;GACW,oBAAoB,CAAG;AAAvB,oDAAoB;AAW1B,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,aAAa;IATzB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,oBAAQ,CAAC,OAAO,EAAE;YAClB,kCAAe,CAAC,QAAQ,EAAE;YAC1B,oBAAoB;YACpB,kCAAkB,CAAC,OAAO,EAAE;SAC7B;QACD,WAAW,EAAE,EAAE;KAChB,CAAC;GACW,aAAa,CAAG;AAAhB,sCAAa","sourcesContent":["// Copyright 2020-2024 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { Module } from '@nestjs/common';\nimport { EventEmitter2, EventEmitterModule } from '@nestjs/event-emitter';\nimport { SchedulerRegistry } from '@nestjs/schedule';\nimport {\n ApiService,\n DbModule,\n ForceCleanService,\n StoreService,\n ReindexService,\n storeModelFactory,\n NodeConfig,\n} from '@subql/node-core';\nimport { Sequelize } from '@subql/x-sequelize';\nimport { ConfigureModule } from '../configure/configure.module';\nimport { DsProcessorService } from '../indexer/ds-processor.service';\nimport { DynamicDsService } from '../indexer/dynamic-ds.service';\nimport { UnfinalizedBlocksService } from '../indexer/unfinalizedBlocks.service';\n\n@Module({\n providers: [\n {\n provide: 'IStoreModelProvider',\n useFactory: storeModelFactory,\n inject: [NodeConfig, EventEmitter2, SchedulerRegistry, Sequelize],\n },\n StoreService,\n ReindexService,\n ForceCleanService,\n {\n provide: 'UnfinalizedBlocksService',\n useClass: UnfinalizedBlocksService,\n },\n {\n provide: 'DynamicDsService',\n useClass: DynamicDsService,\n },\n DsProcessorService,\n {\n // Used to work with DI for unfinalizedBlocksService but not used with reindex\n provide: ApiService,\n useFactory: () => undefined,\n },\n SchedulerRegistry,\n ],\n controllers: [],\n})\nexport class ReindexFeatureModule {}\n\n@Module({\n imports: [\n DbModule.forRoot(),\n ConfigureModule.register(),\n ReindexFeatureModule,\n EventEmitterModule.forRoot(),\n ],\n controllers: [],\n})\nexport class ReindexModule {}\n"]}
|
|
@@ -13,6 +13,7 @@ const common_1 = require("@nestjs/common");
|
|
|
13
13
|
const event_emitter_1 = require("@nestjs/event-emitter");
|
|
14
14
|
const schedule_1 = require("@nestjs/schedule");
|
|
15
15
|
const node_core_1 = require("@subql/node-core");
|
|
16
|
+
const x_sequelize_1 = require("@subql/x-sequelize");
|
|
16
17
|
const configure_module_1 = require("../configure/configure.module");
|
|
17
18
|
const ds_processor_service_1 = require("../indexer/ds-processor.service");
|
|
18
19
|
const dynamic_ds_service_1 = require("../indexer/dynamic-ds.service");
|
|
@@ -28,6 +29,11 @@ TestingFeatureModule = __decorate([
|
|
|
28
29
|
providers: [
|
|
29
30
|
node_core_1.InMemoryCacheService,
|
|
30
31
|
node_core_1.StoreService,
|
|
32
|
+
{
|
|
33
|
+
provide: 'IStoreModelProvider',
|
|
34
|
+
useFactory: node_core_1.storeModelFactory,
|
|
35
|
+
inject: [node_core_1.NodeConfig, event_emitter_1.EventEmitter2, schedule_1.SchedulerRegistry, x_sequelize_1.Sequelize],
|
|
36
|
+
},
|
|
31
37
|
testing_service_1.TestingService,
|
|
32
38
|
event_emitter_1.EventEmitter2,
|
|
33
39
|
node_core_1.PoiService,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.module.js","sourceRoot":"","sources":["../../src/subcommands/testing.module.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;AAEnC,2CAAwC;AACxC,yDAA0E;AAC1E,+CAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"testing.module.js","sourceRoot":"","sources":["../../src/subcommands/testing.module.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;AAEnC,2CAAwC;AACxC,yDAA0E;AAC1E,+CAAqE;AACrE,gDAc0B;AAC1B,oDAA+C;AAC/C,oEAAgE;AAEhE,0EAAqE;AACrE,sEAAiE;AACjE,gEAA4D;AAC5D,gEAA4D;AAC5D,oFAAgF;AAChF,wCAA+C;AAE/C,uDAAmD;AAkE5C,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAAG,CAAA;AAAvB,oBAAoB;IAhEhC,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT,gCAAoB;YACpB,wBAAY;YACZ;gBACE,OAAO,EAAE,qBAAqB;gBAC9B,UAAU,EAAE,6BAAiB;gBAC7B,MAAM,EAAE,CAAC,sBAAU,EAAE,6BAAa,EAAE,4BAAiB,EAAE,uBAAS,CAAC;aAClE;YACD,gCAAc;YACd,6BAAa;YACb,sBAAU;YACV,0BAAc;YACd,0BAAc;YACd,yCAAkB;YAClB,qCAAgB;YAChB,oDAAwB;YACxB,iCAAqB;YACrB,sCAA0B;YAC1B;gBACE,OAAO,EAAE,iBAAiB;gBAC1B,QAAQ,EAAE,gCAAc;aACzB;YACD;gBACE,OAAO,EAAE,sBAAU;gBACnB,UAAU,EAAE,KAAK,EACf,OAAwB,EACxB,qBAAkE,EAClE,YAA2B,EAC3B,UAAsB,EACtB,EAAE;oBACF,MAAM,UAAU,GAAG,IAAI,2BAAiB,CACtC,OAAO,EACP,qBAAqB,EACrB,YAAY,EACZ,UAAU,CACX,CAAC;oBACF,MAAM,UAAU,CAAC,IAAI,EAAE,CAAC;oBACxB,OAAO,UAAU,CAAC;gBACpB,CAAC;gBACD,MAAM,EAAE;oBACN,kBAAkB;oBAClB,wBAAwB;oBACxB,iCAAqB;oBACrB,6BAAa;oBACb,sBAAU;iBACX;aACF;YACD,sBAAU;YACV;gBACE,OAAO,EAAE,MAAM;gBACf,QAAQ,EAAE,2BAAiB;aAC5B;YACD;gBACE,OAAO,EAAE,iBAAiB;gBAC1B,QAAQ,EAAE,gCAAc;aACzB;YACD,gCAAc;YACd,4BAAiB;SAClB;QAED,WAAW,EAAE,EAAE;QACf,OAAO,EAAE,CAAC,sBAAU,CAAC;KACtB,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-2024 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { Module } from '@nestjs/common';\nimport { EventEmitter2, EventEmitterModule } from '@nestjs/event-emitter';\nimport { ScheduleModule, SchedulerRegistry } from '@nestjs/schedule';\nimport {\n ApiService,\n ConnectionPoolService,\n ConnectionPoolStateManager,\n DbModule,\n InMemoryCacheService,\n PoiService,\n PoiSyncService,\n ProjectUpgradeService,\n StoreService,\n TestRunner,\n SandboxService,\n NodeConfig,\n storeModelFactory,\n} from '@subql/node-core';\nimport { Sequelize } from '@subql/x-sequelize';\nimport { ConfigureModule } from '../configure/configure.module';\nimport { SubqueryProject } from '../configure/SubqueryProject';\nimport { DsProcessorService } from '../indexer/ds-processor.service';\nimport { DynamicDsService } from '../indexer/dynamic-ds.service';\nimport { IndexerManager } from '../indexer/indexer.manager';\nimport { ProjectService } from '../indexer/project.service';\nimport { UnfinalizedBlocksService } from '../indexer/unfinalizedBlocks.service';\nimport { StellarApiService } from '../stellar';\nimport { StellarApiConnection } from '../stellar/api.connection';\nimport { TestingService } from './testing.service';\n\n@Module({\n providers: [\n InMemoryCacheService,\n StoreService,\n {\n provide: 'IStoreModelProvider',\n useFactory: storeModelFactory,\n inject: [NodeConfig, EventEmitter2, SchedulerRegistry, Sequelize],\n },\n TestingService,\n EventEmitter2,\n PoiService,\n PoiSyncService,\n SandboxService,\n DsProcessorService,\n DynamicDsService,\n UnfinalizedBlocksService,\n ConnectionPoolService,\n ConnectionPoolStateManager,\n {\n provide: 'IProjectService',\n useClass: ProjectService,\n },\n {\n provide: ApiService,\n useFactory: async (\n project: SubqueryProject,\n connectionPoolService: ConnectionPoolService<StellarApiConnection>,\n eventEmitter: EventEmitter2,\n nodeConfig: NodeConfig,\n ) => {\n const apiService = new StellarApiService(\n project,\n connectionPoolService,\n eventEmitter,\n nodeConfig,\n );\n await apiService.init();\n return apiService;\n },\n inject: [\n 'ISubqueryProject',\n 'IProjectUpgradeService',\n ConnectionPoolService,\n EventEmitter2,\n NodeConfig,\n ],\n },\n TestRunner,\n {\n provide: 'IApi',\n useClass: StellarApiService,\n },\n {\n provide: 'IIndexerManager',\n useClass: IndexerManager,\n },\n IndexerManager,\n SchedulerRegistry,\n ],\n\n controllers: [],\n exports: [TestRunner],\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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@subql/node-stellar",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Ian He",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"@nestjs/platform-express": "^9.4.0",
|
|
26
26
|
"@nestjs/schedule": "^3.0.1",
|
|
27
27
|
"@stellar/stellar-sdk": "^12.2.0",
|
|
28
|
-
"@subql/common": "^5.1
|
|
29
|
-
"@subql/common-stellar": "4.1.
|
|
30
|
-
"@subql/node-core": "^
|
|
28
|
+
"@subql/common": "^5.2.1",
|
|
29
|
+
"@subql/common-stellar": "4.1.5",
|
|
30
|
+
"@subql/node-core": "^15.0.3",
|
|
31
31
|
"@subql/testing": "^2.2.0",
|
|
32
32
|
"@subql/types-stellar": "4.0.2",
|
|
33
33
|
"lodash": "^4.17.21",
|