@subql/node-ethereum 2.12.6-1 → 2.12.6-2

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.
Files changed (122) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/configure/NodeConfig.d.ts +21 -0
  4. package/dist/configure/NodeConfig.js +31 -0
  5. package/dist/configure/NodeConfig.js.map +1 -0
  6. package/dist/configure/SubqueryProject.d.ts +21 -29
  7. package/dist/configure/SubqueryProject.js +48 -72
  8. package/dist/configure/SubqueryProject.js.map +1 -1
  9. package/dist/configure/configure.module.d.ts +2 -2
  10. package/dist/configure/configure.module.js +19 -89
  11. package/dist/configure/configure.module.js.map +1 -1
  12. package/dist/ethereum/api.connection.d.ts +7 -7
  13. package/dist/ethereum/api.connection.js +4 -4
  14. package/dist/ethereum/api.connection.js.map +1 -1
  15. package/dist/ethereum/api.ethereum.d.ts +14 -8
  16. package/dist/ethereum/api.ethereum.js +24 -13
  17. package/dist/ethereum/api.ethereum.js.map +1 -1
  18. package/dist/ethereum/api.ethereum.test.js +29 -32
  19. package/dist/ethereum/api.ethereum.test.js.map +1 -1
  20. package/dist/ethereum/api.service.ethereum.d.ts +9 -7
  21. package/dist/ethereum/api.service.ethereum.js +56 -64
  22. package/dist/ethereum/api.service.ethereum.js.map +1 -1
  23. package/dist/ethereum/api.service.ethereum.test.js +8 -13
  24. package/dist/ethereum/api.service.ethereum.test.js.map +1 -1
  25. package/dist/ethereum/block.ethereum.d.ts +6 -15
  26. package/dist/ethereum/block.ethereum.js +52 -79
  27. package/dist/ethereum/block.ethereum.js.map +1 -1
  28. package/dist/ethereum/ethers/celo/celo-json-rpc-batch-provider.spec.js +3 -6
  29. package/dist/ethereum/ethers/celo/celo-json-rpc-batch-provider.spec.js.map +1 -1
  30. package/dist/ethereum/ethers/celo/celo-json-rpc-provider.spec.js +3 -6
  31. package/dist/ethereum/ethers/celo/celo-json-rpc-provider.spec.js.map +1 -1
  32. package/dist/ethereum/ethers/celo/celo-ws-provider.spec.js +3 -6
  33. package/dist/ethereum/ethers/celo/celo-ws-provider.spec.js.map +1 -1
  34. package/dist/indexer/blockDispatcher/block-dispatcher.service.d.ts +7 -7
  35. package/dist/indexer/blockDispatcher/block-dispatcher.service.js +7 -6
  36. package/dist/indexer/blockDispatcher/block-dispatcher.service.js.map +1 -1
  37. package/dist/indexer/blockDispatcher/worker-block-dispatcher.service.d.ts +4 -4
  38. package/dist/indexer/blockDispatcher/worker-block-dispatcher.service.js +9 -18
  39. package/dist/indexer/blockDispatcher/worker-block-dispatcher.service.js.map +1 -1
  40. package/dist/indexer/dictionary.service.d.ts +3 -3
  41. package/dist/indexer/dictionary.service.js +7 -5
  42. package/dist/indexer/dictionary.service.js.map +1 -1
  43. package/dist/indexer/dynamic-ds.service.d.ts +3 -3
  44. package/dist/indexer/dynamic-ds.service.js.map +1 -1
  45. package/dist/indexer/fetch.module.js +8 -10
  46. package/dist/indexer/fetch.module.js.map +1 -1
  47. package/dist/indexer/fetch.service.d.ts +10 -10
  48. package/dist/indexer/fetch.service.js +22 -43
  49. package/dist/indexer/fetch.service.js.map +1 -1
  50. package/dist/indexer/fetch.service.spec.js +25 -45
  51. package/dist/indexer/fetch.service.spec.js.map +1 -1
  52. package/dist/indexer/indexer.manager.d.ts +10 -12
  53. package/dist/indexer/indexer.manager.js +20 -30
  54. package/dist/indexer/indexer.manager.js.map +1 -1
  55. package/dist/indexer/project.service.d.ts +8 -6
  56. package/dist/indexer/project.service.js +19 -12
  57. package/dist/indexer/project.service.js.map +1 -1
  58. package/dist/indexer/project.service.test.d.ts +1 -0
  59. package/dist/indexer/project.service.test.js +26 -0
  60. package/dist/indexer/project.service.test.js.map +1 -0
  61. package/dist/indexer/sandbox.service.d.ts +1 -1
  62. package/dist/indexer/sandbox.service.js +1 -0
  63. package/dist/indexer/sandbox.service.js.map +1 -1
  64. package/dist/indexer/types.d.ts +2 -11
  65. package/dist/indexer/types.js +0 -6
  66. package/dist/indexer/types.js.map +1 -1
  67. package/dist/indexer/unfinalizedBlocks.service.d.ts +4 -4
  68. package/dist/indexer/unfinalizedBlocks.service.js +25 -1
  69. package/dist/indexer/unfinalizedBlocks.service.js.map +1 -1
  70. package/dist/indexer/worker/worker.d.ts +4 -28
  71. package/dist/indexer/worker/worker.js +8 -71
  72. package/dist/indexer/worker/worker.js.map +1 -1
  73. package/dist/indexer/worker/worker.module.js +2 -2
  74. package/dist/indexer/worker/worker.module.js.map +1 -1
  75. package/dist/indexer/worker/worker.service.d.ts +11 -13
  76. package/dist/indexer/worker/worker.service.js +14 -56
  77. package/dist/indexer/worker/worker.service.js.map +1 -1
  78. package/dist/indexer/worker/worker.unfinalizedBlocks.service.d.ts +4 -8
  79. package/dist/indexer/worker/worker.unfinalizedBlocks.service.js +8 -7
  80. package/dist/indexer/worker/worker.unfinalizedBlocks.service.js.map +1 -1
  81. package/dist/indexer/worker-fetch.module.d.ts +2 -0
  82. package/dist/indexer/{indexer.module.js → worker-fetch.module.js} +10 -33
  83. package/dist/indexer/worker-fetch.module.js.map +1 -0
  84. package/dist/init.js +1 -1
  85. package/dist/init.js.map +1 -1
  86. package/dist/main.js +4 -8
  87. package/dist/main.js.map +1 -1
  88. package/dist/subcommands/reindex.init.js +1 -2
  89. package/dist/subcommands/reindex.init.js.map +1 -1
  90. package/dist/subcommands/reindex.module.js +10 -6
  91. package/dist/subcommands/reindex.module.js.map +1 -1
  92. package/dist/subcommands/testing.init.js +2 -4
  93. package/dist/subcommands/testing.init.js.map +1 -1
  94. package/dist/subcommands/testing.module.js +3 -8
  95. package/dist/subcommands/testing.module.js.map +1 -1
  96. package/dist/subcommands/testing.service.d.ts +8 -5
  97. package/dist/subcommands/testing.service.js +3 -8
  98. package/dist/subcommands/testing.service.js.map +1 -1
  99. package/dist/utils/project.d.ts +5 -4
  100. package/dist/utils/project.js +17 -1
  101. package/dist/utils/project.js.map +1 -1
  102. package/dist/yargs.d.ts +7 -90
  103. package/dist/yargs.js +9 -112
  104. package/dist/yargs.js.map +1 -1
  105. package/package.json +8 -8
  106. package/dist/indexer/indexer.module.d.ts +0 -2
  107. package/dist/indexer/indexer.module.js.map +0 -1
  108. package/dist/subcommands/mmrMigrate.init.d.ts +0 -2
  109. package/dist/subcommands/mmrMigrate.init.js +0 -28
  110. package/dist/subcommands/mmrMigrate.init.js.map +0 -1
  111. package/dist/subcommands/mmrMigrate.module.d.ts +0 -2
  112. package/dist/subcommands/mmrMigrate.module.js +0 -28
  113. package/dist/subcommands/mmrMigrate.module.js.map +0 -1
  114. package/dist/subcommands/mmrRegenerate.init.d.ts +0 -1
  115. package/dist/subcommands/mmrRegenerate.init.js +0 -28
  116. package/dist/subcommands/mmrRegenerate.init.js.map +0 -1
  117. package/dist/subcommands/mmrRegenerate.module.d.ts +0 -2
  118. package/dist/subcommands/mmrRegenerate.module.js +0 -30
  119. package/dist/subcommands/mmrRegenerate.module.js.map +0 -1
  120. package/dist/subcommands/reindex.service.d.ts +0 -11
  121. package/dist/subcommands/reindex.service.js +0 -46
  122. package/dist/subcommands/reindex.service.js.map +0 -1
