@subql/node-ethereum 3.3.2 → 3.3.3-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/indexer/dictionary.service.js +7 -4
- package/dist/indexer/dictionary.service.js.map +1 -1
- package/dist/yargs.d.ts +1 -227
- package/dist/yargs.js +7 -265
- package/dist/yargs.js.map +1 -1
- package/package.json +4 -3
|
@@ -21,24 +21,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
21
21
|
exports.DictionaryService = void 0;
|
|
22
22
|
const common_1 = require("@nestjs/common");
|
|
23
23
|
const event_emitter_1 = require("@nestjs/event-emitter");
|
|
24
|
+
const common_2 = require("@subql/common");
|
|
24
25
|
const node_core_1 = require("@subql/node-core");
|
|
25
26
|
const json5_1 = __importDefault(require("json5"));
|
|
26
27
|
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
27
28
|
const SubqueryProject_1 = require("../configure/SubqueryProject");
|
|
28
29
|
const CHAIN_ALIASES_URL = 'https://raw.githubusercontent.com/subquery/templates/main/chainAliases.json5';
|
|
29
30
|
let DictionaryService = DictionaryService_1 = class DictionaryService extends node_core_1.DictionaryService {
|
|
30
|
-
constructor(project, nodeConfig, eventEmitter, chainId) {
|
|
31
|
-
super(project.network.dictionary, chainId !== null && chainId !== void 0 ? chainId : project.network.chainId, nodeConfig, eventEmitter);
|
|
31
|
+
constructor(project, nodeConfig, eventEmitter, chainId, dictionaryUrl) {
|
|
32
|
+
super(dictionaryUrl !== null && dictionaryUrl !== void 0 ? dictionaryUrl : project.network.dictionary, chainId !== null && chainId !== void 0 ? chainId : project.network.chainId, nodeConfig, eventEmitter);
|
|
32
33
|
this.project = project;
|
|
33
34
|
}
|
|
34
35
|
static async create(project, nodeConfig, eventEmitter) {
|
|
36
|
+
var _a;
|
|
35
37
|
/*Some dictionarys for EVM are built with other SDKs as they are chains with an EVM runtime
|
|
36
38
|
* we maintain a list of aliases so we can map the evmChainId to the genesis hash of the other SDKs
|
|
37
39
|
* e.g moonbeam is built with Substrate SDK but can be used as an EVM dictionary
|
|
38
40
|
*/
|
|
39
41
|
const chainAliases = await this.getEvmChainId();
|
|
40
42
|
const chainAlias = chainAliases[project.network.chainId];
|
|
41
|
-
|
|
43
|
+
const url = (_a = project.network.dictionary) !== null && _a !== void 0 ? _a : (await node_core_1.DictionaryService.resolveDictionary(common_2.NETWORK_FAMILY.ethereum, chainAlias, nodeConfig.dictionaryRegistry));
|
|
44
|
+
return new DictionaryService_1(project, nodeConfig, eventEmitter, chainAlias, url);
|
|
42
45
|
}
|
|
43
46
|
validateChainMeta(metaData) {
|
|
44
47
|
// Due to dictionary metadata doesn't include chainId, in here we only validate endpoint genesisHash with metadata
|
|
@@ -56,7 +59,7 @@ DictionaryService = DictionaryService_1 = __decorate([
|
|
|
56
59
|
__param(0, (0, common_1.Inject)('ISubqueryProject')),
|
|
57
60
|
__metadata("design:paramtypes", [SubqueryProject_1.SubqueryProject,
|
|
58
61
|
node_core_1.NodeConfig,
|
|
59
|
-
event_emitter_1.EventEmitter2, String])
|
|
62
|
+
event_emitter_1.EventEmitter2, String, String])
|
|
60
63
|
], DictionaryService);
|
|
61
64
|
exports.DictionaryService = DictionaryService;
|
|
62
65
|
//# sourceMappingURL=dictionary.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.service.js","sourceRoot":"","sources":["../../src/indexer/dictionary.service.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;;;;;;;;;;;AAEnC,2CAAoD;AACpD,yDAAsD;AACtD,gDAG0B;AAE1B,kDAA0B;AAC1B,4DAA+B;AAC/B,kEAA+D;AAE/D,MAAM,iBAAiB,GACrB,8EAA8E,CAAC;AAG1E,IAAM,iBAAiB,yBAAvB,MAAM,iBAAkB,SAAQ,6BAAqB;IAC1D,YACwC,OAAwB,EAC9D,UA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CAAC,QAAkB;QAC5C,kHAAkH;QAClH,OAAO,IAAI,CAAC,cAAc,KAAK,QAAQ,CAAC,WAAW,CAAC;IACtD,CAAC;IAEO,MAAM,CAAC,KAAK,CAAC,aAAa;QAChC,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAK,EAAC,iBAAiB,CAAC,CAAC;QAEhD,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAClC,wDAAwD;QACxD,OAAO,eAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;CACF,CAAA;AAzDY,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,eAAM,EAAC,kBAAkB,CAAC,CAAA;qCAAoB,iCAAe;QAClD,sBAAU;QACR,6BAAa;GAJlB,iBAAiB,CAyD7B;AAzDY,8CAAiB","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { Inject, Injectable } from '@nestjs/common';\nimport { EventEmitter2 } from '@nestjs/event-emitter';\nimport { NETWORK_FAMILY } from '@subql/common';\nimport {\n NodeConfig,\n DictionaryService as CoreDictionaryService,\n} from '@subql/node-core';\nimport { MetaData } from '@subql/utils';\nimport JSON5 from 'json5';\nimport fetch from 'node-fetch';\nimport { SubqueryProject } from '../configure/SubqueryProject';\n\nconst CHAIN_ALIASES_URL =\n 'https://raw.githubusercontent.com/subquery/templates/main/chainAliases.json5';\n\n@Injectable()\nexport class DictionaryService extends CoreDictionaryService {\n private constructor(\n @Inject('ISubqueryProject') protected project: SubqueryProject,\n nodeConfig: NodeConfig,\n eventEmitter: EventEmitter2,\n chainId?: string,\n dictionaryUrl?: string,\n ) {\n super(\n dictionaryUrl ?? project.network.dictionary,\n chainId ?? project.network.chainId,\n nodeConfig,\n eventEmitter,\n );\n }\n\n static async create(\n project: SubqueryProject,\n nodeConfig: NodeConfig,\n eventEmitter: EventEmitter2,\n ): Promise<DictionaryService> {\n /*Some dictionarys for EVM are built with other SDKs as they are chains with an EVM runtime\n * we maintain a list of aliases so we can map the evmChainId to the genesis hash of the other SDKs\n * e.g moonbeam is built with Substrate SDK but can be used as an EVM dictionary\n */\n const chainAliases = await this.getEvmChainId();\n const chainAlias = chainAliases[project.network.chainId];\n\n const url =\n project.network.dictionary ??\n (await CoreDictionaryService.resolveDictionary(\n NETWORK_FAMILY.ethereum,\n chainAlias,\n nodeConfig.dictionaryRegistry,\n ));\n\n return new DictionaryService(\n project,\n nodeConfig,\n eventEmitter,\n chainAlias,\n url,\n );\n }\n\n protected validateChainMeta(metaData: MetaData): boolean {\n // Due to dictionary metadata doesn't include chainId, in here we only validate endpoint genesisHash with metadata\n return this.apiGenesisHash === metaData.genesisHash;\n }\n\n private static async getEvmChainId(): Promise<Record<string, string>> {\n const response = await fetch(CHAIN_ALIASES_URL);\n\n const raw = await response.text();\n // We use JSON5 here because the file has comments in it\n return JSON5.parse(raw);\n }\n}\n"]}
|
package/dist/yargs.d.ts
CHANGED
|
@@ -1,227 +1 @@
|
|
|
1
|
-
export declare const yargsOptions:
|
|
2
|
-
targetHeight: number;
|
|
3
|
-
}, "batch-size" | "block-confirmations" | "config" | "db-schema" | "debug" | "dictionary-resolver" | "dictionary-timeout" | "dictionary-query-size" | "disable-historical" | "ipfs" | "local" | "log-level" | "multi-chain" | "network-dictionary" | "network-endpoint" | "primary-network-endpoint" | "output-fmt" | "port" | "profiler" | "proof-of-index" | "query-limit" | "scale-batch-size" | "pg-ca" | "pg-key" | "pg-cert" | "store-cache-threshold" | "store-cache-upper-limit" | "store-get-cache-size" | "store-cache-async" | "store-flush-interval" | "subquery" | "subquery-name" | "subscription" | "skipTransactions" | "timeout" | "timestamp-field" | "unfinalized-blocks" | "unsafe" | "workers" | "root" | "query-address-limit"> & import("yargs").InferredOptionTypes<{
|
|
4
|
-
'batch-size': {
|
|
5
|
-
demandOption: false;
|
|
6
|
-
describe: string;
|
|
7
|
-
type: "number";
|
|
8
|
-
};
|
|
9
|
-
'block-confirmations': {
|
|
10
|
-
demandOption: false;
|
|
11
|
-
default: number;
|
|
12
|
-
describe: string;
|
|
13
|
-
type: "number";
|
|
14
|
-
};
|
|
15
|
-
config: {
|
|
16
|
-
alias: string;
|
|
17
|
-
demandOption: false;
|
|
18
|
-
describe: string;
|
|
19
|
-
type: "string";
|
|
20
|
-
};
|
|
21
|
-
'db-schema': {
|
|
22
|
-
demandOption: false;
|
|
23
|
-
describe: string;
|
|
24
|
-
type: "string";
|
|
25
|
-
};
|
|
26
|
-
debug: {
|
|
27
|
-
demandOption: false;
|
|
28
|
-
describe: string;
|
|
29
|
-
type: "string";
|
|
30
|
-
};
|
|
31
|
-
'dictionary-resolver': {
|
|
32
|
-
demandOption: false;
|
|
33
|
-
describe: string;
|
|
34
|
-
type: "string";
|
|
35
|
-
};
|
|
36
|
-
'dictionary-timeout': {
|
|
37
|
-
demandOption: false;
|
|
38
|
-
describe: string;
|
|
39
|
-
type: "number";
|
|
40
|
-
};
|
|
41
|
-
'dictionary-query-size': {
|
|
42
|
-
demandOption: false;
|
|
43
|
-
describe: string;
|
|
44
|
-
type: "number";
|
|
45
|
-
};
|
|
46
|
-
'disable-historical': {
|
|
47
|
-
demandOption: false;
|
|
48
|
-
describe: string;
|
|
49
|
-
type: "boolean";
|
|
50
|
-
};
|
|
51
|
-
ipfs: {
|
|
52
|
-
demandOption: false;
|
|
53
|
-
describe: string;
|
|
54
|
-
type: "string";
|
|
55
|
-
};
|
|
56
|
-
local: {
|
|
57
|
-
deprecated: true;
|
|
58
|
-
type: "boolean";
|
|
59
|
-
demandOption: false;
|
|
60
|
-
describe: string;
|
|
61
|
-
};
|
|
62
|
-
'log-level': {
|
|
63
|
-
demandOption: false;
|
|
64
|
-
describe: string;
|
|
65
|
-
type: "string";
|
|
66
|
-
choices: string[];
|
|
67
|
-
};
|
|
68
|
-
'multi-chain': {
|
|
69
|
-
demandOption: false;
|
|
70
|
-
default: boolean;
|
|
71
|
-
describe: string;
|
|
72
|
-
type: "boolean";
|
|
73
|
-
};
|
|
74
|
-
'network-dictionary': {
|
|
75
|
-
alias: string;
|
|
76
|
-
demandOption: false;
|
|
77
|
-
describe: string;
|
|
78
|
-
type: "string";
|
|
79
|
-
};
|
|
80
|
-
'network-endpoint': {
|
|
81
|
-
demandOption: false;
|
|
82
|
-
type: "string";
|
|
83
|
-
describe: string;
|
|
84
|
-
};
|
|
85
|
-
'primary-network-endpoint': {
|
|
86
|
-
demandOption: false;
|
|
87
|
-
type: "string";
|
|
88
|
-
describe: string;
|
|
89
|
-
};
|
|
90
|
-
'output-fmt': {
|
|
91
|
-
demandOption: false;
|
|
92
|
-
describe: string;
|
|
93
|
-
type: "string";
|
|
94
|
-
choices: string[];
|
|
95
|
-
};
|
|
96
|
-
port: {
|
|
97
|
-
alias: string;
|
|
98
|
-
demandOption: false;
|
|
99
|
-
describe: string;
|
|
100
|
-
type: "number";
|
|
101
|
-
};
|
|
102
|
-
profiler: {
|
|
103
|
-
demandOption: false;
|
|
104
|
-
describe: string;
|
|
105
|
-
type: "boolean";
|
|
106
|
-
default: boolean;
|
|
107
|
-
};
|
|
108
|
-
'proof-of-index': {
|
|
109
|
-
demandOption: false;
|
|
110
|
-
describe: string;
|
|
111
|
-
type: "boolean";
|
|
112
|
-
default: boolean;
|
|
113
|
-
};
|
|
114
|
-
'query-limit': {
|
|
115
|
-
demandOption: false;
|
|
116
|
-
describe: string;
|
|
117
|
-
type: "number";
|
|
118
|
-
default: number;
|
|
119
|
-
};
|
|
120
|
-
'scale-batch-size': {
|
|
121
|
-
type: "boolean";
|
|
122
|
-
demandOption: false;
|
|
123
|
-
describe: string;
|
|
124
|
-
default: boolean;
|
|
125
|
-
};
|
|
126
|
-
'pg-ca': {
|
|
127
|
-
demandOption: false;
|
|
128
|
-
describe: string;
|
|
129
|
-
type: "string";
|
|
130
|
-
};
|
|
131
|
-
'pg-key': {
|
|
132
|
-
demandOption: false;
|
|
133
|
-
describe: string;
|
|
134
|
-
type: "string";
|
|
135
|
-
};
|
|
136
|
-
'pg-cert': {
|
|
137
|
-
demandOption: false;
|
|
138
|
-
describe: string;
|
|
139
|
-
type: "string";
|
|
140
|
-
};
|
|
141
|
-
'store-cache-threshold': {
|
|
142
|
-
demandOption: false;
|
|
143
|
-
describe: string;
|
|
144
|
-
type: "number";
|
|
145
|
-
};
|
|
146
|
-
'store-cache-upper-limit': {
|
|
147
|
-
demandOption: false;
|
|
148
|
-
describe: string;
|
|
149
|
-
type: "number";
|
|
150
|
-
};
|
|
151
|
-
'store-get-cache-size': {
|
|
152
|
-
demandOption: false;
|
|
153
|
-
describe: string;
|
|
154
|
-
type: "number";
|
|
155
|
-
};
|
|
156
|
-
'store-cache-async': {
|
|
157
|
-
demandOption: false;
|
|
158
|
-
describe: string;
|
|
159
|
-
type: "boolean";
|
|
160
|
-
};
|
|
161
|
-
'store-flush-interval': {
|
|
162
|
-
demandOption: false;
|
|
163
|
-
describe: string;
|
|
164
|
-
type: "number";
|
|
165
|
-
default: number;
|
|
166
|
-
};
|
|
167
|
-
subquery: {
|
|
168
|
-
alias: string;
|
|
169
|
-
demandOption: true;
|
|
170
|
-
default: string;
|
|
171
|
-
describe: string;
|
|
172
|
-
type: "string";
|
|
173
|
-
};
|
|
174
|
-
'subquery-name': {
|
|
175
|
-
deprecated: true;
|
|
176
|
-
demandOption: false;
|
|
177
|
-
describe: string;
|
|
178
|
-
type: "string";
|
|
179
|
-
};
|
|
180
|
-
subscription: {
|
|
181
|
-
demandOption: false;
|
|
182
|
-
describe: string;
|
|
183
|
-
type: "boolean";
|
|
184
|
-
default: boolean;
|
|
185
|
-
};
|
|
186
|
-
skipTransactions: {
|
|
187
|
-
demandOption: false;
|
|
188
|
-
describe: string;
|
|
189
|
-
type: "boolean";
|
|
190
|
-
};
|
|
191
|
-
timeout: {
|
|
192
|
-
demandOption: false;
|
|
193
|
-
describe: string;
|
|
194
|
-
type: "number";
|
|
195
|
-
};
|
|
196
|
-
'timestamp-field': {
|
|
197
|
-
demandOption: false;
|
|
198
|
-
describe: string;
|
|
199
|
-
type: "boolean";
|
|
200
|
-
default: boolean;
|
|
201
|
-
};
|
|
202
|
-
'unfinalized-blocks': {
|
|
203
|
-
demandOption: false;
|
|
204
|
-
describe: string;
|
|
205
|
-
type: "boolean";
|
|
206
|
-
};
|
|
207
|
-
unsafe: {
|
|
208
|
-
type: "boolean";
|
|
209
|
-
demandOption: false;
|
|
210
|
-
describe: string;
|
|
211
|
-
};
|
|
212
|
-
workers: {
|
|
213
|
-
alias: string;
|
|
214
|
-
demandOption: false;
|
|
215
|
-
describe: string;
|
|
216
|
-
type: "number";
|
|
217
|
-
};
|
|
218
|
-
root: {
|
|
219
|
-
describe: string;
|
|
220
|
-
type: "string";
|
|
221
|
-
};
|
|
222
|
-
'query-address-limit': {
|
|
223
|
-
describe: string;
|
|
224
|
-
type: "number";
|
|
225
|
-
default: number;
|
|
226
|
-
};
|
|
227
|
-
}>>;
|
|
1
|
+
export declare const yargsOptions: any;
|
package/dist/yargs.js
CHANGED
|
@@ -1,285 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors
|
|
3
3
|
// SPDX-License-Identifier: GPL-3.0
|
|
4
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
|
-
};
|
|
7
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
5
|
exports.yargsOptions = void 0;
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
exports.yargsOptions = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
|
|
13
|
-
.env('SUBQL_NODE')
|
|
14
|
-
.command({
|
|
15
|
-
command: 'test',
|
|
16
|
-
describe: 'Run tests for a SubQuery application',
|
|
17
|
-
builder: {},
|
|
18
|
-
handler: (argv) => {
|
|
19
|
-
(0, logger_1.initLogger)(argv.debug, argv.outputFmt, argv.logLevel);
|
|
6
|
+
const yargs_1 = require("@subql/node-core/yargs");
|
|
7
|
+
exports.yargsOptions = (0, yargs_1.yargsBuilder)({
|
|
8
|
+
initTesting: () => {
|
|
20
9
|
// lazy import to make sure logger is instantiated before all other services
|
|
21
10
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
22
11
|
const { testingInit } = require('./subcommands/testing.init');
|
|
23
12
|
return testingInit();
|
|
24
13
|
},
|
|
25
|
-
|
|
26
|
-
.command({
|
|
27
|
-
command: 'force-clean',
|
|
28
|
-
describe: 'Clean the database dropping project schemas and tables. Once the command is executed, the application would exit upon completion.',
|
|
29
|
-
builder: {},
|
|
30
|
-
handler: (argv) => {
|
|
31
|
-
(0, logger_1.initLogger)(argv.debug, argv.outputFmt, argv.logLevel);
|
|
14
|
+
initForceClean: () => {
|
|
32
15
|
// lazy import to make sure logger is instantiated before all other services
|
|
33
16
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
34
17
|
const { forceCleanInit } = require('./subcommands/forceClean.init');
|
|
35
18
|
return forceCleanInit();
|
|
36
19
|
},
|
|
37
|
-
|
|
38
|
-
.command({
|
|
39
|
-
command: 'reindex',
|
|
40
|
-
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.',
|
|
41
|
-
builder: (yargs) => yargs.options('targetHeight', {
|
|
42
|
-
type: 'number',
|
|
43
|
-
description: 'set targetHeight',
|
|
44
|
-
require: true,
|
|
45
|
-
}),
|
|
46
|
-
handler: (argv) => {
|
|
47
|
-
(0, logger_1.initLogger)(argv.debug, argv.outputFmt, argv.logLevel);
|
|
20
|
+
initReindex: (targetHeight) => {
|
|
48
21
|
// lazy import to make sure logger is instantiated before all other services
|
|
49
22
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
50
23
|
const { reindexInit } = require('./subcommands/reindex.init');
|
|
51
|
-
return reindexInit(
|
|
24
|
+
return reindexInit(targetHeight);
|
|
52
25
|
},
|
|
53
|
-
})
|
|
54
|
-
.options({
|
|
55
|
-
'batch-size': {
|
|
56
|
-
demandOption: false,
|
|
57
|
-
describe: 'Batch size of blocks to fetch in one round',
|
|
58
|
-
type: 'number',
|
|
59
|
-
},
|
|
60
|
-
'block-confirmations': {
|
|
61
|
-
demandOption: false,
|
|
62
|
-
default: 20,
|
|
63
|
-
describe: 'The number of blocks behind the head to be considered finalized, this has no effect with Ethereum',
|
|
64
|
-
type: 'number',
|
|
65
|
-
},
|
|
66
|
-
config: {
|
|
67
|
-
alias: 'c',
|
|
68
|
-
demandOption: false,
|
|
69
|
-
describe: 'Specify configuration file',
|
|
70
|
-
type: 'string',
|
|
71
|
-
},
|
|
72
|
-
'db-schema': {
|
|
73
|
-
demandOption: false,
|
|
74
|
-
describe: 'Db schema name of the project',
|
|
75
|
-
type: 'string',
|
|
76
|
-
},
|
|
77
|
-
debug: {
|
|
78
|
-
demandOption: false,
|
|
79
|
-
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"`,
|
|
80
|
-
type: 'string',
|
|
81
|
-
},
|
|
82
|
-
'dictionary-resolver': {
|
|
83
|
-
demandOption: false,
|
|
84
|
-
describe: 'Use SubQuery Network dictionary resolver',
|
|
85
|
-
type: 'string',
|
|
86
|
-
},
|
|
87
|
-
'dictionary-timeout': {
|
|
88
|
-
demandOption: false,
|
|
89
|
-
describe: 'Max timeout for dictionary query',
|
|
90
|
-
type: 'number',
|
|
91
|
-
},
|
|
92
|
-
'dictionary-query-size': {
|
|
93
|
-
demandOption: false,
|
|
94
|
-
describe: 'Dictionary query max block size, this specify the block height range of the dictionary query',
|
|
95
|
-
type: 'number',
|
|
96
|
-
},
|
|
97
|
-
'disable-historical': {
|
|
98
|
-
demandOption: false,
|
|
99
|
-
describe: 'Disable storing historical state entities',
|
|
100
|
-
type: 'boolean',
|
|
101
|
-
// NOTE: don't set a default for this. It will break apply args from manifest. The default should be set in NodeConfig
|
|
102
|
-
},
|
|
103
|
-
ipfs: {
|
|
104
|
-
demandOption: false,
|
|
105
|
-
describe: 'IPFS gateway endpoint',
|
|
106
|
-
type: 'string',
|
|
107
|
-
},
|
|
108
|
-
local: {
|
|
109
|
-
deprecated: true,
|
|
110
|
-
type: 'boolean',
|
|
111
|
-
demandOption: false,
|
|
112
|
-
describe: 'Use local mode',
|
|
113
|
-
},
|
|
114
|
-
'log-level': {
|
|
115
|
-
demandOption: false,
|
|
116
|
-
describe: 'Specify log level to print. Ignored when --debug is used',
|
|
117
|
-
type: 'string',
|
|
118
|
-
choices: ['fatal', 'error', 'warn', 'info', 'debug', 'trace', 'silent'],
|
|
119
|
-
},
|
|
120
|
-
'multi-chain': {
|
|
121
|
-
demandOption: false,
|
|
122
|
-
default: false,
|
|
123
|
-
describe: 'Enables indexing multiple subquery projects into the same database schema',
|
|
124
|
-
type: 'boolean',
|
|
125
|
-
},
|
|
126
|
-
'network-dictionary': {
|
|
127
|
-
alias: 'd',
|
|
128
|
-
demandOption: false,
|
|
129
|
-
describe: 'Specify the dictionary api for this network',
|
|
130
|
-
type: 'string',
|
|
131
|
-
},
|
|
132
|
-
'network-endpoint': {
|
|
133
|
-
demandOption: false,
|
|
134
|
-
type: 'string',
|
|
135
|
-
describe: 'Blockchain network endpoint to connect',
|
|
136
|
-
},
|
|
137
|
-
'primary-network-endpoint': {
|
|
138
|
-
demandOption: false,
|
|
139
|
-
type: 'string',
|
|
140
|
-
describe: 'Primary blockchain endpoint, used as the first choice for connections.',
|
|
141
|
-
},
|
|
142
|
-
'output-fmt': {
|
|
143
|
-
demandOption: false,
|
|
144
|
-
describe: 'Print log as json or plain text',
|
|
145
|
-
type: 'string',
|
|
146
|
-
choices: ['json', 'colored'],
|
|
147
|
-
},
|
|
148
|
-
port: {
|
|
149
|
-
alias: 'p',
|
|
150
|
-
demandOption: false,
|
|
151
|
-
describe: 'The port the service will bind to',
|
|
152
|
-
type: 'number',
|
|
153
|
-
},
|
|
154
|
-
profiler: {
|
|
155
|
-
demandOption: false,
|
|
156
|
-
describe: 'Show profiler information to console output',
|
|
157
|
-
type: 'boolean',
|
|
158
|
-
default: false,
|
|
159
|
-
},
|
|
160
|
-
'proof-of-index': {
|
|
161
|
-
demandOption: false,
|
|
162
|
-
describe: 'Enable/disable proof of index',
|
|
163
|
-
type: 'boolean',
|
|
164
|
-
default: false,
|
|
165
|
-
},
|
|
166
|
-
'query-limit': {
|
|
167
|
-
demandOption: false,
|
|
168
|
-
describe: 'The limit of items a project can query with store.getByField at once',
|
|
169
|
-
type: 'number',
|
|
170
|
-
default: 100,
|
|
171
|
-
},
|
|
172
|
-
'scale-batch-size': {
|
|
173
|
-
type: 'boolean',
|
|
174
|
-
demandOption: false,
|
|
175
|
-
describe: 'scale batch size based on memory usage',
|
|
176
|
-
default: false,
|
|
177
|
-
},
|
|
178
|
-
'pg-ca': {
|
|
179
|
-
demandOption: false,
|
|
180
|
-
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',
|
|
181
|
-
type: 'string',
|
|
182
|
-
},
|
|
183
|
-
'pg-key': {
|
|
184
|
-
demandOption: false,
|
|
185
|
-
describe: 'Postgres client key - Path to key file e.g /path/to/client-key/postgresql.key',
|
|
186
|
-
type: 'string',
|
|
187
|
-
},
|
|
188
|
-
'pg-cert': {
|
|
189
|
-
demandOption: false,
|
|
190
|
-
describe: 'Postgres client certificate - Path to client certificate e.g /path/to/client-certificates/postgresql.crt',
|
|
191
|
-
type: 'string',
|
|
192
|
-
},
|
|
193
|
-
'store-cache-threshold': {
|
|
194
|
-
demandOption: false,
|
|
195
|
-
describe: 'Store cache will flush data to the database when number of records excess this threshold',
|
|
196
|
-
type: 'number',
|
|
197
|
-
},
|
|
198
|
-
'store-cache-upper-limit': {
|
|
199
|
-
demandOption: false,
|
|
200
|
-
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.',
|
|
201
|
-
type: 'number',
|
|
202
|
-
},
|
|
203
|
-
'store-get-cache-size': {
|
|
204
|
-
demandOption: false,
|
|
205
|
-
describe: 'Store get cache size for each model',
|
|
206
|
-
type: 'number',
|
|
207
|
-
},
|
|
208
|
-
'store-cache-async': {
|
|
209
|
-
demandOption: false,
|
|
210
|
-
describe: 'If enabled the store cache will flush data asyncronously relative to indexing data',
|
|
211
|
-
type: 'boolean',
|
|
212
|
-
},
|
|
213
|
-
'store-flush-interval': {
|
|
214
|
-
demandOption: false,
|
|
215
|
-
describe: 'The interval, in seconds, at which data is flushed from the cache. ' +
|
|
216
|
-
'This ensures that data is persisted regularly when there is either not much data or the project is up to date.',
|
|
217
|
-
type: 'number',
|
|
218
|
-
default: 5,
|
|
219
|
-
},
|
|
220
|
-
subquery: {
|
|
221
|
-
alias: 'f',
|
|
222
|
-
demandOption: true,
|
|
223
|
-
default: process.cwd(),
|
|
224
|
-
describe: 'Local path or IPFS cid of the subquery project',
|
|
225
|
-
type: 'string',
|
|
226
|
-
},
|
|
227
|
-
'subquery-name': {
|
|
228
|
-
deprecated: true,
|
|
229
|
-
demandOption: false,
|
|
230
|
-
describe: 'Name of the subquery project',
|
|
231
|
-
type: 'string',
|
|
232
|
-
},
|
|
233
|
-
subscription: {
|
|
234
|
-
demandOption: false,
|
|
235
|
-
describe: 'Enable subscription by create notification triggers',
|
|
236
|
-
type: 'boolean',
|
|
237
|
-
default: false,
|
|
238
|
-
},
|
|
239
|
-
skipTransactions: {
|
|
240
|
-
demandOption: false,
|
|
241
|
-
describe: `If the project contains only event handlers and doesn't require transaction information then this can be used to skip fetching transactions reducing bandwith and memory. This will be automatically disabled if handlers other than EventHandlers are detected.`,
|
|
242
|
-
type: 'boolean',
|
|
243
|
-
// NOTE: don't set a default for this. It will break apply args from manifest. The default should be set in NodeConfig
|
|
244
|
-
},
|
|
245
|
-
timeout: {
|
|
246
|
-
demandOption: false,
|
|
247
|
-
describe: 'Timeout for indexer sandbox to execute the mapping functions',
|
|
248
|
-
type: 'number',
|
|
249
|
-
},
|
|
250
|
-
'timestamp-field': {
|
|
251
|
-
demandOption: false,
|
|
252
|
-
describe: 'Enable/disable created_at and updated_at in schema',
|
|
253
|
-
type: 'boolean',
|
|
254
|
-
default: false,
|
|
255
|
-
},
|
|
256
|
-
'unfinalized-blocks': {
|
|
257
|
-
demandOption: false,
|
|
258
|
-
describe: 'Enable to fetch and index unfinalized blocks',
|
|
259
|
-
type: 'boolean',
|
|
260
|
-
// NOTE: don't set a default for this. It will break apply args from manifest. The default should be set in NodeConfig
|
|
261
|
-
},
|
|
262
|
-
unsafe: {
|
|
263
|
-
type: 'boolean',
|
|
264
|
-
demandOption: false,
|
|
265
|
-
describe: 'Allows usage of any built-in module within the sandbox',
|
|
266
|
-
// NOTE: don't set a default for this. It will break apply args from manifest. The default should be set in NodeConfig
|
|
267
|
-
},
|
|
268
|
-
workers: {
|
|
269
|
-
alias: 'w',
|
|
270
|
-
demandOption: false,
|
|
271
|
-
describe: 'Number of worker threads to use for fetching and processing blocks. Disabled by default.',
|
|
272
|
-
type: 'number',
|
|
273
|
-
},
|
|
274
|
-
root: {
|
|
275
|
-
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.',
|
|
276
|
-
type: 'string',
|
|
277
|
-
},
|
|
278
|
-
'query-address-limit': {
|
|
279
|
-
describe: 'Set the limit for address on dictionary queries for dynamic datasources',
|
|
280
|
-
type: 'number',
|
|
281
|
-
default: 100,
|
|
282
|
-
},
|
|
283
|
-
})
|
|
284
|
-
.hide('root'); // root is hidden because its for internal use
|
|
26
|
+
});
|
|
285
27
|
//# sourceMappingURL=yargs.js.map
|
package/dist/yargs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yargs.js","sourceRoot":"","sources":["../src/yargs.ts"],"names":[],"mappings":";AAAA,8DAA8D;A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AAQ,EACN,yEAAyE;QAC3E,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,GAAG;KACb;CACF,CAAC;KACD,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,8CAA8C","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { initLogger } from '@subql/node-core/logger';\nimport { boolean } from 'yargs';\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: 'test',\n describe: 'Run tests for a SubQuery application',\n builder: {},\n handler: (argv) => {\n initLogger(\n argv.debug as string,\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 { testingInit } = require('./subcommands/testing.init');\n return testingInit();\n },\n })\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 string,\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 string,\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 'batch-size': {\n demandOption: false,\n describe: 'Batch size of blocks to fetch in one round',\n type: 'number',\n },\n 'block-confirmations': {\n demandOption: false,\n default: 20,\n describe:\n 'The number of blocks behind the head to be considered finalized, this has no effect with Ethereum',\n type: 'number',\n },\n config: {\n alias: 'c',\n demandOption: false,\n describe: 'Specify configuration file',\n type: 'string',\n },\n 'db-schema': {\n demandOption: false,\n describe: 'Db schema name of the project',\n type: 'string',\n },\n debug: {\n demandOption: false,\n 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\"`,\n type: 'string',\n },\n 'dictionary-resolver': {\n demandOption: false,\n describe: 'Use SubQuery Network dictionary resolver',\n type: 'string',\n },\n 'dictionary-timeout': {\n demandOption: false,\n describe: 'Max timeout for dictionary query',\n type: 'number',\n },\n 'dictionary-query-size': {\n demandOption: false,\n describe:\n 'Dictionary query max block size, this specify the block height range of the dictionary query',\n type: 'number',\n },\n 'disable-historical': {\n demandOption: false,\n describe: 'Disable storing historical state entities',\n type: 'boolean',\n // NOTE: don't set a default for this. It will break apply args from manifest. The default should be set in NodeConfig\n },\n ipfs: {\n demandOption: false,\n describe: 'IPFS gateway endpoint',\n type: 'string',\n },\n local: {\n deprecated: true,\n type: 'boolean',\n demandOption: false,\n describe: 'Use local mode',\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 'multi-chain': {\n demandOption: false,\n default: false,\n describe:\n 'Enables indexing multiple subquery projects into the same database schema',\n type: 'boolean',\n },\n 'network-dictionary': {\n alias: 'd',\n demandOption: false,\n describe: 'Specify the dictionary api for this network',\n type: 'string',\n },\n 'network-endpoint': {\n demandOption: false,\n type: 'string',\n describe: 'Blockchain network endpoint to connect',\n },\n 'primary-network-endpoint': {\n demandOption: false,\n type: 'string',\n describe:\n 'Primary blockchain endpoint, used as the first choice for connections.',\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 port: {\n alias: 'p',\n demandOption: false,\n describe: 'The port the service will bind to',\n type: 'number',\n },\n profiler: {\n demandOption: false,\n describe: 'Show profiler information to console output',\n type: 'boolean',\n default: false,\n },\n 'proof-of-index': {\n demandOption: false,\n describe: 'Enable/disable proof of index',\n type: 'boolean',\n default: false,\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 'scale-batch-size': {\n type: 'boolean',\n demandOption: false,\n describe: 'scale batch size based on memory usage',\n default: false,\n },\n 'pg-ca': {\n demandOption: false,\n describe:\n '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',\n type: 'string',\n },\n 'pg-key': {\n demandOption: false,\n describe:\n 'Postgres client key - Path to key file e.g /path/to/client-key/postgresql.key',\n type: 'string',\n },\n 'pg-cert': {\n demandOption: false,\n describe:\n 'Postgres client certificate - Path to client certificate e.g /path/to/client-certificates/postgresql.crt',\n type: 'string',\n },\n 'store-cache-threshold': {\n demandOption: false,\n describe:\n 'Store cache will flush data to the database when number of records excess this threshold',\n type: 'number',\n },\n 'store-cache-upper-limit': {\n demandOption: false,\n describe:\n '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.',\n type: 'number',\n },\n 'store-get-cache-size': {\n demandOption: false,\n describe: 'Store get cache size for each model',\n type: 'number',\n },\n 'store-cache-async': {\n demandOption: false,\n describe:\n 'If enabled the store cache will flush data asyncronously relative to indexing data',\n type: 'boolean',\n },\n 'store-flush-interval': {\n demandOption: false,\n describe:\n 'The interval, in seconds, at which data is flushed from the cache. ' +\n 'This ensures that data is persisted regularly when there is either not much data or the project is up to date.',\n type: 'number',\n default: 5,\n },\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 subscription: {\n demandOption: false,\n describe: 'Enable subscription by create notification triggers',\n type: 'boolean',\n default: false,\n },\n skipTransactions: {\n demandOption: false,\n describe: `If the project contains only event handlers and doesn't require transaction information then this can be used to skip fetching transactions reducing bandwith and memory. This will be automatically disabled if handlers other than EventHandlers are detected.`,\n type: 'boolean',\n // NOTE: don't set a default for this. It will break apply args from manifest. The default should be set in NodeConfig\n },\n timeout: {\n demandOption: false,\n describe: 'Timeout for indexer sandbox to execute the mapping functions',\n type: 'number',\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 'unfinalized-blocks': {\n demandOption: false,\n describe: 'Enable to fetch and index unfinalized blocks',\n type: 'boolean',\n // NOTE: don't set a default for this. It will break apply args from manifest. The default should be set in NodeConfig\n },\n unsafe: {\n type: 'boolean',\n demandOption: false,\n describe: 'Allows usage of any built-in module within the sandbox',\n // NOTE: don't set a default for this. It will break apply args from manifest. The default should be set in NodeConfig\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 root: {\n describe:\n '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.',\n type: 'string',\n },\n 'query-address-limit': {\n describe:\n 'Set the limit for address on dictionary queries for dynamic datasources',\n type: 'number',\n default: 100,\n },\n })\n .hide('root'); // root is hidden because its for internal use\n"]}
|
|
1
|
+
{"version":3,"file":"yargs.js","sourceRoot":"","sources":["../src/yargs.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;AAEnC,kDAAsD;AAEzC,QAAA,YAAY,GAAG,IAAA,oBAAY,EAAC;IACvC,WAAW,EAAE,GAAG,EAAE;QAChB,4EAA4E;QAC5E,8DAA8D;QAC9D,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;QAC9D,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;IACD,cAAc,EAAE,GAAG,EAAE;QACnB,4EAA4E;QAC5E,8DAA8D;QAC9D,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;QACpE,OAAO,cAAc,EAAE,CAAC;IAC1B,CAAC;IACD,WAAW,EAAE,CAAC,YAAoB,EAAE,EAAE;QACpC,4EAA4E;QAC5E,8DAA8D;QAC9D,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;QAC9D,OAAO,WAAW,CAAC,YAAY,CAAC,CAAC;IACnC,CAAC;CACF,CAAC,CAAC","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { yargsBuilder } from '@subql/node-core/yargs';\n\nexport const yargsOptions = yargsBuilder({\n initTesting: () => {\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 { testingInit } = require('./subcommands/testing.init');\n return testingInit();\n },\n initForceClean: () => {\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 initReindex: (targetHeight: number) => {\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(targetHeight);\n },\n});\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@subql/node-ethereum",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.3-0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Ian He",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@nestjs/schedule": "^3.0.1",
|
|
28
28
|
"@subql/common": "^3.3.0",
|
|
29
29
|
"@subql/common-ethereum": "3.1.0",
|
|
30
|
-
"@subql/node-core": "^6.
|
|
30
|
+
"@subql/node-core": "^6.4.1",
|
|
31
31
|
"@subql/testing": "^2.0.2",
|
|
32
32
|
"@subql/types-ethereum": "3.2.0",
|
|
33
33
|
"cacheable-lookup": "6",
|
|
@@ -65,5 +65,6 @@
|
|
|
65
65
|
"files": [
|
|
66
66
|
"/dist",
|
|
67
67
|
"/bin"
|
|
68
|
-
]
|
|
68
|
+
],
|
|
69
|
+
"stableVersion": "3.3.2"
|
|
69
70
|
}
|