Skip to content

Commit

Permalink
Sync 20230113 (#20)
Browse files Browse the repository at this point in the history
* fix: incomplete ds data in same block (subquery#1370)

Co-authored-by: Orion <orion@starfish.finance>

* [SKIP CI] Prerelease

* Best Block (subquery#1308)

* Draft

* update changes

* rebase changes

* fix

* fix (subquery#1329)

* disable best blocks for workers until we support it

* Rename bestBlock to unfinalizedBlocks, other clean up

* Clean up

* Further clean up

* Dedupe reindex function

* Fix tests

* Clean up

* Update checking finalization to use parent hash

* Rename logger

* Refactor unfinalized blocks

* Use header rather than full block, improve detecting forks

* Verify unfinalized blocks when disabled.

Use sorted array for storing unfinalized blocks

* Clean up logs

* Fix not indexing unfinalized blocks right away, exit if historical not enabled

Co-authored-by: Scott Twiname <skott.twiname@gmail.com>

* [SKIP CI] Prerelease

* Fix bugs with unfinalized blocks (subquery#1374)

* Fix bugs with unfinalized blocks

- Fix using wrong hash for unfinalized blocks
- Fix not removing unfinalized blocks when the latest unfinalized block < finalized

* Fix tests getting stuck

* Fix issue finding where fork occurred

* [SKIP CI] Prerelease

* [release] 20221028 (subquery#1372)

* hot fix tests (subquery#1360)

* update tests: api.service.spec, init-controller.test, publish-controller.spec

* update tests following comments

* [SKIP CI] Prerelease

* add ethereum to CLI and Validator (subquery#1378)

* Imporve dictionary query (subquery#1371)

* wip

* wip

* wip

* broken wip

* wip refactoring

* seperate dictionaryQueryEntries

* fix logic for setDicitonaryQueryEntries

* cleaning up

* move dictionaryEntry.ts to node-core

* remove comments

* create class for dictionaryqueryentries

* update tests

* move dictionaryQueryService into dicitonaryService

* refactor

* update logic for useDicitonary

* relocated dictionaryQuery funcs

* add test for dictquerymap

* tests failing on windows?

* test getDictionaryQueryEntries

* test fixed for getDictioanryQueryEntries

* added test for sorting

* conflict fixed ?

* fix conflict_2

* fix conflict_3

* add delete temp ds records back

* clean up with new logic

* clean up, add comments for test

* fix

* update logic

* add generic type

* [SKIP CI] Prerelease

* Enable for better inheritance of generated entity modeld (subquery#1377)

* refactor: enable for entity inheritance

* refactor: include also filed getters

* [SKIP CI] Prerelease

* fix comments issue with new package (subquery#1380)

* fix comments issue with new package

* moved yaml package

* [SKIP CI] Prerelease

* fix logic with reindex and unfinalized height and dynamic ds (subquery#1382)

* fix logic with reindex and unfinalized height

* fix

* include fix for subquery#1379

* update polkadot to 9.7.1 (subquery#1384)

* [release] 20221107

* Fix remove alter table (subquery#1387)

* remove migrate alter table

* remove

* [SKIP CI] Prerelease

* [release] 20221108 (subquery#1388)

* fix missing sequelize sync (subquery#1389)

* [SKIP CI] Prerelease

* [release] 20221108 patch (subquery#1390)

* reindex bind (subquery#1391)

* [SKIP CI] Prerelease

* [release] 20221109 (subquery#1393)

* Handle fetch errors, then retry (subquery#1386)

* add retryOnFail function

* add retryOnFail

* add test, fix logic

* [SKIP CI] Prerelease

* fix (subquery#1395)

* [SKIP CI] Prerelease

* [release] 20221109 node-core (subquery#1394)

* Fix tests hanging (subquery#1396)

* Fix tests hanging

* Update base docker image with newer git version

* [SKIP CI] Prerelease

* Add distinct query plugin (subquery#1274)

* Add distinct query plugin

* Clean up log

* Fix distinct not being provided to query

* Uppercase enum to be consistent with other enums

* Update dictionary queries to try distinct argument

* [SKIP CI] Prerelease

* Add query distinct dependencies (subquery#1398)

* fix missing update forked graphile dependencies

* tidy up

* tidy up

* [SKIP CI] Prerelease

* Break block dispatcher file up and move common code to base class (subquery#1397)

* [SKIP CI] Prerelease

* Hot schema trigger (subquery#1401)

* implement trigger with notification

* working prior clean up

* refactor and clean up on async and await

* clean up

* clear comments

* add filter

* fix

* fix err

* [SKIP CI] Prerelease

* [release] 20221115 (subquery#1402)

* [release] 20221115

* [release] 20221115

* [release] 20221115

* fix hot schema (subquery#1404)

* fix and refactor

* refactor getTriggers

* [SKIP CI] Prerelease

* [release] 20221115 (subquery#1408)

* [release] 20221115

* [release] 20221115

* fix fetchblock for works (subquery#1410)

* [SKIP CI] Prerelease

* fix row estimate (subquery#1417)

* fix row estimate

* tidy up

* [SKIP CI] Prerelease

* Add support to cli/validator for flare (subquery#1416)

* [SKIP CI] Prerelease

* missing validator missing ipfs chainTypes (subquery#1419)

* [SKIP CI] Prerelease

* query explain include graphql query (subquery#1426)

* [SKIP CI] Prerelease

* dictionary auth link integration (subquery#1411)

* add required dependancies and add flag for feature

* update modules and add logic to dictionary

* update dictionary parameters, update tests, remove hardcoded values

* simplify auth dictionary handling

* add apollo link type, remove un-needed from wrapper

* remove dictionary from indexer module

* update flag name, add error check

* update yargs flag description

* Update appolo-links

* update @subql/apollo-links version, remove apollo/client version change

* fix yarn.lock

* add await init to dictionary tests

* fix fetch test dictionary provider, update yarn.lock

Co-authored-by: Lachlan McCrae <8554309+lachlan1m@users.noreply.github.com>
Co-authored-by: HZ <zhaihaohk@gmail.com>

* Fix missing speChanged logic with getRuntime (subquery#1421)

* init

* need fix worker

* fix test

* tidy up

* fix test, fix missing dictionary

* inject service to runtime

* remove unused code

* [SKIP CI] Prerelease

* Feat/multi chain indexing (subquery#1375)

* [SKIP CI] Prerelease

* remove enums (subquery#1427)

* [SKIP CI] Prerelease

* change to print graphql sql on request (subquery#1428)

* [SKIP CI] Prerelease

* fix missing util-crptyo in util package (subquery#1429)

* fix missing util-crptyo in util package

* need prerelease in query service

* [SKIP CI] Prerelease

* fix import issue in query service (subquery#1430)

* [SKIP CI] Prerelease

* fix missing query (subquery#1432)

* [SKIP CI] Prerelease

* change fetch module SubqueryProject => ISubqueryProject (subquery#1433)

Co-authored-by: Lachlan McCrae <8554309+lachlan1m@users.noreply.github.com>

* [SKIP CI] Prerelease

* Update polkadot 9.9.1 (subquery#1434)

* update polkadot api, also fix force-clean dependencies issue

* tidy up

* [SKIP CI] Prerelease

* [release] 20221123 (subquery#1431)

* [release] 20221123

* Update packages/query/CHANGELOG.md

Co-authored-by: Scott Twiname <skott.twiname@gmail.com>

* Update packages/node-core/CHANGELOG.md

Co-authored-by: Scott Twiname <skott.twiname@gmail.com>

* Update packages/node/CHANGELOG.md

Co-authored-by: Scott Twiname <skott.twiname@gmail.com>

* Update packages/node-core/CHANGELOG.md

Co-authored-by: Scott Twiname <skott.twiname@gmail.com>

* Update packages/validator/CHANGELOG.md

Co-authored-by: Scott Twiname <skott.twiname@gmail.com>

Co-authored-by: Scott Twiname <skott.twiname@gmail.com>

* Add a way to pass settings to the graphql playground (subquery#1436)

* Add a way to pass settings to the graphql playground

* Add a changelog entry

* [SKIP CI] Prerelease

* Fix the changelog entry for the last PR (subquery#1437)

* [SKIP CI] Prerelease

* fix enum name missing issue (subquery#1441)

* fix enum name missing issue

* tidy up

* [SKIP CI] Prerelease

* hash sql queries (subquery#1438)

* hashed sql

* add comments

* add comment for hashName function

* update function

* update hashName function

* [SKIP CI] Prerelease

* [release] 20221130 (subquery#1442)

* [release] 20221130

* [release] 20221130

* Add --file flag for codegen (subquery#1446)

* init

* change flag behaviour so -f can overwrite -l

* update getManifestPath method, fix typo

* update argument description

* update variable names

* update arg description

* add error message on bad --file path

Co-authored-by: Lachlan McCrae <8554309+lachlan1m@users.noreply.github.com>

* [SKIP CI] Prerelease

* add try and catch for hsr (subquery#1449)

* [SKIP CI] Prerelease

* Bypass blocks (subquery#1435)

* wip

* manifest error

* manfiest passed

* added logging for bypassing blocks

* sync main, moved bypassBlocks under networks

* pass all tests

* mock dictioanry case

* fix metadata

* clean up

* allow range

* bypass working, needs more testing

* wip on bypass with setting new bufferHeight

* working

* added runtime test

* add test for latestBufferHeight (blocked)

* removed unneeded test, improve logic

* clean up

* add comments

* add comments for latestBufferHeight reasoning

* update logic

* refactor

* update logic

* refactor

* [SKIP CI] Prerelease

* [release] 20221205 (subquery#1448)

* [release] 20221205

* [release] 20221205

* [release] 20221206

* details for bypassBlocks

* Remove unused RuntimeService from indexer module, it had missing dependencies (subquery#1453)

* [SKIP CI] Prerelease

* Fix/subcommands (subquery#1451)

* updated forceClean

* update reindex

* [SKIP CI] Prerelease

* Enable env vars parsing at node and query commands (subquery#1452)

* [SKIP CI] Prerelease

* Workers: Fix SequelizeDatabaseError - tuple concurrently updated (subquery#1458)

* add flag for hot-schema reload on node, ensure query is on main thread

* remove flags

* [SKIP CI] Prerelease

* Add start height to project (subquery#1456)

* [SKIP CI] Prerelease

* Fix poi offset is 0 (subquery#1459)

* [SKIP CI] Prerelease

* Handle when fields got undefined with historical (subquery#1463)

* [SKIP CI] Prerelease

* update deploy cli (subquery#1460)

* [SKIP CI] Prerelease

* exit on fail (subquery#1464)

* [SKIP CI] Prerelease

* fix parentSpecVersion could be undefined (subquery#1467)

* [SKIP CI] Prerelease

* [release] 20221219 (subquery#1466)

* [release] 20221219

* update

* Update packages/node-core/CHANGELOG.md

Co-authored-by: Scott Twiname <skott.twiname@gmail.com>

* Update packages/node/CHANGELOG.md

Co-authored-by: Scott Twiname <skott.twiname@gmail.com>

* Update packages/node-core/CHANGELOG.md

Co-authored-by: Scott Twiname <skott.twiname@gmail.com>

* Update packages/cli/CHANGELOG.md

Co-authored-by: Scott Twiname <skott.twiname@gmail.com>

* update

Co-authored-by: Scott Twiname <skott.twiname@gmail.com>

* Fix templates with other sdks, make -f flag work like other commands (subquery#1470)

* Fix templates with other sdks, make -f flag work like other commands

* Fix for sdks with first class smart contracts

* [SKIP CI] Prerelease

* Tweak error message for genesis hash (subquery#1471)

* [SKIP CI] Prerelease

* Fix trigger function (subquery#1469)

* fix trigger and function for subscription and hot schema reload

* update

* [SKIP CI] Prerelease

* [release] 20221222 (subquery#1474)

* validate dictionary with start height (subquery#1473)

* validate dictionary with start height

* Update packages/node/src/indexer/fetch.service.ts

Co-authored-by: Scott Twiname <skott.twiname@gmail.com>

Co-authored-by: Scott Twiname <skott.twiname@gmail.com>

* [SKIP CI] Prerelease

* add count for entity (subquery#1480)

* add count for entity

* Update packages/node-core/src/indexer/store.service.ts

Co-authored-by: Scott Twiname <skott.twiname@gmail.com>

Co-authored-by: Scott Twiname <skott.twiname@gmail.com>

* [SKIP CI] Prerelease

* Fixing readme doc for @subql/query (subquery#1485)

* doc: correcting grammer

* fix: typo

* [SKIP CI] Prerelease

* update polkadot api to 9.11.1 (subquery#1483)

* update polkadot api to 9.11.1

* update

* [SKIP CI] Prerelease

* add connection filters (subquery#1484)

* [SKIP CI] Prerelease

* update fetch.module dictionary service

* add bypassBlocks

Co-authored-by: hariu-starfish <103621490+hariu-starfish@users.noreply.github.com>
Co-authored-by: Orion <orion@starfish.finance>
Co-authored-by: Jay Ji <jiqiang90@hotmail.com>
Co-authored-by: Scott Twiname <skott.twiname@gmail.com>
Co-authored-by: Naveen V <velnaveen99@gmail.com>
Co-authored-by: Filippo <filippo@embriotech.ch>
Co-authored-by: Lachlan McCrae <8554309+lamcc21@users.noreply.github.com>
Co-authored-by: Lachlan McCrae <8554309+lachlan1m@users.noreply.github.com>
Co-authored-by: HZ <zhaihaohk@gmail.com>
Co-authored-by: MOZGIII <mike-n@narod.ru>
Co-authored-by: James Bayly <46693720+jamesbayly@users.noreply.github.com>
Co-authored-by: Mingyang Li <53138432+Mingyang-Li@users.noreply.github.com>
  • Loading branch information
13 people committed Jan 25, 2023
1 parent 1398dea commit 8ba66c5
Show file tree
Hide file tree
Showing 28 changed files with 727 additions and 420 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"typescript": "^4.4.4"
},
"resolutions": {
"@polkadot/api": "9.7.1",
"@polkadot/util": "10.1.11",
"@polkadot/api": "9.11.1",
"@polkadot/util": "10.2.3",
"@terra-money/terra.js": "^3.0.11",
"node-fetch": "2.6.7"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/common-ethereum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"license": "Apache-2.0",
"dependencies": {
"@polkadot/util": "^8",
"@subql/common": "latest",
"@subql/common": "1.5.0",
"@subql/types-ethereum": "workspace:*",
"bn.js": "4.11.6",
"class-transformer": "0.4.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ export class ProjectNetworkDeploymentV1_0_0 {
@Type(() => FileType)
@IsOptional()
chaintypes?: FileType;
@IsOptional()
@IsArray()
bypassBlocks?: (number | string)[];
}

export class ProjectNetworkV1_0_0 extends ProjectNetworkDeploymentV1_0_0 {
Expand Down
2 changes: 0 additions & 2 deletions packages/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ Options:
used
[string] [choices: "fatal", "error", "warn", "info", "debug", "trace",
"silent"]
--migrate Migrate db schema (for management tables only)
[boolean] [default: false]
--timestamp-field Enable/disable created_at and updated_at in schema
[boolean] [default: false]
-d, --network-dictionary Specify the dictionary api for this network [string]
Expand Down
6 changes: 3 additions & 3 deletions packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
"@nestjs/event-emitter": "^1.3.0",
"@nestjs/platform-express": "^8.2.6",
"@nestjs/schedule": "^1.0.2",
"@subql/common": "latest",
"@subql/common": "1.5.0",
"@subql/common-ethereum": "workspace:*",
"@subql/node-core": "1.4.2-0",
"@subql/node-core": "1.7.2-2",
"@subql/types-ethereum": "workspace:*",
"@subql/utils": "latest",
"@subql/utils": "1.3.2-1",
"@subql/x-merkle-mountain-range": "2.0.0-0.1.2",
"@willsoto/nestjs-prometheus": "^4.4.0",
"algosdk": "^1.13.1",
Expand Down
2 changes: 2 additions & 0 deletions packages/node/src/configure/SubqueryProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import { Block } from '@ethersproject/abstract-provider';
import { Injectable } from '@nestjs/common';
import { RegisteredTypes } from '@polkadot/types/types';
import {
ReaderFactory,
Expand Down Expand Up @@ -50,6 +51,7 @@ const NOT_SUPPORT = (name: string) => {
throw new Error(`Manifest specVersion ${name}() is not supported`);
};

@Injectable()
export class SubqueryProject {
id: string;
root: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/node/src/configure/configure.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,11 @@ export class ConfigureModule {
useValue: config,
},
{
provide: SubqueryProject,
provide: 'ISubqueryProject',
useFactory: project,
},
],
exports: [NodeConfig, SubqueryProject],
exports: [NodeConfig, 'ISubqueryProject'],
};
}
}
10 changes: 9 additions & 1 deletion packages/node/src/ethereum/api.service.ethereum.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
// Copyright 2020-2022 OnFinality Limited authors & contributors
// SPDX-License-Identifier: Apache-2.0

import { Injectable } from '@nestjs/common';
import { Inject, Injectable } from '@nestjs/common';
import { EventEmitter2 } from '@nestjs/event-emitter';
import { ProjectNetworkV1_0_0 } from '@subql/common-ethereum';
import { ApiService, getLogger } from '@subql/node-core';
import { SubqueryProject } from '../configure/SubqueryProject';
import { EthereumApi } from './api.ethereum';

const logger = getLogger('api');

@Injectable()
export class EthereumApiService extends ApiService {
constructor(
@Inject('ISubqueryProject') project: SubqueryProject,
private eventEmitter: EventEmitter2,
) {
super(project);
}
private _api: EthereumApi;

async init(): Promise<EthereumApiService> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export type ProcessBlockResponse = {
export interface IBlockDispatcher {
init(onDynamicDsCreated: (height: number) => Promise<void>): Promise<void>;

enqueueBlocks(heights: number[]): void;
enqueueBlocks(heights: number[], latestBufferHeight?: number): void;

queueSize: number;
freeSize: number;
Expand Down Expand Up @@ -125,10 +125,12 @@ export abstract class BaseBlockDispatcher<Q extends IQueue>
this.latestProcessedHeight = reindexBlockHeight;
} else {
if (this.nodeConfig.proofOfIndex && !isNullMerkelRoot(operationHash)) {
if (!this.projectService.blockOffset) {
// We only check if it is undefined, need to be caution here when blockOffset is 0
if (this.projectService.blockOffset === undefined) {
// Which means during project init, it has not found offset and set value
await this.projectService.upsertMetadataBlockOffset(height - 1);
}
// this will return if project service blockOffset already exist
void this.projectService.setBlockOffset(height - 1);
}
if (dynamicDsCreated) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,24 @@ export class BlockDispatcherService
this.processQueue.abort();
}

enqueueBlocks(heights: number[]): void {
if (!heights.length) return;
enqueueBlocks(cleanedBlocks: number[], latestBufferHeight?: number): void {
// // In the case where factors of batchSize is equal to bypassBlock or when cleanedBatchBlocks is []
// // to ensure block is bypassed, latestBufferHeight needs to be manually set
// If cleanedBlocks = []
if (!!latestBufferHeight && !cleanedBlocks.length) {
this.latestBufferedHeight = latestBufferHeight;
return;
}

logger.info(
`Enqueing blocks ${heights[0]}...${last(heights)}, total ${
heights.length
`Enqueueing blocks ${cleanedBlocks[0]}...${last(cleanedBlocks)}, total ${
cleanedBlocks.length
} blocks`,
);

this.queue.putMany(heights);
this.latestBufferedHeight = last(heights);
this.queue.putMany(cleanedBlocks);

this.latestBufferedHeight = latestBufferHeight ?? last(cleanedBlocks);
void this.fetchBlocksFromQueue().catch((e) => {
logger.error(e, 'Failed to fetch blocks from queue');
if (!this.isShutdown) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class WorkerBlockDispatcherService
}
}

enqueueBlocks(heights: number[]): void {
enqueueBlocks(heights: number[], latestBufferHeight?: number): void {
if (!heights.length) return;
logger.info(
`Enqueing blocks [${heights[0]}...${last(heights)}], total ${
Expand Down Expand Up @@ -146,7 +146,7 @@ export class WorkerBlockDispatcherService
);
}

this.latestBufferedHeight = last(heights);
this.latestBufferedHeight = latestBufferHeight ?? last(heights);
}

private enqueueBlock(height: number, workerIdx: number) {
Expand Down Expand Up @@ -204,7 +204,7 @@ export class WorkerBlockDispatcherService
e.handler ? `${e.handler}(${e.stack ?? ''})` : ''
}`,
);
throw e;
process.exit(1);
}
};

Expand Down
9 changes: 6 additions & 3 deletions packages/node/src/indexer/dictionary.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import { gql } from '@apollo/client/core';
import { Injectable, OnApplicationShutdown } from '@nestjs/common';
import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common';
import {
NodeConfig,
DictionaryService as CoreDictionaryService,
Expand All @@ -18,8 +18,11 @@ export class DictionaryService
extends CoreDictionaryService
implements OnApplicationShutdown
{
constructor(protected project: SubqueryProject, nodeConfig: NodeConfig) {
super(project.network.dictionary, nodeConfig);
constructor(
@Inject('ISubqueryProject') protected project: SubqueryProject,
nodeConfig: NodeConfig,
) {
super(project.network.dictionary, project.network.chainId, nodeConfig);
}

async getEvmChainId(): Promise<string> {
Expand Down
4 changes: 2 additions & 2 deletions packages/node/src/indexer/ds-processor.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import fs from 'fs';
import path from 'path';
import { Injectable } from '@nestjs/common';
import { Inject, Injectable } from '@nestjs/common';
import {
EthereumHandlerKind,
isCustomDs,
Expand Down Expand Up @@ -110,7 +110,7 @@ export class DsProcessorService {
[entry: string]: SubqlDatasourceProcessor<string, unknown>;
} = {};
constructor(
private project: SubqueryProject,
@Inject('ISubqueryProject') private readonly project: SubqueryProject,
private readonly nodeConfig: NodeConfig,
) {}

Expand Down
4 changes: 2 additions & 2 deletions packages/node/src/indexer/dynamic-ds.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import assert from 'assert';
import { Injectable } from '@nestjs/common';
import { Inject, Injectable } from '@nestjs/common';
import { isCustomDs, isRuntimeDs } from '@subql/common-ethereum';
import { getLogger, MetadataRepo } from '@subql/node-core';
import { cloneDeep, isEqual, unionWith } from 'lodash';
Expand All @@ -28,7 +28,7 @@ export class DynamicDsService {

constructor(
private readonly dsProcessorService: DsProcessorService,
private readonly project: SubqueryProject,
@Inject('ISubqueryProject') private readonly project: SubqueryProject,
) {}

init(metaDataRepo: MetadataRepo): void {
Expand Down
20 changes: 15 additions & 5 deletions packages/node/src/indexer/fetch.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ import { UnfinalizedBlocksService } from './unfinalizedBlocks.service';
StoreService,
{
provide: ApiService,
useFactory: async (project: SubqueryProject) => {
const apiService = new EthereumApiService(project);

useFactory: async (
project: SubqueryProject,
eventEmitter: EventEmitter2,
) => {
const apiService = new EthereumApiService(project, eventEmitter);
await apiService.init();
return apiService;
},
inject: [SubqueryProject],
inject: ['ISubqueryProject', EventEmitter2],
},
IndexerManager,
{
Expand Down Expand Up @@ -72,7 +74,15 @@ import { UnfinalizedBlocksService } from './unfinalizedBlocks.service';
},
FetchService,
BenchmarkService,
DictionaryService,
{
provide: DictionaryService,
useFactory: async (project: SubqueryProject, nodeConfig: NodeConfig) => {
const dictionaryService = new DictionaryService(project, nodeConfig);
await dictionaryService.init();
return dictionaryService;
},
inject: ['ISubqueryProject', NodeConfig],
},
SandboxService,
DsProcessorService,
DynamicDsService,
Expand Down
Loading

0 comments on commit 8ba66c5

Please sign in to comment.