package/dist/yargs.d.ts CHANGED
@@ -1,81 +1,6 @@
1
- export declare const yargsOptions: import("yargs").Argv<import("yargs").Omit<import("yargs").Omit<import("yargs").Omit<{
1
+ export declare const yargsOptions: import("yargs").Argv<import("yargs").Omit<{
2
2
  targetHeight: number;
3
- }, "targetHeight" | "probe" | "resetOnly" | "unsafe" | "mmr-store-type" | "mmr-path" | "db-schema" | "subquery"> & import("yargs").InferredOptionTypes<{
4
- probe: {
5
- type: "boolean";
6
- description: string;
7
- demandOption: false;
8
- default: boolean;
9
- };
10
- targetHeight: {
11
- type: "number";
12
- description: string;
13
- demandOption: false;
14
- };
15
- resetOnly: {
16
- type: "boolean";
17
- description: string;
18
- demandOption: false;
19
- default: boolean;
20
- };
21
- unsafe: {
22
- type: "boolean";
23
- description: string;
24
- demandOption: false;
25
- default: boolean;
26
- };
27
- 'mmr-store-type': {
28
- demandOption: false;
29
- describe: string;
30
- type: "string";
31
- choices: string[];
32
- default: string;
33
- };
34
- 'mmr-path': {
35
- alias: string;
36
- demandOption: false;
37
- describe: string;
38
- type: "string";
39
- };
40
- 'db-schema': {
41
- demandOption: false;
42
- describe: string;
43
- type: "string";
44
- };
45
- subquery: {
46
- alias: string;
47
- demandOption: true;
48
- default: string;
49
- describe: string;
50
- type: "string";
51
- };
52
- }>, "mmr-path" | "db-schema" | "subquery" | "direction"> & import("yargs").InferredOptionTypes<{
53
- direction: {
54
- type: "string";
55
- description: string;
56
- demandOption: false;
57
- choices: string[];
58
- default: string;
59
- };
60
- 'mmr-path': {
61
- alias: string;
62
- demandOption: false;
63
- describe: string;
64
- type: "string";
65
- };
66
- 'db-schema': {
67
- demandOption: false;
68
- describe: string;
69
- type: "string";
70
- };
71
- subquery: {
72
- alias: string;
73
- demandOption: true;
74
- default: string;
75
- describe: string;
76
- type: "string";
77
- };
78
- }>, "unsafe" | "mmr-store-type" | "mmr-path" | "db-schema" | "subquery" | "batch-size" | "block-confirmations" | "config" | "debug" | "dictionary-resolver" | "dictionary-timeout" | "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-name" | "subscription" | "timeout" | "timestamp-field" | "unfinalized-blocks" | "workers" | "root" | "query-address-limit"> & import("yargs").InferredOptionTypes<{
3
+ }, "batch-size" | "block-confirmations" | "config" | "db-schema" | "debug" | "dictionary-resolver" | "dictionary-timeout" | "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<{
79
4
  'batch-size': {
80
5
  demandOption: false;
81
6
  describe: string;
@@ -136,12 +61,6 @@ export declare const yargsOptions: import("yargs").Argv<import("yargs").Omit<imp
136
61
  type: "string";
137
62
  choices: string[];
138
63
  };
139
- 'mmr-path': {
140
- alias: string;
141
- demandOption: false;
142
- describe: string;
143
- type: "string";
144
- };
145
64
  'multi-chain': {
146
65
  demandOption: false;
147
66
  default: boolean;
@@ -188,13 +107,6 @@ export declare const yargsOptions: import("yargs").Argv<import("yargs").Omit<imp
188
107
  type: "boolean";
189
108
  default: boolean;
190
109
  };
191
- 'mmr-store-type': {
192
- demandOption: false;
193
- describe: string;
194
- type: "string";
195
- choices: string[];
196
- default: string;
197
- };
198
110
  'query-limit': {
199
111
  demandOption: false;
200
112
  describe: string;
@@ -267,6 +179,11 @@ export declare const yargsOptions: import("yargs").Argv<import("yargs").Omit<imp
267
179
  type: "boolean";
268
180
  default: boolean;
269
181
  };
182
+ skipTransactions: {
183
+ demandOption: false;
184
+ describe: string;
185
+ type: "boolean";
186
+ };
270
187
  timeout: {
271
188
  demandOption: false;
272
189
  describe: string;
package/dist/yargs.js CHANGED
@@ -50,105 +50,6 @@ exports.yargsOptions = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)
50
50
  const { reindexInit } = require('./subcommands/reindex.init');
51
51
  return reindexInit(argv.targetHeight);
52
52
  },
