@subql/node-ethereum 5.2.1 → 5.2.2-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 +2 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/ethereum/ethers/celo/celo-provider.d.ts +3 -3
- package/dist/indexer/blockDispatcher/block-dispatcher.service.d.ts +1 -0
- package/dist/indexer/blockDispatcher/block-dispatcher.service.js +4 -0
- package/dist/indexer/blockDispatcher/block-dispatcher.service.js.map +1 -1
- package/dist/indexer/types.d.ts +1 -0
- package/dist/indexer/types.js +4 -0
- package/dist/indexer/types.js.map +1 -1
- package/dist/indexer/worker/worker.service.d.ts +1 -0
- package/dist/indexer/worker/worker.service.js +4 -0
- package/dist/indexer/worker/worker.service.js.map +1 -1
- package/package.json +6 -5
|
@@ -4,7 +4,7 @@ import { JsonRpcBatchProvider } from '../json-rpc-batch-provider';
|
|
|
4
4
|
import { JsonRpcProvider } from '../json-rpc-provider';
|
|
5
5
|
export declare const CeloWsProvider: {
|
|
6
6
|
new (...args: any[]): {
|
|
7
|
-
"__#
|
|
7
|
+
"__#13@#flanHardForkBlock": BigNumber;
|
|
8
8
|
_networkPromise: Promise<import("@ethersproject/providers").Network>;
|
|
9
9
|
_network: import("@ethersproject/providers").Network;
|
|
10
10
|
_events: Array<import("@ethersproject/providers/lib/base-provider").Event>;
|
|
@@ -97,7 +97,7 @@ export declare const CeloWsProvider: {
|
|
|
97
97
|
} & typeof WebSocketProvider;
|
|
98
98
|
export declare const CeloJsonRpcProvider: {
|
|
99
99
|
new (...args: any[]): {
|
|
100
|
-
"__#
|
|
100
|
+
"__#13@#flanHardForkBlock": BigNumber;
|
|
101
101
|
_networkPromise: Promise<import("@ethersproject/providers").Network>;
|
|
102
102
|
_network: import("@ethersproject/providers").Network;
|
|
103
103
|
_events: Array<import("@ethersproject/providers/lib/base-provider").Event>;
|
|
@@ -190,7 +190,7 @@ export declare const CeloJsonRpcProvider: {
|
|
|
190
190
|
} & typeof JsonRpcProvider;
|
|
191
191
|
export declare const CeloJsonRpcBatchProvider: {
|
|
192
192
|
new (...args: any[]): {
|
|
193
|
-
"__#
|
|
193
|
+
"__#13@#flanHardForkBlock": BigNumber;
|
|
194
194
|
_networkPromise: Promise<import("@ethersproject/providers").Network>;
|
|
195
195
|
_network: import("@ethersproject/providers").Network;
|
|
196
196
|
_events: Array<import("@ethersproject/providers/lib/base-provider").Event>;
|
|
@@ -11,4 +11,5 @@ export declare class BlockDispatcherService extends BlockDispatcher<BlockContent
|
|
|
11
11
|
private indexerManager;
|
|
12
12
|
constructor(apiService: ApiService, nodeConfig: NodeConfig, indexerManager: IndexerManager, eventEmitter: EventEmitter2, projectService: IProjectService<EthereumProjectDs>, projectUpgradeService: IProjectUpgradeService, storeService: StoreService, storeModelProvider: IStoreModelProvider, poiSyncService: PoiSyncService, project: SubqueryProject);
|
|
13
13
|
protected indexBlock(block: IBlock<BlockContent>): Promise<ProcessBlockResponse>;
|
|
14
|
+
protected getBlockSize(block: IBlock<BlockContent>): number;
|
|
14
15
|
}
|
|
@@ -19,6 +19,7 @@ const common_1 = require("@nestjs/common");
|
|
|
19
19
|
const event_emitter_1 = require("@nestjs/event-emitter");
|
|
20
20
|
const node_core_1 = require("@subql/node-core");
|
|
21
21
|
const indexer_manager_1 = require("../indexer.manager");
|
|
22
|
+
const types_1 = require("../types");
|
|
22
23
|
/**
|
|
23
24
|
* @description Intended to behave the same as WorkerBlockDispatcherService but doesn't use worker threads or any parallel processing
|
|
24
25
|
*/
|
|
@@ -31,6 +32,9 @@ let BlockDispatcherService = class BlockDispatcherService extends node_core_1.Bl
|
|
|
31
32
|
async indexBlock(block) {
|
|
32
33
|
return this.indexerManager.indexBlock(block, await this.projectService.getDataSources(block.getHeader().blockHeight));
|
|
33
34
|
}
|
|
35
|
+
getBlockSize(block) {
|
|
36
|
+
return (0, types_1.getBlockSize)(block.block);
|
|
37
|
+
}
|
|
34
38
|
};
|
|
35
39
|
exports.BlockDispatcherService = BlockDispatcherService;
|
|
36
40
|
exports.BlockDispatcherService = BlockDispatcherService = __decorate([
|
|
@@ -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;AAK1B,wDAAoD;
|
|
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;AAK1B,wDAAoD;AACpD,oCAAsD;AAEtD;;GAEG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBACX,SAAQ,2BAAgD;IAM9C;IAHV,YACE,UAAsB,EACtB,UAAsB,EACd,cAA8B,EACtC,YAA2B,EAE3B,cAAkD,EAElD,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,KAA2B;QAE3B,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;IAES,YAAY,CAAC,KAA2B;QAChD,OAAO,IAAA,oBAAY,EAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACF,CAAA;AA3CY,wDAAsB;iCAAtB,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,CA2ClC","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 {\n EthereumProjectDs,\n SubqueryProject,\n} from '../../configure/SubqueryProject';\nimport { IndexerManager } from '../indexer.manager';\nimport { BlockContent, getBlockSize } 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 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<BlockContent>,\n ): Promise<ProcessBlockResponse> {\n return this.indexerManager.indexBlock(\n block,\n await this.projectService.getDataSources(block.getHeader().blockHeight),\n );\n }\n\n protected getBlockSize(block: IBlock<BlockContent>): number {\n return getBlockSize(block.block);\n }\n}\n"]}
|
package/dist/indexer/types.d.ts
CHANGED
package/dist/indexer/types.js
CHANGED
|
@@ -2,4 +2,8 @@
|
|
|
2
2
|
// Copyright 2020-2024 SubQuery Pte Ltd authors & contributors
|
|
3
3
|
// SPDX-License-Identifier: GPL-3.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.getBlockSize = getBlockSize;
|
|
6
|
+
function getBlockSize(block) {
|
|
7
|
+
return Number(block.size);
|
|
8
|
+
}
|
|
5
9
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/indexer/types.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC","sourcesContent":["// Copyright 2020-2024 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { EthereumBlock, LightEthereumBlock } from '@subql/types-ethereum';\n\nexport type BlockContent = EthereumBlock | LightEthereumBlock;\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/indexer/types.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;AAMnC,oCAEC;AAFD,SAAgB,YAAY,CAAC,KAAmB;IAC9C,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["// Copyright 2020-2024 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { EthereumBlock, LightEthereumBlock } from '@subql/types-ethereum';\n\nexport type BlockContent = EthereumBlock | LightEthereumBlock;\n\nexport function getBlockSize(block: BlockContent): number {\n return Number(block.size);\n}\n"]}
|
|
@@ -19,4 +19,5 @@ export declare class WorkerService extends BaseWorkerService<BlockContent, Fetch
|
|
|
19
19
|
protected fetchChainBlock(heights: number, extra: {}): Promise<IBlock<BlockContent>>;
|
|
20
20
|
protected toBlockResponse(block: BlockContent): Header;
|
|
21
21
|
protected processFetchedBlock(block: IBlock<BlockContent>, dataSources: SubqlEthereumDataSource[]): Promise<ProcessBlockResponse>;
|
|
22
|
+
getBlockSize(block: IBlock<BlockContent>): number;
|
|
22
23
|
}
|
|
@@ -19,6 +19,7 @@ const common_1 = require("@nestjs/common");
|
|
|
19
19
|
const node_core_1 = require("@subql/node-core");
|
|
20
20
|
const utils_ethereum_1 = require("../../ethereum/utils.ethereum");
|
|
21
21
|
const indexer_manager_1 = require("../indexer.manager");
|
|
22
|
+
const types_1 = require("../types");
|
|
22
23
|
let WorkerService = class WorkerService extends node_core_1.BaseWorkerService {
|
|
23
24
|
apiService;
|
|
24
25
|
indexerManager;
|
|
@@ -40,6 +41,9 @@ let WorkerService = class WorkerService extends node_core_1.BaseWorkerService {
|
|
|
40
41
|
async processFetchedBlock(block, dataSources) {
|
|
41
42
|
return this.indexerManager.indexBlock(block, dataSources);
|
|
42
43
|
}
|
|
44
|
+
getBlockSize(block) {
|
|
45
|
+
return (0, types_1.getBlockSize)(block.block);
|
|
46
|
+
}
|
|
43
47
|
};
|
|
44
48
|
exports.WorkerService = WorkerService;
|
|
45
49
|
exports.WorkerService = WorkerService = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.service.js","sourceRoot":"","sources":["../../../src/indexer/worker/worker.service.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;;;;;;;AAEnC,2CAAoD;AAEpD,gDAS0B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AM,EAAC,wBAAwB,CAAC,CAAA;qCARb,sBAAU;QAKN,gCAAc,kBAK1B,sBAAU;GAjBb,aAAa,CA+CzB","sourcesContent":["// Copyright 2020-2024 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { Inject, Injectable } from '@nestjs/common';\nimport { SubqlEthereumDataSource } from '@subql/common-ethereum';\nimport {\n NodeConfig,\n IProjectService,\n ProcessBlockResponse,\n ApiService,\n BaseWorkerService,\n IProjectUpgradeService,\n IBlock,\n Header,\n} from '@subql/node-core';\nimport { EthereumProjectDs } from '../../configure/SubqueryProject';\nimport { EthereumApi } from '../../ethereum';\nimport SafeEthProvider from '../../ethereum/safe-api';\nimport { ethereumBlockToHeader } from '../../ethereum/utils.ethereum';\nimport { IndexerManager } from '../indexer.manager';\nimport { BlockContent, getBlockSize } from '../types';\n\nexport type FetchBlockResponse = Header;\n\nexport type WorkerStatusResponse = {\n threadId: number;\n isIndexing: boolean;\n fetchedBlocks: number;\n toFetchBlocks: number;\n};\n\n@Injectable()\nexport class WorkerService extends BaseWorkerService<\n BlockContent,\n FetchBlockResponse,\n SubqlEthereumDataSource,\n {}\n> {\n constructor(\n private apiService: ApiService<\n EthereumApi,\n SafeEthProvider,\n IBlock<BlockContent>[]\n >,\n private indexerManager: IndexerManager,\n @Inject('IProjectService')\n projectService: IProjectService<EthereumProjectDs>,\n @Inject('IProjectUpgradeService')\n projectUpgradeService: IProjectUpgradeService,\n nodeConfig: NodeConfig,\n ) {\n super(projectService, projectUpgradeService, nodeConfig);\n }\n\n protected async fetchChainBlock(\n heights: number,\n extra: {},\n ): Promise<IBlock<BlockContent>> {\n const [block] = await this.apiService.fetchBlocks([heights]);\n return block;\n }\n\n protected toBlockResponse(block: BlockContent): Header {\n return {\n ...ethereumBlockToHeader(block),\n parentHash: block.parentHash,\n };\n }\n\n protected async processFetchedBlock(\n block: IBlock<BlockContent>,\n dataSources: SubqlEthereumDataSource[],\n ): Promise<ProcessBlockResponse> {\n return this.indexerManager.indexBlock(block, dataSources);\n }\n\n getBlockSize(block: IBlock<BlockContent>): number {\n return getBlockSize(block.block);\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@subql/node-ethereum",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.2-0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Ian He",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -24,9 +24,9 @@
|
|
|
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": "^5.2.
|
|
28
|
-
"@subql/common-ethereum": "4.5.
|
|
29
|
-
"@subql/node-core": "^
|
|
27
|
+
"@subql/common": "^5.2.2",
|
|
28
|
+
"@subql/common-ethereum": "4.5.6-0",
|
|
29
|
+
"@subql/node-core": "^16.1.0",
|
|
30
30
|
"@subql/testing": "^2.2.1",
|
|
31
31
|
"@subql/types-ethereum": "4.0.0",
|
|
32
32
|
"cacheable-lookup": "6",
|
|
@@ -59,5 +59,6 @@
|
|
|
59
59
|
"files": [
|
|
60
60
|
"/dist",
|
|
61
61
|
"/bin"
|
|
62
|
-
]
|
|
62
|
+
],
|
|
63
|
+
"stableVersion": "5.2.1"
|
|
63
64
|
}
|