@subql/node-ethereum 0.3.1-0 → 0.3.1-1
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/README.md +0 -2
- package/dist/.tsbuildinfo +1 -1
- package/dist/configure/SubqueryProject.js +15 -5
- package/dist/configure/SubqueryProject.js.map +1 -1
- package/dist/configure/configure.module.js +2 -2
- package/dist/configure/configure.module.js.map +1 -1
- package/dist/ethereum/api.service.ethereum.d.ts +4 -0
- package/dist/ethereum/api.service.ethereum.js +16 -1
- package/dist/ethereum/api.service.ethereum.js.map +1 -1
- package/dist/indexer/blockDispatcher/base-block-dispatcher.d.ts +1 -1
- package/dist/indexer/blockDispatcher/base-block-dispatcher.js +3 -1
- package/dist/indexer/blockDispatcher/base-block-dispatcher.js.map +1 -1
- package/dist/indexer/blockDispatcher/block-dispatcher.service.d.ts +1 -1
- package/dist/indexer/blockDispatcher/block-dispatcher.service.js +10 -5
- package/dist/indexer/blockDispatcher/block-dispatcher.service.js.map +1 -1
- package/dist/indexer/blockDispatcher/worker-block-dispatcher.service.d.ts +1 -1
- package/dist/indexer/blockDispatcher/worker-block-dispatcher.service.js +3 -3
- package/dist/indexer/blockDispatcher/worker-block-dispatcher.service.js.map +1 -1
- package/dist/indexer/dictionary.service.js +7 -2
- package/dist/indexer/dictionary.service.js.map +1 -1
- package/dist/indexer/ds-processor.service.d.ts +1 -1
- package/dist/indexer/ds-processor.service.js +4 -0
- package/dist/indexer/ds-processor.service.js.map +1 -1
- package/dist/indexer/dynamic-ds.service.js +4 -0
- package/dist/indexer/dynamic-ds.service.js.map +1 -1
- package/dist/indexer/fetch.module.js +12 -5
- package/dist/indexer/fetch.module.js.map +1 -1
- package/dist/indexer/fetch.service.d.ts +5 -1
- package/dist/indexer/fetch.service.js +71 -22
- package/dist/indexer/fetch.service.js.map +1 -1
- package/dist/indexer/indexer.manager.d.ts +1 -1
- package/dist/indexer/indexer.manager.js +4 -0
- package/dist/indexer/indexer.manager.js.map +1 -1
- package/dist/indexer/indexer.module.js +4 -6
- package/dist/indexer/indexer.module.js.map +1 -1
- package/dist/indexer/project.service.d.ts +1 -1
- package/dist/indexer/project.service.js +22 -6
- package/dist/indexer/project.service.js.map +1 -1
- package/dist/indexer/sandbox.service.js +4 -0
- package/dist/indexer/sandbox.service.js.map +1 -1
- package/dist/indexer/worker/worker.js +1 -1
- package/dist/indexer/worker/worker.js.map +1 -1
- package/dist/subcommands/forceClean.service.d.ts +3 -1
- package/dist/subcommands/forceClean.service.js +26 -6
- package/dist/subcommands/forceClean.service.js.map +1 -1
- package/dist/subcommands/reindex.module.js.map +1 -1
- package/dist/subcommands/reindex.service.js +6 -1
- package/dist/subcommands/reindex.service.js.map +1 -1
- package/dist/utils/project.d.ts +1 -0
- package/dist/utils/project.js +5 -1
- package/dist/utils/project.js.map +1 -1
- package/dist/yargs.d.ts +1 -7
- package/dist/yargs.js +1 -6
- package/dist/yargs.js.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reindex.service.js","sourceRoot":"","sources":["../../src/subcommands/reindex.service.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,sCAAsC
|
|
1
|
+
{"version":3,"file":"reindex.service.js","sourceRoot":"","sources":["../../src/subcommands/reindex.service.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,sCAAsC;;;;;;;;;;;;;;;AAEtC,2CAAoD;AACpD,gDAS0B;AAC1B,yCAAsC;AACtC,kEAA+D;AAC/D,sEAAiE;AACjE,8CAAgD;AAChD,8CAA2C;AAE3C,6DAAyD;AAEzD,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,SAAS,CAAC,CAAC;AAG7B,IAAM,cAAc,GAApB,MAAM,cAAc;IAIzB,YACmB,SAAoB,EACpB,UAAsB,EACtB,YAA0B,EAC1B,UAAsB,EACM,OAAwB,EACpD,iBAAoC,EACpC,gBAAkC;QANlC,cAAS,GAAT,SAAS,CAAW;QACp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A;AAxFY,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAUR,WAAA,IAAA,eAAM,EAAC,kBAAkB,CAAC,CAAA;qCAJC,qBAAS;QACR,sBAAU;QACR,wBAAY;QACd,sBAAU;QACe,iCAAe;QACjC,sCAAiB;QAClB,qCAAgB;GAX1C,cAAc,CAwF1B;AAxFY,wCAAc","sourcesContent":["// Copyright 2020-2022 OnFinality Limited authors & contributors\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Inject, Injectable } from '@nestjs/common';\nimport {\n getLogger,\n MetadataFactory,\n MetadataRepo,\n MmrService,\n NodeConfig,\n StoreService,\n getExistingProjectSchema,\n getMetaDataInfo,\n} from '@subql/node-core';\nimport { Sequelize } from 'sequelize';\nimport { SubqueryProject } from '../configure/SubqueryProject';\nimport { DynamicDsService } from '../indexer/dynamic-ds.service';\nimport { initDbSchema } from '../utils/project';\nimport { reindex } from '../utils/reindex';\n\nimport { ForceCleanService } from './forceClean.service';\n\nconst logger = getLogger('Reindex');\n\n@Injectable()\nexport class ReindexService {\n private schema: string;\n private metadataRepo: MetadataRepo;\n\n constructor(\n private readonly sequelize: Sequelize,\n private readonly nodeConfig: NodeConfig,\n private readonly storeService: StoreService,\n private readonly mmrService: MmrService,\n @Inject('ISubqueryProject') private readonly project: SubqueryProject,\n private readonly forceCleanService: ForceCleanService,\n private readonly dynamicDsService: DynamicDsService,\n ) {}\n\n async init(): Promise<void> {\n this.schema = await this.getExistingProjectSchema();\n\n if (!this.schema) {\n logger.error('Unable to locate schema');\n throw new Error('Schema does not exist.');\n }\n await this.initDbSchema();\n // Should we use an optional arg for multiChain?\n this.metadataRepo = await MetadataFactory(\n this.sequelize,\n this.schema,\n this.nodeConfig.multiChain,\n this.project.network.chainId,\n );\n this.dynamicDsService.init(this.metadataRepo);\n }\n\n private async getExistingProjectSchema(): Promise<string> {\n return getExistingProjectSchema(this.nodeConfig, this.sequelize);\n }\n\n private async getLastProcessedHeight(): Promise<number | undefined> {\n return getMetaDataInfo(this.metadataRepo, 'lastProcessedHeight');\n }\n\n private async getMetadataBlockOffset(): Promise<number | undefined> {\n return getMetaDataInfo(this.metadataRepo, 'blockOffset');\n }\n\n private async getMetadataSpecName(): Promise<string | undefined> {\n const res = await this.metadataRepo.findOne({\n where: { key: 'specName' },\n });\n return res?.value as string | undefined;\n }\n\n private async initDbSchema(): Promise<void> {\n await initDbSchema(this.project, this.schema, this.storeService);\n }\n\n // eslint-disable-next-line @typescript-eslint/require-await\n private async getStartBlockFromDataSources() {\n const datasources = this.project.dataSources;\n\n const startBlocksList = datasources.map((item) => item.startBlock ?? 1);\n if (startBlocksList.length === 0) {\n logger.error(\n `Failed to find a valid datasource, Please check your endpoint if specName filter is used.`,\n );\n process.exit(1);\n } else {\n return Math.min(...startBlocksList);\n }\n }\n\n async reindex(targetBlockHeight: number): Promise<void> {\n const [startHeight, lastProcessedHeight] = await Promise.all([\n this.getStartBlockFromDataSources(),\n this.getLastProcessedHeight(),\n ]);\n\n return reindex(\n startHeight,\n await this.getMetadataBlockOffset(),\n targetBlockHeight,\n lastProcessedHeight,\n this.storeService,\n this.dynamicDsService,\n this.mmrService,\n this.sequelize,\n this.forceCleanService,\n );\n }\n}\n"]}
|
package/dist/utils/project.d.ts
CHANGED
|
@@ -11,4 +11,5 @@ export declare function getChainTypes(reader: Reader, root: string, file: string
|
|
|
11
11
|
export declare function loadDataSourceScript(reader: Reader, file?: string): Promise<string>;
|
|
12
12
|
export declare function getProjectRoot(reader: Reader): Promise<string>;
|
|
13
13
|
export declare function initDbSchema(project: SubqueryProject, schema: string, storeService: StoreService): Promise<void>;
|
|
14
|
+
export declare function initHotSchemaReload(schema: string, storeService: StoreService): Promise<void>;
|
|
14
15
|
export declare function retryOnFailEth<T>(request: () => Promise<T>, errors?: string[]): Promise<T>;
|
package/dist/utils/project.js
CHANGED
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
6
|
};
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.retryOnFailEth = exports.initDbSchema = exports.getProjectRoot = exports.loadDataSourceScript = exports.getChainTypes = exports.updateDataSourcesV0_2_0 = exports.isCustomHandler = exports.isBaseHandler = exports.getProjectEntry = exports.prepareProjectDir = void 0;
|
|
8
|
+
exports.retryOnFailEth = exports.initHotSchemaReload = exports.initDbSchema = exports.getProjectRoot = exports.loadDataSourceScript = exports.getChainTypes = exports.updateDataSourcesV0_2_0 = exports.isCustomHandler = exports.isBaseHandler = exports.getProjectEntry = exports.prepareProjectDir = void 0;
|
|
9
9
|
const fs_1 = __importDefault(require("fs"));
|
|
10
10
|
const os_1 = __importDefault(require("os"));
|
|
11
11
|
const path_1 = __importDefault(require("path"));
|
|
@@ -210,6 +210,10 @@ async function initDbSchema(project, schema, storeService) {
|
|
|
210
210
|
await storeService.init(modelsRelation, schema);
|
|
211
211
|
}
|
|
212
212
|
exports.initDbSchema = initDbSchema;
|
|
213
|
+
async function initHotSchemaReload(schema, storeService) {
|
|
214
|
+
await storeService.initHotSchemaReloadQueries(schema);
|
|
215
|
+
}
|
|
216
|
+
exports.initHotSchemaReload = initHotSchemaReload;
|
|
213
217
|
const handledErrors = ['timeout'];
|
|
214
218
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
215
219
|
async function retryOnFailEth(request, errors = handledErrors) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/utils/project.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,sCAAsC;;;;;;AAEtC,4CAAoB;AACpB,4CAAoB;AACpB,gDAAwB;AACxB,0CAA8E;AAC9E,4DAagC;AAChC,gDAA6D;AAC7D,wCAAuD;AACvD,sDAA2B;AAC3B,8CAAsB;AAGf,KAAK,UAAU,iBAAiB,CAAC,WAAmB;IACzD,MAAM,KAAK,GAAG,YAAE,CAAC,QAAQ,CAAC,W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OAAO,WAAW,EAAE,CAAC;KACtB;AACH,CAAC;AALD,wCAKC;AAEM,KAAK,UAAU,YAAY,CAChC,OAAwB,EACxB,MAAc,EACd,YAA0B;IAE1B,MAAM,cAAc,GAAG,IAAA,+BAAuB,EAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/D,MAAM,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;AAClD,CAAC;AAPD,oCAOC;AAED,MAAM,aAAa,GAAG,CAAC,SAAS,CAAC,CAAC;AAClC,4DAA4D;AACrD,KAAK,UAAU,cAAc,CAClC,OAAyB,EACzB,MAAM,GAAG,aAAa;IAEtB,OAAO,IAAA,uBAAW,EAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAK,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,MAAM,CAAA,CAAC,CAAC,CAAC;AAC5E,CAAC;AALD,wCAKC","sourcesContent":["// Copyright 2020-2022 OnFinality Limited authors & contributors\n// SPDX-License-Identifier: Apache-2.0\n\nimport fs from 'fs';\nimport os from 'os';\nimport path from 'path';\nimport { GithubReader, IPFSReader, LocalReader, Reader } from '@subql/common';\nimport {\n ChainTypes,\n CustomDatasourceV0_2_0,\n isCustomDs,\n loadChainTypes,\n loadChainTypesFromJs,\n parseChainTypes,\n RuntimeDataSourceV0_2_0,\n SubqlRuntimeHandler,\n SubqlCustomHandler,\n SubqlHandler,\n EthereumHandlerKind,\n EthereumDatasourceKind,\n} from '@subql/common-ethereum';\nimport { retryOnFail, StoreService } from '@subql/node-core';\nimport { getAllEntitiesRelations } from '@subql/utils';\nimport yaml from 'js-yaml';\nimport tar from 'tar';\nimport { SubqlProjectDs, SubqueryProject } from '../configure/SubqueryProject';\n\nexport async function prepareProjectDir(projectPath: string): Promise<string> {\n const stats = fs.statSync(projectPath);\n if (stats.isFile()) {\n const sep = path.sep;\n const tmpDir = os.tmpdir();\n const tempPath = fs.mkdtempSync(`${tmpDir}${sep}`);\n // Will promote errors if incorrect format/extension\n await tar.x({ file: projectPath, cwd: tempPath });\n return tempPath.concat('/package');\n } else if (stats.isDirectory()) {\n return projectPath;\n }\n}\n\n// We cache this to avoid repeated reads from fs\nconst projectEntryCache: Record<string, string> = {};\n\nexport function getProjectEntry(root: string): string {\n const pkgPath = path.join(root, 'package.json');\n try {\n if (!projectEntryCache[pkgPath]) {\n const content = fs.readFileSync(pkgPath).toString();\n const pkg = JSON.parse(content);\n if (!pkg.main) {\n return './dist';\n }\n projectEntryCache[pkgPath] = pkg.main.startsWith('./')\n ? pkg.main\n : `./${pkg.main}`;\n }\n\n return projectEntryCache[pkgPath];\n } catch (err) {\n throw new Error(`can not find package.json within directory ${root}`);\n }\n}\n\nexport function isBaseHandler(\n handler: SubqlHandler,\n): handler is SubqlRuntimeHandler {\n return Object.values<string>(EthereumHandlerKind).includes(handler.kind);\n}\n\nexport function isCustomHandler(\n handler: SubqlHandler,\n): handler is SubqlCustomHandler {\n return !isBaseHandler(handler);\n}\n\nexport async function updateDataSourcesV0_2_0(\n _dataSources: (RuntimeDataSourceV0_2_0 | CustomDatasourceV0_2_0)[],\n reader: Reader,\n root: string,\n): Promise<SubqlProjectDs[]> {\n // force convert to updated ds\n return Promise.all(\n _dataSources.map(async (dataSource) => {\n if (dataSource.kind === 'flare/Runtime') {\n dataSource.kind = EthereumDatasourceKind.Runtime;\n }\n dataSource.mapping.handlers = dataSource.mapping.handlers.map(\n (handler) => {\n switch (handler.kind) {\n case 'flare/BlockHandler': {\n handler.kind = EthereumHandlerKind.Block;\n break;\n }\n case 'flare/TransactionHandler': {\n handler.kind = EthereumHandlerKind.Call;\n break;\n }\n case 'flare/LogHandler': {\n handler.kind = EthereumHandlerKind.Event;\n break;\n }\n default:\n }\n\n return handler;\n },\n );\n\n const entryScript = await loadDataSourceScript(\n reader,\n dataSource.mapping.file,\n );\n const file = await updateDataSourcesEntry(\n reader,\n dataSource.mapping.file,\n root,\n entryScript,\n );\n if (dataSource.assets) {\n for (const [, asset] of Object.entries(dataSource.assets)) {\n if (reader instanceof LocalReader) {\n asset.file = path.resolve(root, asset.file);\n } else {\n const res = await reader.getFile(asset.file);\n const outputPath = path.resolve(\n root,\n asset.file.replace('ipfs://', ''),\n );\n await fs.promises.writeFile(outputPath, res as string);\n asset.file = outputPath;\n }\n }\n }\n if (isCustomDs(dataSource)) {\n if (dataSource.processor) {\n dataSource.processor.file = await updateProcessor(\n reader,\n root,\n dataSource.processor.file,\n );\n }\n if (dataSource.assets) {\n for (const [, asset] of dataSource.assets) {\n if (reader instanceof LocalReader) {\n asset.file = path.resolve(root, asset.file);\n } else {\n const res = await reader.getFile(asset.file);\n const outputPath = path.resolve(\n root,\n asset.file.replace('ipfs://', ''),\n );\n await fs.promises.writeFile(outputPath, res as string);\n asset.file = outputPath;\n }\n }\n }\n return {\n ...dataSource,\n mapping: { ...dataSource.mapping, entryScript, file },\n };\n } else {\n return {\n ...dataSource,\n mapping: { ...dataSource.mapping, entryScript, file },\n };\n }\n }),\n );\n}\n\nasync function updateDataSourcesEntry(\n reader: Reader,\n file: string,\n root: string,\n script: string,\n): Promise<string> {\n if (reader instanceof LocalReader) return file;\n else if (reader instanceof IPFSReader || reader instanceof GithubReader) {\n const outputPath = `${path.resolve(root, file.replace('ipfs://', ''))}.js`;\n await fs.promises.writeFile(outputPath, script);\n return outputPath;\n }\n}\n\nasync function updateProcessor(\n reader: Reader,\n root: string,\n file: string,\n): Promise<string> {\n if (reader instanceof LocalReader) {\n return path.resolve(root, file);\n } else {\n const res = await reader.getFile(file);\n const outputPath = `${path.resolve(root, file.replace('ipfs://', ''))}.js`;\n await fs.promises.writeFile(outputPath, res);\n return outputPath;\n }\n}\n\nexport async function getChainTypes(\n reader: Reader,\n root: string,\n file: string,\n): Promise<ChainTypes> {\n // If the project is load from local, we will direct load them\n if (reader instanceof LocalReader) {\n return loadChainTypes(file, root);\n } else {\n // If it is stored in ipfs or other resources, we will use the corresponding reader to read the file\n // Because ipfs not provide extension of the file, it is difficult to determine its format\n // We will use yaml.load to try to load the script and parse them to supported chain types\n // if it failed, we will give it another another attempt, and assume the script written in js\n // we will download it to a temp folder, and load them within sandbox\n const res = await reader.getFile(file);\n let raw: unknown;\n try {\n raw = yaml.load(res);\n return parseChainTypes(raw);\n } catch (e) {\n const chainTypesPath = `${path.resolve(\n root,\n file.replace('ipfs://', ''),\n )}.js`;\n await fs.promises.writeFile(chainTypesPath, res);\n raw = loadChainTypesFromJs(chainTypesPath); //root not required, as it been packed in single js\n return parseChainTypes(raw);\n }\n }\n}\n\nexport async function loadDataSourceScript(\n reader: Reader,\n file?: string,\n): Promise<string> {\n let entry: string;\n //For RuntimeDataSourceV0_0_1\n if (!file) {\n const pkg = await reader.getPkg();\n if (pkg === undefined) throw new Error('Project package.json is not found');\n if (pkg.main) {\n entry = pkg.main.startsWith('./') ? pkg.main : `./${pkg.main}`;\n } else {\n entry = './dist';\n }\n }\n //Else get file\n const entryScript = await reader.getFile(file ? file : entry);\n if (entryScript === undefined) {\n throw new Error(`Entry file ${entry} for datasource not exist`);\n }\n return entryScript;\n}\n\nasync function makeTempDir(): Promise<string> {\n const sep = path.sep;\n const tmpDir = os.tmpdir();\n return fs.promises.mkdtemp(`${tmpDir}${sep}`);\n}\n\nexport async function getProjectRoot(reader: Reader): Promise<string> {\n if (reader instanceof LocalReader) return reader.root;\n if (reader instanceof IPFSReader || reader instanceof GithubReader) {\n return makeTempDir();\n }\n}\n\nexport async function initDbSchema(\n project: SubqueryProject,\n schema: string,\n storeService: StoreService,\n): Promise<void> {\n const modelsRelation = getAllEntitiesRelations(project.schema);\n await storeService.init(modelsRelation, schema);\n}\n\nconst handledErrors = ['timeout'];\n// eslint-disable-next-line @typescript-eslint/require-await\nexport async function retryOnFailEth<T>(\n request: () => Promise<T>,\n errors = handledErrors,\n): Promise<T> {\n return retryOnFail(request, (e) => !!errors.find((t) =>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AI,CAAC,GAAG,CAAC;IACrB,MAAM,MAAM,GAAG,YAAE,CAAC,MAAM,EAAE,CAAC;IAC3B,OAAO,YAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,MAAM,GAAG,GAAG,EAAE,CAAC,CAAC;AAChD,CAAC;AAEM,KAAK,UAAU,cAAc,CAAC,MAAc;IACjD,IAAI,MAAM,YAAY,oBAAW;QAAE,OAAO,MAAM,CAAC,IAAI,CAAC;IACtD,IAAI,MAAM,YAAY,mBAAU,IAAI,MAAM,YAAY,qBAAY,EAAE;QAClE,OAAO,WAAW,EAAE,CAAC;KACtB;AACH,CAAC;AALD,wCAKC;AAEM,KAAK,UAAU,YAAY,CAChC,OAAwB,EACxB,MAAc,EACd,YAA0B;IAE1B,MAAM,cAAc,GAAG,IAAA,+BAAuB,EAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/D,MAAM,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;AAClD,CAAC;AAPD,oCAOC;AAEM,KAAK,UAAU,mBAAmB,CACvC,MAAc,EACd,YAA0B;IAE1B,MAAM,YAAY,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC;AACxD,CAAC;AALD,kDAKC;AAED,MAAM,aAAa,GAAG,CAAC,SAAS,CAAC,CAAC;AAClC,4DAA4D;AACrD,KAAK,UAAU,cAAc,CAClC,OAAyB,EACzB,MAAM,GAAG,aAAa;IAEtB,OAAO,IAAA,uBAAW,EAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAK,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,MAAM,CAAA,CAAC,CAAC,CAAC;AAC5E,CAAC;AALD,wCAKC","sourcesContent":["// Copyright 2020-2022 OnFinality Limited authors & contributors\n// SPDX-License-Identifier: Apache-2.0\n\nimport fs from 'fs';\nimport os from 'os';\nimport path from 'path';\nimport { GithubReader, IPFSReader, LocalReader, Reader } from '@subql/common';\nimport {\n ChainTypes,\n CustomDatasourceV0_2_0,\n isCustomDs,\n loadChainTypes,\n loadChainTypesFromJs,\n parseChainTypes,\n RuntimeDataSourceV0_2_0,\n SubqlRuntimeHandler,\n SubqlCustomHandler,\n SubqlHandler,\n EthereumHandlerKind,\n EthereumDatasourceKind,\n} from '@subql/common-ethereum';\nimport { retryOnFail, StoreService } from '@subql/node-core';\nimport { getAllEntitiesRelations } from '@subql/utils';\nimport yaml from 'js-yaml';\nimport tar from 'tar';\nimport { SubqlProjectDs, SubqueryProject } from '../configure/SubqueryProject';\n\nexport async function prepareProjectDir(projectPath: string): Promise<string> {\n const stats = fs.statSync(projectPath);\n if (stats.isFile()) {\n const sep = path.sep;\n const tmpDir = os.tmpdir();\n const tempPath = fs.mkdtempSync(`${tmpDir}${sep}`);\n // Will promote errors if incorrect format/extension\n await tar.x({ file: projectPath, cwd: tempPath });\n return tempPath.concat('/package');\n } else if (stats.isDirectory()) {\n return projectPath;\n }\n}\n\n// We cache this to avoid repeated reads from fs\nconst projectEntryCache: Record<string, string> = {};\n\nexport function getProjectEntry(root: string): string {\n const pkgPath = path.join(root, 'package.json');\n try {\n if (!projectEntryCache[pkgPath]) {\n const content = fs.readFileSync(pkgPath).toString();\n const pkg = JSON.parse(content);\n if (!pkg.main) {\n return './dist';\n }\n projectEntryCache[pkgPath] = pkg.main.startsWith('./')\n ? pkg.main\n : `./${pkg.main}`;\n }\n\n return projectEntryCache[pkgPath];\n } catch (err) {\n throw new Error(`can not find package.json within directory ${root}`);\n }\n}\n\nexport function isBaseHandler(\n handler: SubqlHandler,\n): handler is SubqlRuntimeHandler {\n return Object.values<string>(EthereumHandlerKind).includes(handler.kind);\n}\n\nexport function isCustomHandler(\n handler: SubqlHandler,\n): handler is SubqlCustomHandler {\n return !isBaseHandler(handler);\n}\n\nexport async function updateDataSourcesV0_2_0(\n _dataSources: (RuntimeDataSourceV0_2_0 | CustomDatasourceV0_2_0)[],\n reader: Reader,\n root: string,\n): Promise<SubqlProjectDs[]> {\n // force convert to updated ds\n return Promise.all(\n _dataSources.map(async (dataSource) => {\n if (dataSource.kind === 'flare/Runtime') {\n dataSource.kind = EthereumDatasourceKind.Runtime;\n }\n dataSource.mapping.handlers = dataSource.mapping.handlers.map(\n (handler) => {\n switch (handler.kind) {\n case 'flare/BlockHandler': {\n handler.kind = EthereumHandlerKind.Block;\n break;\n }\n case 'flare/TransactionHandler': {\n handler.kind = EthereumHandlerKind.Call;\n break;\n }\n case 'flare/LogHandler': {\n handler.kind = EthereumHandlerKind.Event;\n break;\n }\n default:\n }\n\n return handler;\n },\n );\n\n const entryScript = await loadDataSourceScript(\n reader,\n dataSource.mapping.file,\n );\n const file = await updateDataSourcesEntry(\n reader,\n dataSource.mapping.file,\n root,\n entryScript,\n );\n if (dataSource.assets) {\n for (const [, asset] of Object.entries(dataSource.assets)) {\n if (reader instanceof LocalReader) {\n asset.file = path.resolve(root, asset.file);\n } else {\n const res = await reader.getFile(asset.file);\n const outputPath = path.resolve(\n root,\n asset.file.replace('ipfs://', ''),\n );\n await fs.promises.writeFile(outputPath, res as string);\n asset.file = outputPath;\n }\n }\n }\n if (isCustomDs(dataSource)) {\n if (dataSource.processor) {\n dataSource.processor.file = await updateProcessor(\n reader,\n root,\n dataSource.processor.file,\n );\n }\n if (dataSource.assets) {\n for (const [, asset] of dataSource.assets) {\n if (reader instanceof LocalReader) {\n asset.file = path.resolve(root, asset.file);\n } else {\n const res = await reader.getFile(asset.file);\n const outputPath = path.resolve(\n root,\n asset.file.replace('ipfs://', ''),\n );\n await fs.promises.writeFile(outputPath, res as string);\n asset.file = outputPath;\n }\n }\n }\n return {\n ...dataSource,\n mapping: { ...dataSource.mapping, entryScript, file },\n };\n } else {\n return {\n ...dataSource,\n mapping: { ...dataSource.mapping, entryScript, file },\n };\n }\n }),\n );\n}\n\nasync function updateDataSourcesEntry(\n reader: Reader,\n file: string,\n root: string,\n script: string,\n): Promise<string> {\n if (reader instanceof LocalReader) return file;\n else if (reader instanceof IPFSReader || reader instanceof GithubReader) {\n const outputPath = `${path.resolve(root, file.replace('ipfs://', ''))}.js`;\n await fs.promises.writeFile(outputPath, script);\n return outputPath;\n }\n}\n\nasync function updateProcessor(\n reader: Reader,\n root: string,\n file: string,\n): Promise<string> {\n if (reader instanceof LocalReader) {\n return path.resolve(root, file);\n } else {\n const res = await reader.getFile(file);\n const outputPath = `${path.resolve(root, file.replace('ipfs://', ''))}.js`;\n await fs.promises.writeFile(outputPath, res);\n return outputPath;\n }\n}\n\nexport async function getChainTypes(\n reader: Reader,\n root: string,\n file: string,\n): Promise<ChainTypes> {\n // If the project is load from local, we will direct load them\n if (reader instanceof LocalReader) {\n return loadChainTypes(file, root);\n } else {\n // If it is stored in ipfs or other resources, we will use the corresponding reader to read the file\n // Because ipfs not provide extension of the file, it is difficult to determine its format\n // We will use yaml.load to try to load the script and parse them to supported chain types\n // if it failed, we will give it another another attempt, and assume the script written in js\n // we will download it to a temp folder, and load them within sandbox\n const res = await reader.getFile(file);\n let raw: unknown;\n try {\n raw = yaml.load(res);\n return parseChainTypes(raw);\n } catch (e) {\n const chainTypesPath = `${path.resolve(\n root,\n file.replace('ipfs://', ''),\n )}.js`;\n await fs.promises.writeFile(chainTypesPath, res);\n raw = loadChainTypesFromJs(chainTypesPath); //root not required, as it been packed in single js\n return parseChainTypes(raw);\n }\n }\n}\n\nexport async function loadDataSourceScript(\n reader: Reader,\n file?: string,\n): Promise<string> {\n let entry: string;\n //For RuntimeDataSourceV0_0_1\n if (!file) {\n const pkg = await reader.getPkg();\n if (pkg === undefined) throw new Error('Project package.json is not found');\n if (pkg.main) {\n entry = pkg.main.startsWith('./') ? pkg.main : `./${pkg.main}`;\n } else {\n entry = './dist';\n }\n }\n //Else get file\n const entryScript = await reader.getFile(file ? file : entry);\n if (entryScript === undefined) {\n throw new Error(`Entry file ${entry} for datasource not exist`);\n }\n return entryScript;\n}\n\nasync function makeTempDir(): Promise<string> {\n const sep = path.sep;\n const tmpDir = os.tmpdir();\n return fs.promises.mkdtemp(`${tmpDir}${sep}`);\n}\n\nexport async function getProjectRoot(reader: Reader): Promise<string> {\n if (reader instanceof LocalReader) return reader.root;\n if (reader instanceof IPFSReader || reader instanceof GithubReader) {\n return makeTempDir();\n }\n}\n\nexport async function initDbSchema(\n project: SubqueryProject,\n schema: string,\n storeService: StoreService,\n): Promise<void> {\n const modelsRelation = getAllEntitiesRelations(project.schema);\n await storeService.init(modelsRelation, schema);\n}\n\nexport async function initHotSchemaReload(\n schema: string,\n storeService: StoreService,\n): Promise<void> {\n await storeService.initHotSchemaReloadQueries(schema);\n}\n\nconst handledErrors = ['timeout'];\n// eslint-disable-next-line @typescript-eslint/require-await\nexport async function retryOnFailEth<T>(\n request: () => Promise<T>,\n errors = handledErrors,\n): Promise<T> {\n return retryOnFail(request, (e) => !!errors.find((t) => t === e?.reason));\n}\n"]}
|
package/dist/yargs.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const yargsOptions: import("yargs").Argv<import("yargs").Omit<{
|
|
2
2
|
targetHeight: number;
|
|
3
|
-
}, "subquery" | "subquery-name" | "config" | "local" | "db-schema" | "unsafe" | "subscription" | "batch-size" | "scale-batch-size" | "timeout" | "debug" | "profiler" | "network-endpoint" | "output-fmt" | "log-level" | "
|
|
3
|
+
}, "subquery" | "subquery-name" | "config" | "local" | "db-schema" | "unsafe" | "subscription" | "batch-size" | "scale-batch-size" | "timeout" | "debug" | "profiler" | "network-endpoint" | "output-fmt" | "log-level" | "timestamp-field" | "network-dictionary" | "dictionary-timeout" | "mmr-path" | "proof-of-index" | "ipfs" | "port" | "disable-historical" | "workers" | "query-limit" | "unfinalized-blocks"> & import("yargs").InferredOptionTypes<{
|
|
4
4
|
subquery: {
|
|
5
5
|
alias: string;
|
|
6
6
|
demandOption: true;
|
|
@@ -87,12 +87,6 @@ export declare const yargsOptions: import("yargs").Argv<import("yargs").Omit<{
|
|
|
87
87
|
type: "string";
|
|
88
88
|
choices: string[];
|
|
89
89
|
};
|
|
90
|
-
migrate: {
|
|
91
|
-
demandOption: false;
|
|
92
|
-
describe: string;
|
|
93
|
-
type: "boolean";
|
|
94
|
-
default: boolean;
|
|
95
|
-
};
|
|
96
90
|
'timestamp-field': {
|
|
97
91
|
demandOption: false;
|
|
98
92
|
describe: string;
|
package/dist/yargs.js
CHANGED
|
@@ -10,6 +10,7 @@ const logger_1 = require("@subql/node-core/logger");
|
|
|
10
10
|
const helpers_1 = require("yargs/helpers");
|
|
11
11
|
const yargs_1 = __importDefault(require("yargs/yargs"));
|
|
12
12
|
exports.yargsOptions = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
|
|
13
|
+
.env('SUBQL_NODE')
|
|
13
14
|
.command({
|
|
14
15
|
command: 'force-clean',
|
|
15
16
|
describe: 'Clean the database dropping project schemas and tables. Once the command is executed, the application would exit upon completion.',
|
|
@@ -125,12 +126,6 @@ exports.yargsOptions = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)
|
|
|
125
126
|
type: 'string',
|
|
126
127
|
choices: ['fatal', 'error', 'warn', 'info', 'debug', 'trace', 'silent'],
|
|
127
128
|
},
|
|
128
|
-
migrate: {
|
|
129
|
-
demandOption: false,
|
|
130
|
-
describe: 'Migrate db schema (for management tables only)',
|
|
131
|
-
type: 'boolean',
|
|
132
|
-
default: false,
|
|
133
|
-
},
|
|
134
129
|
'timestamp-field': {
|
|
135
130
|
demandOption: false,
|
|
136
131
|
describe: 'Enable/disable created_at and updated_at in schema',
|
package/dist/yargs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yargs.js","sourceRoot":"","sources":["../src/yargs.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,sCAAsC;;;;;;AAEtC,oDAAqD;AACrD,2CAAwC;AACxC,wDAAgC;AAEnB,QAAA,YAAY,GAAG,IAAA,eAAK,EAAC,IAAA,iB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AAE;QACJ,KAAK,EAAE,GAAG;QACV,YAAY,EAAE,KAAK;QACnB,QAAQ,EAAE,mCAAmC;QAC7C,IAAI,EAAE,QAAQ;KACf;IACD,oBAAoB,EAAE;QACpB,YAAY,EAAE,KAAK;QACnB,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,2CAA2C;QACrD,IAAI,EAAE,SAAS;KAChB;IACD,OAAO,EAAE;QACP,KAAK,EAAE,GAAG;QACV,YAAY,EAAE,KAAK;QACnB,QAAQ,EACN,0FAA0F;QAC5F,IAAI,EAAE,QAAQ;KACf;IACD,aAAa,EAAE;QACb,YAAY,EAAE,KAAK;QACnB,QAAQ,EACN,sEAAsE;QACxE,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,GAAG;KACb;IACD,oBAAoB,EAAE;QACpB,YAAY,EAAE,KAAK;QACnB,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,8CAA8C;QACxD,IAAI,EAAE,SAAS;KAChB;CACF,CAAC,CAAC","sourcesContent":["// Copyright 2020-2022 OnFinality Limited authors & contributors\n// SPDX-License-Identifier: Apache-2.0\n\nimport { initLogger } from '@subql/node-core/logger';\nimport { hideBin } from 'yargs/helpers';\nimport yargs from 'yargs/yargs';\n\nexport const yargsOptions = yargs(hideBin(process.argv))\n .command({\n command: 'force-clean',\n describe:\n 'Clean the database dropping project schemas and tables. Once the command is executed, the application would exit upon completion.',\n builder: {},\n handler: (argv) => {\n initLogger(\n argv.debug as boolean,\n argv.outputFmt as 'json' | 'colored',\n argv.logLevel as string | undefined,\n );\n\n // lazy import to make sure logger is instantiated before all other services\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { forceCleanInit } = require('./subcommands/forceClean.init');\n return forceCleanInit();\n },\n })\n .command({\n command: 'reindex',\n describe:\n '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.',\n builder: (yargs) =>\n yargs.options('targetHeight', {\n type: 'number',\n description: 'set targetHeight',\n require: true,\n }),\n handler: (argv) => {\n initLogger(\n argv.debug as boolean,\n argv.outputFmt as 'json' | 'colored',\n argv.logLevel as string | undefined,\n );\n // lazy import to make sure logger is instantiated before all other services\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { reindexInit } = require('./subcommands/reindex.init');\n return reindexInit(argv.targetHeight);\n },\n })\n .options({\n subquery: {\n alias: 'f',\n demandOption: true,\n default: process.cwd(),\n describe: 'Local path or IPFS cid of the subquery project',\n type: 'string',\n },\n 'subquery-name': {\n deprecated: true,\n demandOption: false,\n describe: 'Name of the subquery project',\n type: 'string',\n },\n config: {\n alias: 'c',\n demandOption: false,\n describe: 'Specify configuration file',\n type: 'string',\n },\n local: {\n deprecated: true,\n type: 'boolean',\n demandOption: false,\n describe: 'Use local mode',\n },\n 'db-schema': {\n demandOption: false,\n describe: 'Db schema name of the project',\n type: 'string',\n },\n unsafe: {\n type: 'boolean',\n demandOption: false,\n describe: 'Allows usage of any built-in module within the sandbox',\n },\n subscription: {\n demandOption: false,\n describe: 'Enable subscription by create notification triggers',\n type: 'boolean',\n default: false,\n },\n 'batch-size': {\n demandOption: false,\n describe: 'Batch size of blocks to fetch in one round',\n type: 'number',\n },\n 'scale-batch-size': {\n type: 'boolean',\n demandOption: false,\n describe: 'scale batch size based on memory usage',\n default: false,\n },\n timeout: {\n demandOption: false,\n describe: 'Timeout for indexer sandbox to execute the mapping functions',\n type: 'number',\n },\n debug: {\n demandOption: false,\n describe:\n 'Show debug information to console output. will forcefully set log level to debug',\n type: 'boolean',\n default: false,\n },\n profiler: {\n demandOption: false,\n describe: 'Show profiler information to console output',\n type: 'boolean',\n default: false,\n },\n 'network-endpoint': {\n demandOption: false,\n type: 'string',\n describe: 'Blockchain network endpoint to connect',\n },\n 'output-fmt': {\n demandOption: false,\n describe: 'Print log as json or plain text',\n type: 'string',\n choices: ['json', 'colored'],\n },\n 'log-level': {\n demandOption: false,\n describe: 'Specify log level to print. Ignored when --debug is used',\n type: 'string',\n choices: ['fatal', 'error', 'warn', 'info', 'debug', 'trace', 'silent'],\n },\n migrate: {\n demandOption: false,\n describe: 'Migrate db schema (for management tables only)',\n type: 'boolean',\n default: false,\n },\n 'timestamp-field': {\n demandOption: false,\n describe: 'Enable/disable created_at and updated_at in schema',\n type: 'boolean',\n default: false,\n },\n 'network-dictionary': {\n alias: 'd',\n demandOption: false,\n describe: 'Specify the dictionary api for this network',\n type: 'string',\n },\n 'dictionary-timeout': {\n demandOption: false,\n describe: 'Max timeout for dictionary query',\n type: 'number',\n },\n 'mmr-path': {\n alias: 'm',\n demandOption: false,\n describe: 'Local path of the merkle mountain range (.mmr) file',\n type: 'string',\n },\n 'proof-of-index': {\n demandOption: false,\n describe: 'Enable/disable proof of index',\n type: 'boolean',\n default: false,\n },\n ipfs: {\n demandOption: false,\n describe: 'IPFS gateway endpoint',\n type: 'string',\n },\n port: {\n alias: 'p',\n demandOption: false,\n describe: 'The port the service will bind to',\n type: 'number',\n },\n 'disable-historical': {\n demandOption: false,\n default: false,\n describe: 'Disable storing historical state entities',\n type: 'boolean',\n },\n workers: {\n alias: 'w',\n demandOption: false,\n describe:\n 'Number of worker threads to use for fetching and processing blocks. Disabled by default.',\n type: 'number',\n },\n 'query-limit': {\n demandOption: false,\n describe:\n 'The limit of items a project can query with store.getByField at once',\n type: 'number',\n default: 100,\n },\n 'unfinalized-blocks': {\n demandOption: false,\n default: false,\n describe: 'Enable to fetch and index unfinalized blocks',\n type: 'boolean',\n },\n });\n"]}
|
|
1
|
+
{"version":3,"file":"yargs.js","sourceRoot":"","sources":["../src/yargs.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,sCAAsC;;;;;;AAEtC,oDAAqD;AACrD,2CAAwC;AACxC,wDAAgC;AAEnB,QAAA,YAAY,GAAG,IAAA,eAAK,EAAC,IAAA,iBAAO,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KACrD,GAAG,CAAC,YAAY,CAAC;KACjB,OAAO,CAAC;IACP,OAAO,EAAE,aAAa;I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;QACrD,IAAI,EAAE,SAAS;KAChB;IACD,OAAO,EAAE;QACP,KAAK,EAAE,GAAG;QACV,YAAY,EAAE,KAAK;QACnB,QAAQ,EACN,0FAA0F;QAC5F,IAAI,EAAE,QAAQ;KACf;IACD,aAAa,EAAE;QACb,YAAY,EAAE,KAAK;QACnB,QAAQ,EACN,sEAAsE;QACxE,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,GAAG;KACb;IACD,oBAAoB,EAAE;QACpB,YAAY,EAAE,KAAK;QACnB,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,8CAA8C;QACxD,IAAI,EAAE,SAAS;KAChB;CACF,CAAC,CAAC","sourcesContent":["// Copyright 2020-2022 OnFinality Limited authors & contributors\n// SPDX-License-Identifier: Apache-2.0\n\nimport { initLogger } from '@subql/node-core/logger';\nimport { hideBin } from 'yargs/helpers';\nimport yargs from 'yargs/yargs';\n\nexport const yargsOptions = yargs(hideBin(process.argv))\n .env('SUBQL_NODE')\n .command({\n command: 'force-clean',\n describe:\n 'Clean the database dropping project schemas and tables. Once the command is executed, the application would exit upon completion.',\n builder: {},\n handler: (argv) => {\n initLogger(\n argv.debug as boolean,\n argv.outputFmt as 'json' | 'colored',\n argv.logLevel as string | undefined,\n );\n\n // lazy import to make sure logger is instantiated before all other services\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { forceCleanInit } = require('./subcommands/forceClean.init');\n return forceCleanInit();\n },\n })\n .command({\n command: 'reindex',\n describe:\n '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.',\n builder: (yargs) =>\n yargs.options('targetHeight', {\n type: 'number',\n description: 'set targetHeight',\n require: true,\n }),\n handler: (argv) => {\n initLogger(\n argv.debug as boolean,\n argv.outputFmt as 'json' | 'colored',\n argv.logLevel as string | undefined,\n );\n // lazy import to make sure logger is instantiated before all other services\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { reindexInit } = require('./subcommands/reindex.init');\n return reindexInit(argv.targetHeight);\n },\n })\n .options({\n subquery: {\n alias: 'f',\n demandOption: true,\n default: process.cwd(),\n describe: 'Local path or IPFS cid of the subquery project',\n type: 'string',\n },\n 'subquery-name': {\n deprecated: true,\n demandOption: false,\n describe: 'Name of the subquery project',\n type: 'string',\n },\n config: {\n alias: 'c',\n demandOption: false,\n describe: 'Specify configuration file',\n type: 'string',\n },\n local: {\n deprecated: true,\n type: 'boolean',\n demandOption: false,\n describe: 'Use local mode',\n },\n 'db-schema': {\n demandOption: false,\n describe: 'Db schema name of the project',\n type: 'string',\n },\n unsafe: {\n type: 'boolean',\n demandOption: false,\n describe: 'Allows usage of any built-in module within the sandbox',\n },\n subscription: {\n demandOption: false,\n describe: 'Enable subscription by create notification triggers',\n type: 'boolean',\n default: false,\n },\n 'batch-size': {\n demandOption: false,\n describe: 'Batch size of blocks to fetch in one round',\n type: 'number',\n },\n 'scale-batch-size': {\n type: 'boolean',\n demandOption: false,\n describe: 'scale batch size based on memory usage',\n default: false,\n },\n timeout: {\n demandOption: false,\n describe: 'Timeout for indexer sandbox to execute the mapping functions',\n type: 'number',\n },\n debug: {\n demandOption: false,\n describe:\n 'Show debug information to console output. will forcefully set log level to debug',\n type: 'boolean',\n default: false,\n },\n profiler: {\n demandOption: false,\n describe: 'Show profiler information to console output',\n type: 'boolean',\n default: false,\n },\n 'network-endpoint': {\n demandOption: false,\n type: 'string',\n describe: 'Blockchain network endpoint to connect',\n },\n 'output-fmt': {\n demandOption: false,\n describe: 'Print log as json or plain text',\n type: 'string',\n choices: ['json', 'colored'],\n },\n 'log-level': {\n demandOption: false,\n describe: 'Specify log level to print. Ignored when --debug is used',\n type: 'string',\n choices: ['fatal', 'error', 'warn', 'info', 'debug', 'trace', 'silent'],\n },\n 'timestamp-field': {\n demandOption: false,\n describe: 'Enable/disable created_at and updated_at in schema',\n type: 'boolean',\n default: false,\n },\n 'network-dictionary': {\n alias: 'd',\n demandOption: false,\n describe: 'Specify the dictionary api for this network',\n type: 'string',\n },\n 'dictionary-timeout': {\n demandOption: false,\n describe: 'Max timeout for dictionary query',\n type: 'number',\n },\n 'mmr-path': {\n alias: 'm',\n demandOption: false,\n describe: 'Local path of the merkle mountain range (.mmr) file',\n type: 'string',\n },\n 'proof-of-index': {\n demandOption: false,\n describe: 'Enable/disable proof of index',\n type: 'boolean',\n default: false,\n },\n ipfs: {\n demandOption: false,\n describe: 'IPFS gateway endpoint',\n type: 'string',\n },\n port: {\n alias: 'p',\n demandOption: false,\n describe: 'The port the service will bind to',\n type: 'number',\n },\n 'disable-historical': {\n demandOption: false,\n default: false,\n describe: 'Disable storing historical state entities',\n type: 'boolean',\n },\n workers: {\n alias: 'w',\n demandOption: false,\n describe:\n 'Number of worker threads to use for fetching and processing blocks. Disabled by default.',\n type: 'number',\n },\n 'query-limit': {\n demandOption: false,\n describe:\n 'The limit of items a project can query with store.getByField at once',\n type: 'number',\n default: 100,\n },\n 'unfinalized-blocks': {\n demandOption: false,\n default: false,\n describe: 'Enable to fetch and index unfinalized blocks',\n type: 'boolean',\n },\n });\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@subql/node-ethereum",
|
|
3
|
-
"version": "0.3.1-
|
|
3
|
+
"version": "0.3.1-1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Ian He",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"@nestjs/event-emitter": "^1.3.0",
|
|
25
25
|
"@nestjs/platform-express": "^8.2.6",
|
|
26
26
|
"@nestjs/schedule": "^1.0.2",
|
|
27
|
-
"@subql/common": "
|
|
28
|
-
"@subql/common-ethereum": "0.2.2-
|
|
29
|
-
"@subql/node-core": "1.
|
|
30
|
-
"@subql/types-ethereum": "0.2.2-
|
|
31
|
-
"@subql/utils": "
|
|
27
|
+
"@subql/common": "1.5.0",
|
|
28
|
+
"@subql/common-ethereum": "0.2.2-1",
|
|
29
|
+
"@subql/node-core": "1.7.2-2",
|
|
30
|
+
"@subql/types-ethereum": "0.2.2-2",
|
|
31
|
+
"@subql/utils": "1.3.2-1",
|
|
32
32
|
"@subql/x-merkle-mountain-range": "2.0.0-0.1.2",
|
|
33
33
|
"@willsoto/nestjs-prometheus": "^4.4.0",
|
|
34
34
|
"algosdk": "^1.13.1",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"/dist",
|
|
75
75
|
"/bin"
|
|
76
76
|
],
|
|
77
|
-
"stableVersion": "0.3.0"
|
|
77
|
+
"stableVersion": "0.3.1-0"
|
|
78
78
|
}
|