53
- })
54
- .command({
55
- command: 'mmr-regen',
56
- describe: 'Re-generate mmr between Filebased/Postgres mmr and Proof of index',
57
- builder: (yargs) => yargs.options({
58
- probe: {
59
- type: 'boolean',
60
- description: 'Fetch latest mmr height information from file based/postgres DB and Poi table',
61
- demandOption: false,
62
- default: false,
63
- },
64
- targetHeight: {
65
- type: 'number',
66
- description: 'Re-genrate mmr value from this block height',
67
- demandOption: false,
68
- },
69
- resetOnly: {
70
- type: 'boolean',
71
- description: 'Only reset the mmr value in both POI and file based/postgres DB to target height',
72
- demandOption: false,
73
- default: false,
74
- },
75
- unsafe: {
76
- type: 'boolean',
77
- description: 'Allow sync mmr from Poi table to file or a postgres DB',
78
- demandOption: false,
79
- default: false,
80
- },
81
- 'mmr-store-type': {
82
- demandOption: false,
83
- describe: 'When regenerate MMR store in either a file or a postgres DB',
84
- type: 'string',
85
- choices: ['file', 'postgres'],
86
- default: 'postgres',
87
- },
88
- 'mmr-path': {
89
- alias: 'm',
90
- demandOption: false,
91
- describe: 'File based only : local path of the merkle mountain range (.mmr) file',
92
- type: 'string',
93
- },
94
- 'db-schema': {
95
- demandOption: false,
96
- describe: 'Db schema name of the project',
97
- type: 'string',
98
- },
99
- subquery: {
100
- alias: 'f',
101
- demandOption: true,
102
- default: process.cwd(),
103
- describe: 'Local path or IPFS cid of the subquery project',
104
- type: 'string',
105
- },
106
- }),
107
- handler: (argv) => {
108
- (0, logger_1.initLogger)(argv.debug, argv.outputFmt, argv.logLevel);
109
- // lazy import to make sure logger is instantiated before all other services
110
- // eslint-disable-next-line @typescript-eslint/no-var-requires
111
- const { mmrRegenerateInit } = require('./subcommands/mmrRegenerate.init');
112
- return mmrRegenerateInit(argv.probe, argv.resetOnly, argv.unsafe, argv.targetHeight);
113
- },
114
- })
115
- .command({
116
- command: 'mmr-migrate',
117
- describe: 'Migrate MMR data from storage file to postgres DB',
118
- builder: (yargs) => yargs.options({
119
- direction: {
120
- type: 'string',
121
- description: 'set direction of migration (file -> DB or DB -> file)',
122
- demandOption: false,
123
- choices: ['dbToFile', 'fileToDb'],
124
- default: 'dbToFile',
125
- },
126
- 'mmr-path': {
127
- alias: 'm',
128
- demandOption: false,
129
- describe: 'Local path of the merkle mountain range (.mmr) file',
130
- type: 'string',
131
- },
132
- 'db-schema': {
133
- demandOption: false,
134
- describe: 'Db schema name of the project',
135
- type: 'string',
136
- },
137
- subquery: {
138
- alias: 'f',
139
- demandOption: true,
140
- default: process.cwd(),
141
- describe: 'Local path or IPFS cid of the subquery project',
142
- type: 'string',
143
- },
144
- }),
145
- handler: (argv) => {
146
- (0, logger_1.initLogger)(argv.debug, argv.outputFmt, argv.logLevel);
147
- // lazy import to make sure logger is instantiated before all other services
148
- // eslint-disable-next-line @typescript-eslint/no-var-requires
149
- const { mmrMigrateInit } = require('./subcommands/mmrMigrate.init');
150
- return mmrMigrateInit(argv.direction);
151
- },
152
53
  })
153
54
  .options({
154
55
  'batch-size': {
@@ -193,6 +94,7 @@ exports.yargsOptions = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)
193
94
  demandOption: false,
194
95
  describe: 'Disable storing historical state entities',
195
96
  type: 'boolean',
97
+ // NOTE: don't set a default for this. It will break apply args from manifest. The default should be set in NodeConfig
196
98
  },
197
99
  ipfs: {
198
100
  demandOption: false,
@@ -211,12 +113,6 @@ exports.yargsOptions = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)
211
113
  type: 'string',
212
114
  choices: ['fatal', 'error', 'warn', 'info', 'debug', 'trace', 'silent'],
213
115
  },
214
- 'mmr-path': {
215
- alias: 'm',
216
- demandOption: false,
217
- describe: 'Local path of the merkle mountain range (.mmr) file',
218
- type: 'string',
219
- },
220
116
  'multi-chain': {
221
117
  demandOption: false,
222
118
  default: false,
@@ -263,13 +159,6 @@ exports.yargsOptions = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)
263
159
  type: 'boolean',
