Skip to content

Commit

Permalink
Merge pull request #34 from subquery/sync-20231113
Browse files Browse the repository at this point in the history
Sync @subql dependencies
  • Loading branch information
jiqiang90 authored Nov 13, 2023
2 parents 88656a0 + 04eebdb commit b964862
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 369 deletions.
4 changes: 4 additions & 0 deletions packages/node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Updates to match changes in `@subql/node-core` (#34)
- Dictionary service to use dictionary registry
- Use yargs from node core

## [3.3.0] - 2023-11-06
### Added
Expand Down
2 changes: 1 addition & 1 deletion packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@nestjs/schedule": "^3.0.1",
"@subql/common": "^3.3.0",
"@subql/common-stellar": "workspace:*",
"@subql/node-core": "^6.3.0",
"@subql/node-core": "^6.4.0",
"@subql/testing": "^2.0.0",
"@subql/types": "^2.2.1-1",
"@subql/types-stellar": "workspace:*",
Expand Down
23 changes: 20 additions & 3 deletions packages/node/src/indexer/dictionary.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors
// SPDX-License-Identifier: GPL-3.0

import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common';
import { Inject, Injectable } from '@nestjs/common';
import { NETWORK_FAMILY } from '@subql/common';
import {
NodeConfig,
DictionaryService as CoreDictionaryService,
Expand All @@ -11,16 +12,32 @@ import { SubqueryProject } from '../configure/SubqueryProject';

@Injectable()
export class DictionaryService extends CoreDictionaryService {
constructor(
private constructor(
@Inject('ISubqueryProject') protected project: SubqueryProject,
eventEmitter: EventEmitter2,
nodeConfig: NodeConfig,
dictionaryUrl?: string,
) {
super(
project.network.dictionary,
dictionaryUrl ?? project.network.dictionary,
project.network.chainId,
nodeConfig,
eventEmitter,
);
}

static async create(
project: SubqueryProject,
nodeConfig: NodeConfig,
eventEmitter: EventEmitter2,
): Promise<DictionaryService> {
const url =
project.network.dictionary ??
(await CoreDictionaryService.resolveDictionary(
NETWORK_FAMILY.stellar,
project.network.chainId,
nodeConfig.dictionaryRegistry,
));
return new DictionaryService(project, eventEmitter, nodeConfig, url);
}
}
17 changes: 16 additions & 1 deletion packages/node/src/indexer/fetch.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,22 @@ import { UnfinalizedBlocksService } from './unfinalizedBlocks.service';
FetchService,
IndexingBenchmarkService,
PoiBenchmarkService,
DictionaryService,
{
provide: DictionaryService,
useFactory: async (
project: SubqueryProject,
nodeConfig: NodeConfig,
eventEmitter: EventEmitter2,
) => {
const dictionaryService = await DictionaryService.create(
project,
nodeConfig,
eventEmitter,
);
return dictionaryService;
},
inject: ['ISubqueryProject', NodeConfig, EventEmitter2],
},
SandboxService,
DsProcessorService,
DynamicDsService,
Expand Down
Loading

0 comments on commit b964862

Please sign in to comment.