From ff90b5ee7d7e0f6d90cd12f7667a2734cb273276 Mon Sep 17 00:00:00 2001 From: jiqiang90 Date: Mon, 13 Nov 2023 01:45:27 +0000 Subject: [PATCH 1/2] Update @subql deps --- packages/node/package.json | 2 +- yarn.lock | 144 +++++++++++++++++++------------------ 2 files changed, 74 insertions(+), 72 deletions(-) diff --git a/packages/node/package.json b/packages/node/package.json index b2e47d9d..2ffdf917 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -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:*", diff --git a/yarn.lock b/yarn.lock index 56e03155..c621fd2c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2622,6 +2622,15 @@ __metadata: languageName: node linkType: hard +"@noble/curves@npm:^1.2.0": + version: 1.2.0 + resolution: "@noble/curves@npm:1.2.0" + dependencies: + "@noble/hashes": 1.3.2 + checksum: bb798d7a66d8e43789e93bc3c2ddff91a1e19fdb79a99b86cd98f1e5eff0ee2024a2672902c2576ef3577b6f282f3b5c778bebd55761ddbb30e36bf275e83dd0 + languageName: node + linkType: hard + "@noble/hashes@npm:1.3.1": version: 1.3.1 resolution: "@noble/hashes@npm:1.3.1" @@ -2629,7 +2638,7 @@ __metadata: languageName: node linkType: hard -"@noble/hashes@npm:~1.3.0, @noble/hashes@npm:~1.3.1": +"@noble/hashes@npm:1.3.2, @noble/hashes@npm:^1.3.2, @noble/hashes@npm:~1.3.0, @noble/hashes@npm:~1.3.1": version: 1.3.2 resolution: "@noble/hashes@npm:1.3.2" checksum: fe23536b436539d13f90e4b9be843cc63b1b17666a07634a2b1259dded6f490be3d050249e6af98076ea8f2ea0d56f578773c2197f2aa0eeaa5fba5bc18ba474 @@ -2802,49 +2811,49 @@ __metadata: languageName: node linkType: hard -"@polkadot/networks@npm:12.4.2": - version: 12.4.2 - resolution: "@polkadot/networks@npm:12.4.2" +"@polkadot/networks@npm:12.5.1": + version: 12.5.1 + resolution: "@polkadot/networks@npm:12.5.1" dependencies: - "@polkadot/util": 12.4.2 + "@polkadot/util": 12.5.1 "@substrate/ss58-registry": ^1.43.0 tslib: ^2.6.2 - checksum: 43a98414d9a540d3358b5ce69908bce4d07f32592edd52eef66c705705e4571aa55fff8442b7287986b052d328af3af08170c3a70848ebf1e9128a3f27c2571f + checksum: f8c64684f6806365c1aded6ebca52432050cc8caacd067faf339b2f37497b63b13cebb689f7b0f9c62a890566383cf1931552da82815cc52baa2166fb1772a43 languageName: node linkType: hard -"@polkadot/util-crypto@npm:^12.2.1": - version: 12.4.2 - resolution: "@polkadot/util-crypto@npm:12.4.2" +"@polkadot/util-crypto@npm:^12.5.1": + version: 12.5.1 + resolution: "@polkadot/util-crypto@npm:12.5.1" dependencies: - "@noble/curves": 1.1.0 - "@noble/hashes": 1.3.1 - "@polkadot/networks": 12.4.2 - "@polkadot/util": 12.4.2 + "@noble/curves": ^1.2.0 + "@noble/hashes": ^1.3.2 + "@polkadot/networks": 12.5.1 + "@polkadot/util": 12.5.1 "@polkadot/wasm-crypto": ^7.2.2 "@polkadot/wasm-util": ^7.2.2 - "@polkadot/x-bigint": 12.4.2 - "@polkadot/x-randomvalues": 12.4.2 - "@scure/base": 1.1.1 + "@polkadot/x-bigint": 12.5.1 + "@polkadot/x-randomvalues": 12.5.1 + "@scure/base": ^1.1.3 tslib: ^2.6.2 peerDependencies: - "@polkadot/util": 12.4.2 - checksum: fbb2ba94d5369db98e19e94aa6c21d17af4018c65a670d49c6fa1d0ef1e8ee7f5cf76267c072400e16b9c8251a78031f2b25e86808ef6b0a4f028b0c1d6a02ee + "@polkadot/util": 12.5.1 + checksum: 4efb5ca6e48f7457d8dcfa02ac9f581ce23a90ba9e72c8f6fd7649296e92dcb3dfa3d2bdd0b5ed68b81bf15e32aabef34f60d47851249d8859dba7ebeb63501f languageName: node linkType: hard -"@polkadot/util@npm:12.4.2, @polkadot/util@npm:^12.2.1": - version: 12.4.2 - resolution: "@polkadot/util@npm:12.4.2" +"@polkadot/util@npm:12.5.1, @polkadot/util@npm:^12.5.1": + version: 12.5.1 + resolution: "@polkadot/util@npm:12.5.1" dependencies: - "@polkadot/x-bigint": 12.4.2 - "@polkadot/x-global": 12.4.2 - "@polkadot/x-textdecoder": 12.4.2 - "@polkadot/x-textencoder": 12.4.2 + "@polkadot/x-bigint": 12.5.1 + "@polkadot/x-global": 12.5.1 + "@polkadot/x-textdecoder": 12.5.1 + "@polkadot/x-textencoder": 12.5.1 "@types/bn.js": ^5.1.1 bn.js: ^5.2.1 tslib: ^2.6.2 - checksum: 0814f02b4f78a07bf67f53616114dfd99a89c9fdad4b39645784caee86d100a5ce1705ef3947ef9f41673125988faad0dc3d8fa8fceef34ec71af3834290580d + checksum: 955d41c01cb3c7da72c4f5f8faed13e1af1fa9603a3a1dd9f282eb69b5ebbffb889e76c595d1252ff5f9665cb3c55f1a96f908b020dc79356f92b2d5ce1aa81e languageName: node linkType: hard @@ -2928,55 +2937,55 @@ __metadata: languageName: node linkType: hard -"@polkadot/x-bigint@npm:12.4.2": - version: 12.4.2 - resolution: "@polkadot/x-bigint@npm:12.4.2" +"@polkadot/x-bigint@npm:12.5.1": + version: 12.5.1 + resolution: "@polkadot/x-bigint@npm:12.5.1" dependencies: - "@polkadot/x-global": 12.4.2 + "@polkadot/x-global": 12.5.1 tslib: ^2.6.2 - checksum: 91f38cd7ff4b22dd24d470f26817032ef26edac1591f7bf8c1ff648ab26cd05a968d1f17fe9aba523858af7dba6d40c2f8145a2a2bc33fbb722358bec1ab0a2b + checksum: 295d00b17860196c43ac4957ffb052ca68bb4319990876238e3f0925ca6ca9106810204136315491116a11a277d8a1e1fae65cc43a168505ee5a69a27404d2e0 languageName: node linkType: hard -"@polkadot/x-global@npm:12.4.2": - version: 12.4.2 - resolution: "@polkadot/x-global@npm:12.4.2" +"@polkadot/x-global@npm:12.5.1": + version: 12.5.1 + resolution: "@polkadot/x-global@npm:12.5.1" dependencies: tslib: ^2.6.2 - checksum: 1489013e6ae3dce3c9f31f38f4ef8ca0956a18d35d12354c49cb7b256fef6dcbd3285a0c223509c8ed826b9d85fd8f59708312a010f1b69d5ee92963e38c48ac + checksum: d45e3d6096674b7495992c6e45cf1a284db545c16107ba9adae241d6aefe13c27adfaf93d58a3079e6a6b63acb221eb3181c7f55dc34124b24b542154724c506 languageName: node linkType: hard -"@polkadot/x-randomvalues@npm:12.4.2": - version: 12.4.2 - resolution: "@polkadot/x-randomvalues@npm:12.4.2" +"@polkadot/x-randomvalues@npm:12.5.1": + version: 12.5.1 + resolution: "@polkadot/x-randomvalues@npm:12.5.1" dependencies: - "@polkadot/x-global": 12.4.2 + "@polkadot/x-global": 12.5.1 tslib: ^2.6.2 peerDependencies: - "@polkadot/util": 12.4.2 + "@polkadot/util": 12.5.1 "@polkadot/wasm-util": "*" - checksum: 630d6c7c5af493c5d72ebc6262939c0de8cbc252f93b8d4224a9c7006ae2c641a2ad4eeee4f5ba7140609bbc4aaa2841ef29f86e680dfd512a5f68bc616016f4 + checksum: 52ee4b4206a98cac9e97e3d194db01fb4a540046672784442926478eaa2b2a74cebae59d10432671f544d72df5d623aedf57c301bcf447a4c72688ec3cb82fd5 languageName: node linkType: hard -"@polkadot/x-textdecoder@npm:12.4.2": - version: 12.4.2 - resolution: "@polkadot/x-textdecoder@npm:12.4.2" +"@polkadot/x-textdecoder@npm:12.5.1": + version: 12.5.1 + resolution: "@polkadot/x-textdecoder@npm:12.5.1" dependencies: - "@polkadot/x-global": 12.4.2 + "@polkadot/x-global": 12.5.1 tslib: ^2.6.2 - checksum: e9fe88b35cf355a8ddba3c60f2eeb58a60c58737c6f7272e392cda8d68fa57e508ad293a7551f86d926209acd1fe4e3a73f9d1b4b700dcfb061932fc007db205 + checksum: 202a9e216e9b89cc74012fa3f6c96eeb368dc3e6fa3c943f28c37c20941a6c678506cbc136946e9ff100123aa43846eab7765af074de94dfdd23f4ce2242c794 languageName: node linkType: hard -"@polkadot/x-textencoder@npm:12.4.2": - version: 12.4.2 - resolution: "@polkadot/x-textencoder@npm:12.4.2" +"@polkadot/x-textencoder@npm:12.5.1": + version: 12.5.1 + resolution: "@polkadot/x-textencoder@npm:12.5.1" dependencies: - "@polkadot/x-global": 12.4.2 + "@polkadot/x-global": 12.5.1 tslib: ^2.6.2 - checksum: c6599caa628ac78fd49f21618ad2863fdcae73d31cc98ebc67929f1c7083e6ba5188c48d3ea8604ef57e9f45ce46f4c4c63b1571ed0058f3d78aa30f31075498 + checksum: 7a8d99d203cbd9537e55405d737667ae8cd9ad40a9e3de52f2ef7580a23d27ebf7f7c52da4e0eca6ca34dc97aae33a97bab36afb54aaa7714f54a31931f94113 languageName: node linkType: hard @@ -3053,14 +3062,7 @@ __metadata: languageName: node linkType: hard -"@scure/base@npm:1.1.1": - version: 1.1.1 - resolution: "@scure/base@npm:1.1.1" - checksum: b4fc810b492693e7e8d0107313ac74c3646970c198bbe26d7332820886fa4f09441991023ec9aa3a2a51246b74409ab5ebae2e8ef148bbc253da79ac49130309 - languageName: node - linkType: hard - -"@scure/base@npm:~1.1.0": +"@scure/base@npm:^1.1.3, @scure/base@npm:~1.1.0": version: 1.1.3 resolution: "@scure/base@npm:1.1.3" checksum: 1606ab8a4db898cb3a1ada16c15437c3bce4e25854fadc8eb03ae93cbbbac1ed90655af4b0be3da37e12056fef11c0374499f69b9e658c9e5b7b3e06353c630c @@ -3175,9 +3177,9 @@ __metadata: languageName: node linkType: hard -"@subql/node-core@npm:^6.3.0": - version: 6.3.0 - resolution: "@subql/node-core@npm:6.3.0" +"@subql/node-core@npm:^6.4.0": + version: 6.4.0 + resolution: "@subql/node-core@npm:6.4.0" dependencies: "@apollo/client": ^3.7.16 "@nestjs/common": ^9.4.0 @@ -3187,7 +3189,7 @@ __metadata: "@subql/common": 3.3.0 "@subql/testing": 2.1.0 "@subql/types": 3.3.0 - "@subql/utils": 2.5.0 + "@subql/utils": 2.6.0 "@subql/x-sequelize": 6.32.0-0.0.2 "@willsoto/nestjs-prometheus": ^5.4.0 async-lock: ^1.4.0 @@ -3202,7 +3204,7 @@ __metadata: tar: ^6.1.11 vm2: ^3.9.19 yargs: ^16.2.0 - checksum: a0961eb85a5bfb5ff521658563ef78e2db55969857295f4108a937377fbf81bb02567d8353be24b880e38e9b6c14d91ebad468fe555346faae7d8a0a5ae69f79 + checksum: 29208b471b1c41750905b5056fbaab16c88f5448ca4d525ccdc5156b513fe66debf9424519dbbf277ce47fe25e0cdde6186c12fdec233a8aedc1b269b56f8fde languageName: node linkType: hard @@ -3220,7 +3222,7 @@ __metadata: "@nestjs/testing": ^9.4.0 "@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:*" @@ -3326,12 +3328,12 @@ __metadata: languageName: node linkType: hard -"@subql/utils@npm:2.5.0": - version: 2.5.0 - resolution: "@subql/utils@npm:2.5.0" +"@subql/utils@npm:2.6.0": + version: 2.6.0 + resolution: "@subql/utils@npm:2.6.0" dependencies: - "@polkadot/util": ^12.2.1 - "@polkadot/util-crypto": ^12.2.1 + "@polkadot/util": ^12.5.1 + "@polkadot/util-crypto": ^12.5.1 "@subql/x-sequelize": 6.32.0-0.0.2 ansi-styles: ^6.1.0 axios: ^0.27.1 @@ -3345,7 +3347,7 @@ __metadata: rotating-file-stream: ^3.0.2 semver: ^7.5.2 tar: ^6.1.11 - checksum: 27d958f916f519aba9257d5bb4d310f0bb08d628098643c417342fbf864e6138de28d7fd0c8a3b3177f93668544b0655a6b483c9b1fe5fabbd8b08babc2ea36a + checksum: 284b125beb62976bd6c5f49a82d8bd3da96f928bfbfde72f42773b62440c6b9ef1a68dfbae85cff7aee40f5f349ebb1a91f41a314cbfd2b98c905496543a1323 languageName: node linkType: hard From 04eebdbac80921030aca407a91a18311fa798198 Mon Sep 17 00:00:00 2001 From: JQQQ Date: Mon, 13 Nov 2023 15:11:36 +1300 Subject: [PATCH 2/2] Sync node core changes --- packages/node/CHANGELOG.md | 4 + .../node/src/indexer/dictionary.service.ts | 23 +- packages/node/src/indexer/fetch.module.ts | 17 +- packages/node/src/yargs.ts | 316 ++---------------- 4 files changed, 63 insertions(+), 297 deletions(-) diff --git a/packages/node/CHANGELOG.md b/packages/node/CHANGELOG.md index ed356d0b..c14455e2 100644 --- a/packages/node/CHANGELOG.md +++ b/packages/node/CHANGELOG.md @@ -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 diff --git a/packages/node/src/indexer/dictionary.service.ts b/packages/node/src/indexer/dictionary.service.ts index 8cd7d850..dee42478 100644 --- a/packages/node/src/indexer/dictionary.service.ts +++ b/packages/node/src/indexer/dictionary.service.ts @@ -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, @@ -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 { + const url = + project.network.dictionary ?? + (await CoreDictionaryService.resolveDictionary( + NETWORK_FAMILY.stellar, + project.network.chainId, + nodeConfig.dictionaryRegistry, + )); + return new DictionaryService(project, eventEmitter, nodeConfig, url); + } } diff --git a/packages/node/src/indexer/fetch.module.ts b/packages/node/src/indexer/fetch.module.ts index efca75a0..61872adb 100644 --- a/packages/node/src/indexer/fetch.module.ts +++ b/packages/node/src/indexer/fetch.module.ts @@ -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, diff --git a/packages/node/src/yargs.ts b/packages/node/src/yargs.ts index cb8647d5..25681615 100644 --- a/packages/node/src/yargs.ts +++ b/packages/node/src/yargs.ts @@ -1,303 +1,33 @@ // Copyright 2020-2023 SubQuery Pte Ltd authors & contributors // SPDX-License-Identifier: GPL-3.0 -import { initLogger } from '@subql/node-core/logger'; -import { hideBin } from 'yargs/helpers'; -import yargs from 'yargs/yargs'; +import { yargsBuilder } from '@subql/node-core/yargs'; -export const yargsOptions = yargs(hideBin(process.argv)) - .env('SUBQL_NODE') - .command({ - command: 'test', - describe: 'Run tests for a SubQuery application', - builder: {}, - handler: (argv) => { - initLogger( - argv.debug as string, - argv.outputFmt as 'json' | 'colored', - argv.logLevel as string | undefined, - ); - // lazy import to make sure logger is instantiated before all other services - // eslint-disable-next-line @typescript-eslint/no-var-requires - const { testingInit } = require('./subcommands/testing.init'); - return testingInit(); - }, - }) - .command({ - command: 'force-clean', - describe: - 'Clean the database dropping project schemas and tables. Once the command is executed, the application would exit upon completion.', - builder: {}, - handler: (argv) => { - initLogger( - argv.debug as string, - argv.outputFmt as 'json' | 'colored', - argv.logLevel as string | undefined, - ); +export const yargsOptions = yargsBuilder({ + initTesting: () => { + // lazy import to make sure logger is instantiated before all other services + // eslint-disable-next-line @typescript-eslint/no-var-requires + const { testingInit } = require('./subcommands/testing.init'); + return testingInit(); + }, + initForceClean: () => { + // lazy import to make sure logger is instantiated before all other services + // eslint-disable-next-line @typescript-eslint/no-var-requires + const { forceCleanInit } = require('./subcommands/forceClean.init'); + return forceCleanInit(); + }, + initReindex: (targetHeight: number) => { + // lazy import to make sure logger is instantiated before all other services + // eslint-disable-next-line @typescript-eslint/no-var-requires + const { reindexInit } = require('./subcommands/reindex.init'); + return reindexInit(targetHeight); + }, - // lazy import to make sure logger is instantiated before all other services - // eslint-disable-next-line @typescript-eslint/no-var-requires - const { forceCleanInit } = require('./subcommands/forceClean.init'); - return forceCleanInit(); - }, - }) - .command({ - command: 'reindex', - describe: - 'Reindex to specified block height. Historical must be enabled for the targeted project (--disable-historical=false). Once the command is executed, the application would exit upon completion.', - builder: (yargs) => - yargs.options('targetHeight', { - type: 'number', - description: 'set targetHeight', - require: true, - }), - handler: (argv) => { - initLogger( - argv.debug as string, - argv.outputFmt as 'json' | 'colored', - argv.logLevel as string | undefined, - ); - // lazy import to make sure logger is instantiated before all other services - // eslint-disable-next-line @typescript-eslint/no-var-requires - const { reindexInit } = require('./subcommands/reindex.init'); - return reindexInit(argv.targetHeight); - }, - }) - .options({ - 'batch-size': { - demandOption: false, - describe: 'Batch size of blocks to fetch in one round', - type: 'number', - }, - 'block-confirmations': { - demandOption: false, - default: 20, - describe: - 'The number of blocks behind the head to be considered finalized, this has no effect with Ethereum', - type: 'number', - }, - config: { - alias: 'c', - demandOption: false, - describe: 'Specify configuration file', - type: 'string', - }, - 'db-schema': { - demandOption: false, - describe: 'Db schema name of the project', - type: 'string', - }, - debug: { - demandOption: false, - describe: `Enable debug logging for specific scopes, this will override log-level. "*" will enable debug everywhere, or comma separated strings for specific scopes. e.g. "SQL,dictionary". To disable specific scopes you can prefix them with '-'. e.g. "*,-SQL"`, - type: 'string', - }, - 'dictionary-resolver': { - demandOption: false, - describe: 'Use SubQuery Network dictionary resolver', - type: 'string', - }, - 'dictionary-timeout': { - demandOption: false, - describe: 'Max timeout for dictionary query', - type: 'number', - }, - 'dictionary-query-size': { - demandOption: false, - describe: - 'Dictionary query max block size, this specify the block height range of the dictionary query', - type: 'number', - }, - 'disable-historical': { - demandOption: false, - default: false, - describe: 'Disable storing historical state entities', - type: 'boolean', - }, - ipfs: { - demandOption: false, - describe: 'IPFS gateway endpoint', - type: 'string', - }, - local: { - deprecated: true, - type: 'boolean', - demandOption: false, - describe: 'Use local mode', - }, - 'log-level': { - demandOption: false, - describe: 'Specify log level to print. Ignored when --debug is used', - type: 'string', - choices: ['fatal', 'error', 'warn', 'info', 'debug', 'trace', 'silent'], - }, - 'multi-chain': { - demandOption: false, - default: false, - describe: - 'Enables indexing multiple subquery projects into the same database schema', - type: 'boolean', - }, - 'network-dictionary': { - alias: 'd', - demandOption: false, - describe: 'Specify the dictionary api for this network', - type: 'string', - }, - 'network-endpoint': { - demandOption: false, - type: 'string', - describe: 'Blockchain network endpoint to connect', - }, + rootOptions: { 'soroban-network-endpoint': { demandOption: false, type: 'string', describe: 'Blockchain network endpoint to connect', }, - 'output-fmt': { - demandOption: false, - describe: 'Print log as json or plain text', - type: 'string', - choices: ['json', 'colored'], - }, - port: { - alias: 'p', - demandOption: false, - describe: 'The port the service will bind to', - type: 'number', - }, - profiler: { - demandOption: false, - describe: 'Show profiler information to console output', - type: 'boolean', - default: false, - }, - 'proof-of-index': { - demandOption: false, - describe: 'Enable/disable proof of index', - type: 'boolean', - default: false, - }, - 'query-limit': { - demandOption: false, - describe: - 'The limit of items a project can query with store.getByField at once', - type: 'number', - default: 100, - }, - 'scale-batch-size': { - type: 'boolean', - demandOption: false, - describe: 'scale batch size based on memory usage', - default: false, - }, - 'pg-ca': { - demandOption: false, - describe: - 'Postgres ca certificate - to enable TLS/SSL connections to your PostgreSQL, path to the server certificate file are required, e.g /path/to/server-certificates/root.crt', - type: 'string', - }, - 'pg-key': { - demandOption: false, - describe: - 'Postgres client key - Path to key file e.g /path/to/client-key/postgresql.key', - type: 'string', - }, - 'pg-cert': { - demandOption: false, - describe: - 'Postgres client certificate - Path to client certificate e.g /path/to/client-certificates/postgresql.crt', - type: 'string', - }, - 'store-cache-threshold': { - demandOption: false, - describe: - 'Store cache will flush data to the database when number of records excess this threshold', - type: 'number', - }, - 'store-cache-upper-limit': { - demandOption: false, - describe: - 'Defines the upper limit to the store cache size. When this limit is reached indexing will wait for the cache to be flushed before continuing.', - type: 'number', - }, - 'store-get-cache-size': { - demandOption: false, - describe: 'Store get cache size for each model', - type: 'number', - }, - 'store-cache-async': { - demandOption: false, - describe: - 'If enabled the store cache will flush data asyncronously relative to indexing data', - type: 'boolean', - }, - 'store-flush-interval': { - demandOption: false, - describe: - 'The interval, in seconds, at which data is flushed from the cache. ' + - 'This ensures that data is persisted regularly when there is either not much data or the project is up to date.', - type: 'number', - default: 5, - }, - subquery: { - alias: 'f', - demandOption: true, - default: process.cwd(), - describe: 'Local path or IPFS cid of the subquery project', - type: 'string', - }, - 'subquery-name': { - deprecated: true, - demandOption: false, - describe: 'Name of the subquery project', - type: 'string', - }, - subscription: { - demandOption: false, - describe: 'Enable subscription by create notification triggers', - type: 'boolean', - default: false, - }, - timeout: { - demandOption: false, - describe: 'Timeout for indexer sandbox to execute the mapping functions', - type: 'number', - }, - 'timestamp-field': { - demandOption: false, - describe: 'Enable/disable created_at and updated_at in schema', - type: 'boolean', - default: false, - }, - 'unfinalized-blocks': { - demandOption: false, - default: false, - describe: 'Enable to fetch and index unfinalized blocks', - type: 'boolean', - }, - unsafe: { - type: 'boolean', - demandOption: false, - describe: 'Allows usage of any built-in module within the sandbox', - }, - workers: { - alias: 'w', - demandOption: false, - describe: - 'Number of worker threads to use for fetching and processing blocks. Disabled by default.', - type: 'number', - }, - root: { - describe: - 'This is a hidden flag only used from the main thread to workers. It provides a root directory for the project. This is a temp directory with IPFS and GitHub projects.', - type: 'string', - }, - 'query-address-limit': { - describe: - 'Set the limit for address on dictionary queries for dynamic datasources', - type: 'number', - default: 100, - }, - }) - .hide('root'); // root is hidden because its for internal use + }, +});