264
160
  default: false,
265
161
  },
266
- 'mmr-store-type': {
267
- demandOption: false,
268
- describe: 'Store MMR in either a file or a postgres DB',
269
- type: 'string',
270
- choices: ['file', 'postgres'],
271
- default: 'postgres',
272
- },
273
162
  'query-limit': {
274
163
  demandOption: false,
275
164
  describe: 'The limit of items a project can query with store.getByField at once',
@@ -343,6 +232,12 @@ exports.yargsOptions = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)
343
232
  type: 'boolean',
344
233
  default: false,
345
234
  },
235
+ skipTransactions: {
236
+ demandOption: false,
237
+ 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.`,
238
+ type: 'boolean',
239
+ // NOTE: don't set a default for this. It will break apply args from manifest. The default should be set in NodeConfig
240
+ },
346
241
  timeout: {
347
242
  demandOption: false,
348
243
  describe: 'Timeout for indexer sandbox to execute the mapping functions',
@@ -358,11 +253,13 @@ exports.yargsOptions = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)
358
253
  demandOption: false,
359
254
  describe: 'Enable to fetch and index unfinalized blocks',
360
255
  type: 'boolean',
256
+ // NOTE: don't set a default for this. It will break apply args from manifest. The default should be set in NodeConfig
361
257
  },
362
258
  unsafe: {
363
259
  type: 'boolean',
364
260
  demandOption: false,
365
261
  describe: 'Allows usage of any built-in module within the sandbox',
262
+ // NOTE: don't set a default for this. It will break apply args from manifest. The default should be set in NodeConfig
366
263
  },
367
264
  workers: {
368
265
  alias: 'w',
package/dist/yargs.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"yargs.js","sourceRoot":"","sources":["../src/yargs.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;AAEnC,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,MAAM;IACf,QAAQ,EAAE,sCAAsC;IAChD,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;QAChB,IAAA,mBAAU,EACR,IAAI,CAAC,KAAgB,EACrB,IAAI,CAAC,SAA+B,EACpC,IAAI,CAAC,QAA8B,CACpC,CAAC;QACF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QAClB,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE;QACtB,QAAQ,EAAE,gDAAgD;QAC1D,IAAI,EAAE,QAAQ;KACf;IACD,eAAe,EAAE;QACf,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,KAAK;QACnB,QAAQ,EAAE,8BAA8B;QACxC,IAAI,EAAE,QAAQ;KACf;IACD,YAAY,EAAE;QACZ,YAAY,EAAE,KAAK;QACnB,QAAQ,EAAE,qDAAqD;QAC/D,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;KACf;IACD,OAAO,EAAE;QACP,YAAY,EAAE,KAAK;QACnB,QAAQ,EAAE,8DAA8D;QACxE,IAAI,EAAE,QAAQ;KACf;IACD,iBAAiB,EAAE;QACjB,YAAY,EAAE,KAAK;QACnB,QAAQ,EAAE,oDAAoD;QAC9D,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;KACf;IACD,oBAAoB,EAAE;QACpB,YAAY,EAAE,KAAK;QACnB,QAAQ,EAAE,8CAA8C;QACxD,IAAI,EAAE,SAAS;KAChB;IACD,MAAM,EAAE;QACN,IAAI,EAAE,SAAS;QACf,YAAY,EAAE,KAAK;QACnB,QAAQ,EAAE,wDAAwD;KACnE;IACD,OAAO,EAAE;QACP,KAAK,EAAE,GAAG;QACV,YAAY,EAAE,KAAK;QACnB,QAAQ,EACN,0FAA0F;QAC5F,IAAI,EAAE,QAAQ;KACf;IACD,IAAI,EAAE;QACJ,QAAQ,EACN,wKAAwK;QAC1K,IAAI,EAAE,QAAQ;KACf;IACD,qBAAqB,EAAE;QACrB,QAAQ,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 { 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 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 { 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 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 .command({\n command: 'mmr-regen',\n describe:\n 'Re-generate mmr between Filebased/Postgres mmr and Proof of index',\n builder: (yargs) =>\n yargs.options({\n probe: {\n type: 'boolean',\n description:\n 'Fetch latest mmr height information from file based/postgres DB and Poi table',\n demandOption: false,\n default: false,\n },\n targetHeight: {\n type: 'number',\n description: 'Re-genrate mmr value from this block height',\n demandOption: false,\n },\n resetOnly: {\n type: 'boolean',\n description:\n 'Only reset the mmr value in both POI and file based/postgres DB to target height',\n demandOption: false,\n default: false,\n },\n unsafe: {\n type: 'boolean',\n description: 'Allow sync mmr from Poi table to file or a postgres DB',\n demandOption: false,\n default: false,\n },\n 'mmr-store-type': {\n demandOption: false,\n describe:\n 'When regenerate MMR store in either a file or a postgres DB',\n type: 'string',\n choices: ['file', 'postgres'],\n default: 'postgres',\n },\n 'mmr-path': {\n alias: 'm',\n demandOption: false,\n describe:\n 'File based only : local path of the merkle mountain range (.mmr) file',\n type: 'string',\n },\n 'db-schema': {\n demandOption: false,\n describe: 'Db schema name of the project',\n type: 'string',\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 }),\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 { mmrRegenerateInit } = require('./subcommands/mmrRegenerate.init');\n return mmrRegenerateInit(\n argv.probe,\n argv.resetOnly,\n argv.unsafe,\n argv.targetHeight,\n );\n },\n })\n .command({\n command: 'mmr-migrate',\n describe: 'Migrate MMR data from storage file to postgres DB',\n builder: (yargs) =>\n yargs.options({\n direction: {\n type: 'string',\n description: 'set direction of migration (file -> DB or DB -> file)',\n demandOption: false,\n choices: ['dbToFile', 'fileToDb'],\n default: 'dbToFile',\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 'db-schema': {\n demandOption: false,\n describe: 'Db schema name of the project',\n type: 'string',\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 }),\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 { mmrMigrateInit } = require('./subcommands/mmrMigrate.init');\n return mmrMigrateInit(argv.direction);\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:\n 'Show debug information to console output. will forcefully set log level to debug',\n type: 'boolean',\n default: false,\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 'disable-historical': {\n demandOption: false,\n describe: 'Disable storing historical state entities',\n type: 'boolean',\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 'mmr-path': {\n alias: 'm',\n demandOption: false,\n describe: 'Local path of the merkle mountain range (.mmr) file',\n type: 'string',\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 'mmr-store-type': {\n demandOption: false,\n describe: 'Store MMR in either a file or a postgres DB',\n type: 'string',\n choices: ['file', 'postgres'],\n default: 'postgres',\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 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 },\n unsafe: {\n type: 'boolean',\n demandOption: false,\n describe: 'Allows usage of any built-in module within the sandbox',\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,oDAAqD;AAErD,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,MAAM;IACf,QAAQ,EAAE,sCAAsC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AAY,EAAE;QACZ,YAAY,EAAE,KAAK;QACnB,QAAQ,EAAE,qDAAqD;QAC/D,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;KACf;IACD,gBAAgB,EAAE;QAChB,YAAY,EAAE,KAAK;QACnB,QAAQ,EAAE,kQAAkQ;QAC5Q,IAAI,EAAE,SAAS;QACf,sHAAsH;KACvH;IACD,OAAO,EAAE;QACP,YAAY,EAAE,KAAK;QACnB,QAAQ,EAAE,8DAA8D;QACxE,IAAI,EAAE,QAAQ;KACf;IACD,iBAAiB,EAAE;QACjB,YAAY,EAAE,KAAK;QACnB,QAAQ,EAAE,oDAAoD;QAC9D,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;KACf;IACD,oBAAoB,EAAE;QACpB,YAAY,EAAE,KAAK;QACnB,QAAQ,EAAE,8CAA8C;QACxD,IAAI,EAAE,SAAS;QACf,sHAAsH;KACvH;IACD,MAAM,EAAE;QACN,IAAI,EAAE,SAAS;QACf,YAAY,EAAE,KAAK;QACnB,QAAQ,EAAE,wDAAwD;QAClE,sHAAsH;KACvH;IACD,OAAO,EAAE;QACP,KAAK,EAAE,GAAG;QACV,YAAY,EAAE,KAAK;QACnB,QAAQ,EACN,0FAA0F;QAC5F,IAAI,EAAE,QAAQ;KACf;IACD,IAAI,EAAE;QACJ,QAAQ,EACN,wKAAwK;QAC1K,IAAI,EAAE,QAAQ;KACf;IACD,qBAAqB,EAAE;QACrB,QAAQ,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 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 { 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 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 '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:\n 'Show debug information to console output. will forcefully set log level to debug',\n type: 'boolean',\n default: false,\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 '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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@subql/node-ethereum",
3
- "version": "2.12.6-1",
3
+ "version": "2.12.6-2",
4
4
  "description": "",
5
5
  "author": "Ian He",
6
6
  "license": "GPL-3.0",
@@ -24,12 +24,12 @@
24
24
  "@nestjs/event-emitter": "^2.0.0",
25
25
  "@nestjs/platform-express": "^9.4.0",
26
26
  "@nestjs/schedule": "^3.0.1",
27
- "@subql/common": "2.6.0",
28
- "@subql/common-ethereum": "2.3.1-0",
29
- "@subql/node-core": "^4.2.9",
30
- "@subql/testing": "^2.0.0",
31
- "@subql/types": "^2.1.4",
32
- "@subql/types-ethereum": "2.2.5",
27
+ "@subql/common": "3.0.1",
28
+ "@subql/common-ethereum": "2.3.1-1",
29
+ "@subql/node-core": "5.0.1",
30
+ "@subql/testing": "^2.0.2",
31
+ "@subql/types": "^3.0.1",
32
+ "@subql/types-ethereum": "2.2.6-0",
33
33
  "cacheable-lookup": "6",
34
34
  "cron-converter": "^1.0.2",
35
35
  "ethers": "^5.7.0",
@@ -66,5 +66,5 @@
66
66
  "/dist",
67
67
  "/bin"
68
68
  ],
69
- "stableVersion": "2.12.6-0"
69
+ "stableVersion": "2.12.6-1"
70
70
  }
@@ -1,2 +0,0 @@
1
- export declare class IndexerModule {
2
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"indexer.module.js","sourceRoot":"","sources":["../../src/indexer/indexer.module.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;AAEnC,mDAA8C;AAC9C,2CAAwC;AACxC,yDAAsD;AACtD,gDAa0B;AAE1B,0CAAiD;AAEjD,iEAA4D;AAC5D,6DAAwD;AACxD,uDAAmD;AACnD,uDAAmD;AACnD,uDAAmD;AACnD,2EAAuE;AACvE,4DAAwD;AACxD,gGAA2F;AAyEpF,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,aAAa;IAvEzB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT,gCAAc;YACd,6BAAiB;YACjB,wBAAY;YACZ;gBACE,OAAO,EAAE,sCAA0B;gBACnC,UAAU,EAAE,GAAG,EAAE;oBACf,IAAI,6BAAY,EAAE;wBAChB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;qBACjD;oBACD,OAAO,IAAI,4CAAgC,CAAE,MAAc,CAAC,IAAI,CAAC,CAAC;gBACpE,CAAC;aACF;YACD,iCAAqB;YACrB;gBACE,OAAO,EAAE,sBAAU;gBACnB,UAAU,EAAE,KAAK,EACf,OAAwB,EACxB,qBAAmE,EACnE,YAA2B,EAC3B,UAAsB,EACtB,EAAE;oBACF,MAAM,UAAU,GAAG,IAAI,6BAAkB,CACvC,OAAO,EACP,qBAAqB,EACrB,YAAY,EACZ,UAAU,CACX,CAAC;oBACF,MAAM,UAAU,CAAC,IAAI,EAAE,CAAC;oBACxB,OAAO,UAAU,CAAC;gBACpB,CAAC;gBACD,MAAM,EAAE;oBACN,kBAAkB;oBAClB,iCAAqB;oBACrB,6BAAa;oBACb,sBAAU;iBACX;aACF;YACD,gCAAc;YACd,yCAAkB;YAClB;gBACE,OAAO,EAAE,qCAAgB;gBACzB,UAAU,EAAE,GAAG,EAAE;oBACf,IAAI,6BAAY,EAAE;wBAChB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;qBACjD;oBACD,OAAO,IAAI,kCAAsB,CAAE,MAAc,CAAC,IAAI,CAAC,CAAC;gBAC1D,CAAC;aACF;YACD,sBAAU;YACV,sBAAU;YACV,6BAAiB;YACjB,2BAAe;YACf;gBACE,OAAO,EAAE,iBAAiB;gBAC1B,QAAQ,EAAE,gCAAc;aACzB;YACD,8BAAa;YACb;gBACE,OAAO,EAAE,oDAAwB;gBACjC,UAAU,EAAE,GAAG,EAAE;oBACf,IAAI,6BAAY,EAAE;wBAChB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;qBACjD;oBACD,OAAO,IAAI,iEAA8B,CAAE,MAAc,CAAC,IAAI,CAAC,CAAC;gBAClE,CAAC;aACF;SACF;QACD,OAAO,EAAE,CAAC,wBAAY,EAAE,sBAAU,EAAE,2BAAe,CAAC;KACrD,CAAC;GACW,aAAa,CAAG;AAAhB,sCAAa","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { isMainThread } from 'worker_threads';\nimport { Module } from '@nestjs/common';\nimport { EventEmitter2 } from '@nestjs/event-emitter';\nimport {\n ApiService,\n StoreService,\n PoiService,\n MmrService,\n ConnectionPoolService,\n StoreCacheService,\n WorkerDynamicDsService,\n WorkerConnectionPoolStateManager,\n ConnectionPoolStateManager,\n NodeConfig,\n PgMmrCacheService,\n MmrQueryService,\n} from '@subql/node-core';\nimport { SubqueryProject } from '../configure/SubqueryProject';\nimport { EthereumApiService } from '../ethereum';\nimport { EthereumApiConnection } from '../ethereum/api.connection';\nimport { DsProcessorService } from './ds-processor.service';\nimport { DynamicDsService } from './dynamic-ds.service';\nimport { IndexerManager } from './indexer.manager';\nimport { ProjectService } from './project.service';\nimport { SandboxService } from './sandbox.service';\nimport { UnfinalizedBlocksService } from './unfinalizedBlocks.service';\nimport { WorkerService } from './worker/worker.service';\nimport { WorkerUnfinalizedBlocksService } from './worker/worker.unfinalizedBlocks.service';\n\n@Module({\n providers: [\n IndexerManager,\n StoreCacheService,\n StoreService,\n {\n provide: ConnectionPoolStateManager,\n useFactory: () => {\n if (isMainThread) {\n throw new Error('Expected to be worker thread');\n }\n return new WorkerConnectionPoolStateManager((global as any).host);\n },\n },\n ConnectionPoolService,\n {\n provide: ApiService,\n useFactory: async (\n project: SubqueryProject,\n connectionPoolService: ConnectionPoolService<EthereumApiConnection>,\n eventEmitter: EventEmitter2,\n nodeConfig: NodeConfig,\n ) => {\n const apiService = new EthereumApiService(\n project,\n connectionPoolService,\n eventEmitter,\n nodeConfig,\n );\n await apiService.init();\n return apiService;\n },\n inject: [\n 'ISubqueryProject',\n ConnectionPoolService,\n EventEmitter2,\n NodeConfig,\n ],\n },\n SandboxService,\n DsProcessorService,\n {\n provide: DynamicDsService,\n useFactory: () => {\n if (isMainThread) {\n throw new Error('Expected to be worker thread');\n }\n return new WorkerDynamicDsService((global as any).host);\n },\n },\n PoiService,\n MmrService,\n PgMmrCacheService,\n MmrQueryService,\n {\n provide: 'IProjectService',\n useClass: ProjectService,\n },\n WorkerService,\n {\n provide: UnfinalizedBlocksService,\n useFactory: () => {\n if (isMainThread) {\n throw new Error('Expected to be worker thread');\n }\n return new WorkerUnfinalizedBlocksService((global as any).host);\n },\n },\n ],\n exports: [StoreService, MmrService, MmrQueryService],\n})\nexport class IndexerModule {}\n"]}
@@ -1,2 +0,0 @@
1
- import { MigrationDirection } from '@subql/node-core';
2
- export declare function mmrMigrateInit(direction: MigrationDirection): Promise<void>;
@@ -1,28 +0,0 @@
1
- "use strict";
2
- // Copyright 2020-2023 SubQuery Pte Ltd authors & contributors
3
- // SPDX-License-Identifier: GPL-3.0
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.mmrMigrateInit = void 0;
6
- const core_1 = require("@nestjs/core");
7
- const node_core_1 = require("@subql/node-core");
8
- const mmrMigrate_module_1 = require("./mmrMigrate.module");
9
- const logger = (0, node_core_1.getLogger)('mmr-migrate');
10
- async function mmrMigrateInit(direction) {
11
- try {
12
- logger.info('Starting MMR migration process...');
13
- const app = await core_1.NestFactory.create(mmrMigrate_module_1.MMRMigrateModule);
14
- await app.init();
15
- logger.info('MMRMigrateModule initialized.');
16
- const mmrMigrateService = app.get(node_core_1.MMRMigrateService);
17
- logger.info(`Migrating MMR data in ${direction} direction...`);
18
- await mmrMigrateService.migrate(direction);
19
- logger.info('MMR migration completed successfully.');
20
- }
21
- catch (e) {
22
- logger.error(e, 'MMR migration failed to execute');
23
- process.exit(1);
24
- }
25
- process.exit(0);
26
- }
27
- exports.mmrMigrateInit = mmrMigrateInit;
28
- //# sourceMappingURL=mmrMigrate.init.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mmrMigrate.init.js","sourceRoot":"","sources":["../../src/subcommands/mmrMigrate.init.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;AAEnC,uCAA2C;AAC3C,gDAI0B;AAC1B,2DAAuD;AAEvD,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,aAAa,CAAC,CAAC;AAEjC,KAAK,UAAU,cAAc,CAClC,SAA6B;IAE7B,IAAI;QACF,MAAM,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;QAEjD,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAC,oCAAgB,CAAC,CAAC;QACvD,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAEjB,MAAM,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;QAE7C,MAAM,iBAAiB,GAAG,GAAG,CAAC,GAAG,CAAC,6BAAiB,CAAC,CAAC;QACrD,MAAM,CAAC,IAAI,CAAC,yBAAyB,SAAS,eAAe,CAAC,CAAC;QAC/D,MAAM,iBAAiB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAE3C,MAAM,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;KACtD;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,iCAAiC,CAAC,CAAC;QACnD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAtBD,wCAsBC","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { NestFactory } from '@nestjs/core';\nimport {\n getLogger,\n MigrationDirection,\n MMRMigrateService,\n} from '@subql/node-core';\nimport { MMRMigrateModule } from './mmrMigrate.module';\n\nconst logger = getLogger('mmr-migrate');\n\nexport async function mmrMigrateInit(\n direction: MigrationDirection,\n): Promise<void> {\n try {\n logger.info('Starting MMR migration process...');\n\n const app = await NestFactory.create(MMRMigrateModule);\n await app.init();\n\n logger.info('MMRMigrateModule initialized.');\n\n const mmrMigrateService = app.get(MMRMigrateService);\n logger.info(`Migrating MMR data in ${direction} direction...`);\n await mmrMigrateService.migrate(direction);\n\n logger.info('MMR migration completed successfully.');\n } catch (e) {\n logger.error(e, 'MMR migration failed to execute');\n process.exit(1);\n }\n\n process.exit(0);\n}\n"]}
@@ -1,2 +0,0 @@
1
- export declare class MMRMigrateModule {
2
- }
@@ -1,28 +0,0 @@
1
- "use strict";
2
- // Copyright 2020-2023 SubQuery Pte Ltd authors & contributors
3
- // SPDX-License-Identifier: GPL-3.0
4
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
5
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
7
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
8
- return c > 3 && r && Object.defineProperty(target, key, r), r;
9
- };
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.MMRMigrateModule = void 0;
12
- const common_1 = require("@nestjs/common");
13
- const node_core_1 = require("@subql/node-core");
14
- const configure_module_1 = require("../configure/configure.module");
15
- let MMRMigrateModule = class MMRMigrateModule {
16
- };
17
- MMRMigrateModule = __decorate([
18
- (0, common_1.Module)({
19
- imports: [
20
- node_core_1.DbModule.forRoot(),
21
- configure_module_1.ConfigureModule.register(),
22
- node_core_1.MMRMigrateFeatureModule,
23
- ],
24
- controllers: [],
25
- })
26
- ], MMRMigrateModule);
27
- exports.MMRMigrateModule = MMRMigrateModule;
28
- //# sourceMappingURL=mmrMigrate.module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mmrMigrate.module.js","sourceRoot":"","sources":["../../src/subcommands/mmrMigrate.module.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;AAEnC,2CAAwC;AACxC,gDAAqE;AACrE,oEAAgE;AAUzD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAAG,CAAA;AAAnB,gBAAgB;IAR5B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,oBAAQ,CAAC,OAAO,EAAE;YAClB,kCAAe,CAAC,QAAQ,EAAE;YAC1B,mCAAuB;SACxB;QACD,WAAW,EAAE,EAAE;KAChB,CAAC;GACW,gBAAgB,CAAG;AAAnB,4CAAgB","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { Module } from '@nestjs/common';\nimport { DbModule, MMRMigrateFeatureModule } from '@subql/node-core';\nimport { ConfigureModule } from '../configure/configure.module';\n\n@Module({\n imports: [\n DbModule.forRoot(),\n ConfigureModule.register(),\n MMRMigrateFeatureModule,\n ],\n controllers: [],\n})\nexport class MMRMigrateModule {}\n"]}
@@ -1 +0,0 @@
1
- export declare function mmrRegenerateInit(probeMode?: boolean, resetOnly?: boolean, unsafe?: boolean, targetHeight?: number): Promise<void>;
@@ -1,28 +0,0 @@
1
- "use strict";
2
- // Copyright 2020-2023 SubQuery Pte Ltd authors & contributors
3
- // SPDX-License-Identifier: GPL-3.0
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.mmrRegenerateInit = void 0;
6
- const core_1 = require("@nestjs/core");
7
- const node_core_1 = require("@subql/node-core");
8
- const mmrRegenerate_module_1 = require("./mmrRegenerate.module");
9
- const logger = (0, node_core_1.getLogger)('MMR-Regeneration');
10
- async function mmrRegenerateInit(probeMode = false, resetOnly = false, unsafe = false, targetHeight) {
11
- try {
12
- const app = await core_1.NestFactory.create(mmrRegenerate_module_1.MmrRegenerateModule);
13
- await app.init();
14
- const mmrRegenerateService = app.get(node_core_1.MmrRegenerateService);
15
- app.enableShutdownHooks();
16
- await mmrRegenerateService.init();
17
- if (!probeMode) {
18
- await mmrRegenerateService.regenerate(targetHeight, resetOnly, unsafe);
19
- }
20
- }
21
- catch (e) {
22
- logger.error(e, 'Re-generate MMR failed to execute');
23
- process.exit(1);
24
- }
25
- process.exit(0);
26
- }
27
- exports.mmrRegenerateInit = mmrRegenerateInit;
28
- //# sourceMappingURL=mmrRegenerate.init.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mmrRegenerate.init.js","sourceRoot":"","sources":["../../src/subcommands/mmrRegenerate.init.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;AAEnC,uCAA2C;AAC3C,gDAAmE;AACnE,iEAA6D;AAE7D,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,kBAAkB,CAAC,CAAC;AAEtC,KAAK,UAAU,iBAAiB,CACrC,SAAS,GAAG,KAAK,EACjB,SAAS,GAAG,KAAK,EACjB,MAAM,GAAG,KAAK,EACd,YAAqB;IAErB,IAAI;QACF,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAC,0CAAmB,CAAC,CAAC;QAC1D,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QACjB,MAAM,oBAAoB,GAAG,GAAG,CAAC,GAAG,CAAC,gCAAoB,CAAC,CAAC;QAC3D,GAAG,CAAC,mBAAmB,EAAE,CAAC;QAC1B,MAAM,oBAAoB,CAAC,IAAI,EAAE,CAAC;QAClC,IAAI,CAAC,SAAS,EAAE;YACd,MAAM,oBAAoB,CAAC,UAAU,CAAC,YAAY,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;SACxE;KACF;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,mCAAmC,CAAC,CAAC;QACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AApBD,8CAoBC","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { NestFactory } from '@nestjs/core';\nimport { getLogger, MmrRegenerateService } from '@subql/node-core';\nimport { MmrRegenerateModule } from './mmrRegenerate.module';\n\nconst logger = getLogger('MMR-Regeneration');\n\nexport async function mmrRegenerateInit(\n probeMode = false,\n resetOnly = false,\n unsafe = false,\n targetHeight?: number,\n): Promise<void> {\n try {\n const app = await NestFactory.create(MmrRegenerateModule);\n await app.init();\n const mmrRegenerateService = app.get(MmrRegenerateService);\n app.enableShutdownHooks();\n await mmrRegenerateService.init();\n if (!probeMode) {\n await mmrRegenerateService.regenerate(targetHeight, resetOnly, unsafe);\n }\n } catch (e) {\n logger.error(e, 'Re-generate MMR failed to execute');\n process.exit(1);\n }\n process.exit(0);\n}\n"]}
@@ -1,2 +0,0 @@
1
- export declare class MmrRegenerateModule {
2
- }
@@ -1,30 +0,0 @@
1
- "use strict";
2
- // Copyright 2020-2023 SubQuery Pte Ltd authors & contributors
3
- // SPDX-License-Identifier: GPL-3.0
4
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
5
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
7
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
8
- return c > 3 && r && Object.defineProperty(target, key, r), r;
9
- };
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.MmrRegenerateModule = void 0;
12
- const common_1 = require("@nestjs/common");
13
- const event_emitter_1 = require("@nestjs/event-emitter");
14
- const node_core_1 = require("@subql/node-core");
15
- const configure_module_1 = require("../configure/configure.module");
16
- let MmrRegenerateModule = class MmrRegenerateModule {
17
- };
18
- MmrRegenerateModule = __decorate([
19
- (0, common_1.Module)({
20
- imports: [
21
- node_core_1.DbModule.forRoot(),
22
- configure_module_1.ConfigureModule.register(),
23
- node_core_1.MmrRegenerateFeatureModule,
24
- event_emitter_1.EventEmitterModule.forRoot(),
25
- ],
26
- controllers: [],
27
- })
28
- ], MmrRegenerateModule);
29
- exports.MmrRegenerateModule = MmrRegenerateModule;
30
- //# sourceMappingURL=mmrRegenerate.module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mmrRegenerate.module.js","sourceRoot":"","sources":["../../src/subcommands/mmrRegenerate.module.ts"],"names":[],"mappings":";AAAA,8DAA8D;AAC9D,mCAAmC;;;;;;;;;AAEnC,2CAAwC;AACxC,yDAA2D;AAC3D,gDAAwE;AACxE,oEAAgE;AAWzD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAAG,CAAA;AAAtB,mBAAmB;IAT/B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,oBAAQ,CAAC,OAAO,EAAE;YAClB,kCAAe,CAAC,QAAQ,EAAE;YAC1B,sCAA0B;YAC1B,kCAAkB,CAAC,OAAO,EAAE;SAC7B;QACD,WAAW,EAAE,EAAE;KAChB,CAAC;GACW,mBAAmB,CAAG;AAAtB,kDAAmB","sourcesContent":["// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors\n// SPDX-License-Identifier: GPL-3.0\n\nimport { Module } from '@nestjs/common';\nimport { EventEmitterModule } from '@nestjs/event-emitter';\nimport { DbModule, MmrRegenerateFeatureModule } from '@subql/node-core';\nimport { ConfigureModule } from '../configure/configure.module';\n\n@Module({\n imports: [\n DbModule.forRoot(),\n ConfigureModule.register(),\n MmrRegenerateFeatureModule,\n EventEmitterModule.forRoot(),\n ],\n controllers: [],\n})\nexport class MmrRegenerateModule {}\n"]}
@@ -1,11 +0,0 @@
1
- import { SubqlEthereumDataSource } from '@subql/common-ethereum';
2
- import { MmrService, NodeConfig, StoreService, ForceCleanService, BaseReindexService } from '@subql/node-core';
3
- import { BlockWrapper } from '@subql/types-ethereum';
4
- import { Sequelize } from '@subql/x-sequelize';
5
- import { SubqueryProject } from '../configure/SubqueryProject';
6
- import { DynamicDsService } from '../indexer/dynamic-ds.service';
7
- import { UnfinalizedBlocksService } from '../indexer/unfinalizedBlocks.service';
8
- export declare class ReindexService extends BaseReindexService<SubqueryProject, SubqlEthereumDataSource, BlockWrapper> {
9
- constructor(sequelize: Sequelize, nodeConfig: NodeConfig, storeService: StoreService, mmrService: MmrService, project: SubqueryProject, forceCleanService: ForceCleanService, unfinalizedBlocksService: UnfinalizedBlocksService, dynamicDsService: DynamicDsService);
10
- protected getStartBlockDatasources(): Promise<SubqlEthereumDataSource[]>;
11
- }