@subql/node-ethereum 1.10.1-2 → 2.0.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.
Files changed (143) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/README.md +3 -2
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/configure/SubqueryProject.d.ts +9 -11
  5. package/dist/configure/SubqueryProject.js +19 -9
  6. package/dist/configure/SubqueryProject.js.map +1 -1
  7. package/dist/configure/configure.module.js +5 -7
  8. package/dist/configure/configure.module.js.map +1 -1
  9. package/dist/ethereum/api.connection.d.ts +11 -0
  10. package/dist/ethereum/api.connection.js +27 -0
  11. package/dist/ethereum/api.connection.js.map +1 -0
  12. package/dist/ethereum/api.ethereum.d.ts +18 -5
  13. package/dist/ethereum/api.ethereum.js +138 -81
  14. package/dist/ethereum/api.ethereum.js.map +1 -1
  15. package/dist/ethereum/api.service.ethereum.d.ts +11 -3
  16. package/dist/ethereum/api.service.ethereum.js +68 -18
  17. package/dist/ethereum/api.service.ethereum.js.map +1 -1
  18. package/dist/ethereum/api.service.ethereum.test.d.ts +1 -0
  19. package/dist/ethereum/api.service.ethereum.test.js +73 -0
  20. package/dist/ethereum/api.service.ethereum.test.js.map +1 -0
  21. package/dist/ethereum/block.ethereum.d.ts +1 -1
  22. package/dist/ethereum/block.ethereum.js +10 -12
  23. package/dist/ethereum/block.ethereum.js.map +1 -1
  24. package/dist/ethereum/ethers/json-rpc-batch-provider.d.ts +21 -0
  25. package/dist/ethereum/ethers/json-rpc-batch-provider.js +114 -0
  26. package/dist/ethereum/ethers/json-rpc-batch-provider.js.map +1 -0
  27. package/dist/ethereum/ethers/json-rpc-provider.d.ts +7 -0
  28. package/dist/ethereum/ethers/json-rpc-provider.js +68 -0
  29. package/dist/ethereum/ethers/json-rpc-provider.js.map +1 -0
  30. package/dist/ethereum/ethers/web/_version.d.ts +1 -0
  31. package/dist/ethereum/ethers/web/_version.js +6 -0
  32. package/dist/ethereum/ethers/web/_version.js.map +1 -0
  33. package/dist/ethereum/ethers/web/geturl.d.ts +3 -0
  34. package/dist/ethereum/ethers/web/geturl.js +116 -0
  35. package/dist/ethereum/ethers/web/geturl.js.map +1 -0
  36. package/dist/ethereum/ethers/web/index.d.ts +49 -0
  37. package/dist/ethereum/ethers/web/index.js +437 -0
  38. package/dist/ethereum/ethers/web/index.js.map +1 -0
  39. package/dist/ethereum/ethers/web/types.d.ts +26 -0
  40. package/dist/ethereum/ethers/web/types.js +4 -0
  41. package/dist/ethereum/ethers/web/types.js.map +1 -0
  42. package/dist/ethereum/safe-api.d.ts +34 -0
  43. package/dist/ethereum/safe-api.js +114 -0
  44. package/dist/ethereum/safe-api.js.map +1 -0
  45. package/dist/ethereum/utils.ethereum.d.ts +1 -1
  46. package/dist/ethereum/utils.ethereum.js +22 -87
  47. package/dist/ethereum/utils.ethereum.js.map +1 -1
  48. package/dist/indexer/blockDispatcher/block-dispatcher.service.d.ts +17 -0
  49. package/dist/indexer/blockDispatcher/block-dispatcher.service.js +55 -0
  50. package/dist/indexer/blockDispatcher/block-dispatcher.service.js.map +1 -0
  51. package/dist/indexer/blockDispatcher/ethereum-block-dispatcher.d.ts +4 -0
  52. package/dist/indexer/blockDispatcher/ethereum-block-dispatcher.js +5 -0
  53. package/dist/indexer/blockDispatcher/ethereum-block-dispatcher.js.map +1 -0
  54. package/dist/indexer/blockDispatcher/index.d.ts +4 -0
  55. package/dist/indexer/blockDispatcher/index.js +10 -0
  56. package/dist/indexer/blockDispatcher/index.js.map +1 -0
  57. package/dist/indexer/blockDispatcher/worker-block-dispatcher.service.d.ts +15 -0
  58. package/dist/indexer/blockDispatcher/worker-block-dispatcher.service.js +88 -0
  59. package/dist/indexer/blockDispatcher/worker-block-dispatcher.service.js.map +1 -0
  60. package/dist/indexer/dictionary.service.d.ts +1 -0
  61. package/dist/indexer/dictionary.service.js +22 -2
  62. package/dist/indexer/dictionary.service.js.map +1 -1
  63. package/dist/indexer/ds-processor.service.d.ts +1 -1
  64. package/dist/indexer/ds-processor.service.js +4 -0
  65. package/dist/indexer/ds-processor.service.js.map +1 -1
  66. package/dist/indexer/dynamic-ds.service.d.ts +3 -19
  67. package/dist/indexer/dynamic-ds.service.js +20 -72
  68. package/dist/indexer/dynamic-ds.service.js.map +1 -1
  69. package/dist/indexer/fetch.module.js +40 -12
  70. package/dist/indexer/fetch.module.js.map +1 -1
  71. package/dist/indexer/fetch.service.d.ts +16 -7
  72. package/dist/indexer/fetch.service.js +188 -78
  73. package/dist/indexer/fetch.service.js.map +1 -1
  74. package/dist/indexer/indexer.manager.d.ts +11 -17
  75. package/dist/indexer/indexer.manager.js +68 -71
  76. package/dist/indexer/indexer.manager.js.map +1 -1
  77. package/dist/indexer/indexer.module.js +32 -8
  78. package/dist/indexer/indexer.module.js.map +1 -1
  79. package/dist/indexer/project.service.d.ts +11 -8
  80. package/dist/indexer/project.service.js +76 -82
  81. package/dist/indexer/project.service.js.map +1 -1
  82. package/dist/indexer/sandbox.service.js +11 -2
  83. package/dist/indexer/sandbox.service.js.map +1 -1
  84. package/dist/indexer/types.d.ts +2 -1
  85. package/dist/indexer/types.js.map +1 -1
  86. package/dist/indexer/unfinalizedBlocks.service.d.ts +36 -0
  87. package/dist/indexer/unfinalizedBlocks.service.js +197 -0
  88. package/dist/indexer/unfinalizedBlocks.service.js.map +1 -0
  89. package/dist/indexer/unfinalizedBlocks.spec.d.ts +1 -0
  90. package/dist/indexer/unfinalizedBlocks.spec.js +195 -0
  91. package/dist/indexer/unfinalizedBlocks.spec.js.map +1 -0
  92. package/dist/indexer/worker/worker.d.ts +22 -6
  93. package/dist/indexer/worker/worker.js +16 -3
  94. package/dist/indexer/worker/worker.js.map +1 -1
  95. package/dist/indexer/worker/worker.service.d.ts +10 -6
  96. package/dist/indexer/worker/worker.service.js +23 -10
  97. package/dist/indexer/worker/worker.service.js.map +1 -1
  98. package/dist/indexer/worker/worker.unfinalizedBlocks.service.d.ts +11 -0
  99. package/dist/indexer/worker/worker.unfinalizedBlocks.service.js +32 -0
  100. package/dist/indexer/worker/worker.unfinalizedBlocks.service.js.map +1 -0
  101. package/dist/init.js +2 -2
  102. package/dist/init.js.map +1 -1
  103. package/dist/main.js +6 -1
  104. package/dist/main.js.map +1 -1
  105. package/dist/meta/meta.module.js +8 -0
  106. package/dist/meta/meta.module.js.map +1 -1
  107. package/dist/meta/meta.service.d.ts +18 -3
  108. package/dist/meta/meta.service.js +89 -5
  109. package/dist/meta/meta.service.js.map +1 -1
  110. package/dist/subcommands/forceClean.service.d.ts +3 -1
  111. package/dist/subcommands/forceClean.service.js +30 -6
  112. package/dist/subcommands/forceClean.service.js.map +1 -1
  113. package/dist/subcommands/reindex.init.js +6 -1
  114. package/dist/subcommands/reindex.init.js.map +1 -1
  115. package/dist/subcommands/reindex.module.js +20 -1
  116. package/dist/subcommands/reindex.module.js.map +1 -1
  117. package/dist/subcommands/reindex.service.d.ts +7 -3
  118. package/dist/subcommands/reindex.service.js +44 -50
  119. package/dist/subcommands/reindex.service.js.map +1 -1
  120. package/dist/subcommands/testing.init.d.ts +1 -0
  121. package/dist/subcommands/testing.init.js +34 -0
  122. package/dist/subcommands/testing.init.js.map +1 -0
  123. package/dist/subcommands/testing.module.d.ts +4 -0
  124. package/dist/subcommands/testing.module.js +77 -0
  125. package/dist/subcommands/testing.module.js.map +1 -0
  126. package/dist/subcommands/testing.service.d.ts +9 -0
  127. package/dist/subcommands/testing.service.js +43 -0
  128. package/dist/subcommands/testing.service.js.map +1 -0
  129. package/dist/utils/project.d.ts +3 -0
  130. package/dist/utils/project.js +45 -1
  131. package/dist/utils/project.js.map +1 -1
  132. package/dist/utils/reindex.d.ts +6 -0
  133. package/dist/utils/reindex.js +48 -0
  134. package/dist/utils/reindex.js.map +1 -0
  135. package/dist/utils/string.js +10 -2
  136. package/dist/utils/string.js.map +1 -1
  137. package/dist/yargs.d.ts +97 -49
  138. package/dist/yargs.js +130 -69
  139. package/dist/yargs.js.map +1 -1
  140. package/package.json +13 -12
  141. package/dist/indexer/worker/block-dispatcher.service.d.ts +0 -69
  142. package/dist/indexer/worker/block-dispatcher.service.js +0 -356
  143. package/dist/indexer/worker/block-dispatcher.service.js.map +0 -1
package/dist/yargs.js CHANGED
@@ -10,6 +10,19 @@ const logger_1 = require("@subql/node-core/logger");
10
10
  const helpers_1 = require("yargs/helpers");
11
11
  const yargs_1 = __importDefault(require("yargs/yargs"));
12
12
  exports.yargsOptions = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
13
+ .env('SUBQL_NODE')
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);
20
+ // lazy import to make sure logger is instantiated before all other services
21
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
22
+ const { testingInit } = require('./subcommands/testing.init');
23
+ return testingInit();
24
+ },
25
+ })
13
26
  .command({
14
27
  command: 'force-clean',
15
28
  describe: 'Clean the database dropping project schemas and tables. Once the command is executed, the application would exit upon completion.',
@@ -39,18 +52,16 @@ exports.yargsOptions = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)
39
52
  },
40
53
  })
41
54
  .options({
42
- subquery: {
43
- alias: 'f',
44
- demandOption: true,
45
- default: process.cwd(),
46
- describe: 'Local path or IPFS cid of the subquery project',
47
- type: 'string',
55
+ 'batch-size': {
56
+ demandOption: false,
57
+ describe: 'Batch size of blocks to fetch in one round',
58
+ type: 'number',
48
59
  },
49
- 'subquery-name': {
50
- deprecated: true,
60
+ 'block-confirmations': {
51
61
  demandOption: false,
52
- describe: 'Name of the subquery project',
53
- type: 'string',
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',
54
65
  },
55
66
  config: {
56
67
  alias: 'c',
@@ -58,55 +69,68 @@ exports.yargsOptions = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)
58
69
  describe: 'Specify configuration file',
59
70
  type: 'string',
60
71
  },
61
- local: {
62
- deprecated: true,
63
- type: 'boolean',
64
- demandOption: false,
65
- describe: 'Use local mode',
66
- },
67
72
  'db-schema': {
68
73
  demandOption: false,
69
74
  describe: 'Db schema name of the project',
70
75
  type: 'string',
71
76
  },
72
- unsafe: {
73
- type: 'boolean',
77
+ debug: {
74
78
  demandOption: false,
75
- describe: 'Allows usage of any built-in module within the sandbox',
79
+ describe: 'Show debug information to console output. will forcefully set log level to debug',
80
+ type: 'boolean',
81
+ default: false,
76
82
  },
77
- subscription: {
83
+ 'dictionary-resolver': {
78
84
  demandOption: false,
79
- describe: 'Enable subscription by create notification triggers',
85
+ describe: 'Use SubQuery Network dictionary resolver',
80
86
  type: 'boolean',
81
87
  default: false,
82
88
  },
83
- 'batch-size': {
89
+ 'dictionary-timeout': {
84
90
  demandOption: false,
85
- describe: 'Batch size of blocks to fetch in one round',
91
+ describe: 'Max timeout for dictionary query',
86
92
  type: 'number',
87
93
  },
88
- 'scale-batch-size': {
89
- type: 'boolean',
94
+ 'disable-historical': {
90
95
  demandOption: false,
91
- describe: 'scale batch size based on memory usage',
92
96
  default: false,
97
+ describe: 'Disable storing historical state entities',
98
+ type: 'boolean',
93
99
  },
94
- timeout: {
100
+ ipfs: {
95
101
  demandOption: false,
96
- describe: 'Timeout for indexer sandbox to execute the mapping functions',
97
- type: 'number',
102
+ describe: 'IPFS gateway endpoint',
103
+ type: 'string',
98
104
  },
99
- debug: {
100
- demandOption: false,
101
- describe: 'Show debug information to console output. will forcefully set log level to debug',
105
+ local: {
106
+ deprecated: true,
102
107
  type: 'boolean',
103
- default: false,
108
+ demandOption: false,
109
+ describe: 'Use local mode',
104
110
  },
105
- profiler: {
111
+ 'log-level': {
112
+ demandOption: false,
113
+ describe: 'Specify log level to print. Ignored when --debug is used',
114
+ type: 'string',
115
+ choices: ['fatal', 'error', 'warn', 'info', 'debug', 'trace', 'silent'],
116
+ },
117
+ 'mmr-path': {
118
+ alias: 'm',
119
+ demandOption: false,
120
+ describe: 'Local path of the merkle mountain range (.mmr) file',
121
+ type: 'string',
122
+ },
123
+ 'multi-chain': {
106
124
  demandOption: false,
107
- describe: 'Show profiler information to console output',
108
- type: 'boolean',
109
125
  default: false,
126
+ describe: 'Enables indexing multiple subquery projects into the same database schema',
127
+ type: 'boolean',
128
+ },
129
+ 'network-dictionary': {
130
+ alias: 'd',
131
+ demandOption: false,
132
+ describe: 'Specify the dictionary api for this network',
133
+ type: 'string',
110
134
  },
111
135
  'network-endpoint': {
112
136
  demandOption: false,
@@ -119,75 +143,112 @@ exports.yargsOptions = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)
119
143
  type: 'string',
120
144
  choices: ['json', 'colored'],
121
145
  },
122
- 'log-level': {
146
+ port: {
147
+ alias: 'p',
123
148
  demandOption: false,
124
- describe: 'Specify log level to print. Ignored when --debug is used',
125
- type: 'string',
126
- choices: ['fatal', 'error', 'warn', 'info', 'debug', 'trace', 'silent'],
149
+ describe: 'The port the service will bind to',
150
+ type: 'number',
127
151
  },
128
- migrate: {
152
+ profiler: {
129
153
  demandOption: false,
130
- describe: 'Migrate db schema (for management tables only)',
154
+ describe: 'Show profiler information to console output',
131
155
  type: 'boolean',
132
156
  default: false,
133
157
  },
134
- 'timestamp-field': {
158
+ 'proof-of-index': {
135
159
  demandOption: false,
136
- describe: 'Enable/disable created_at and updated_at in schema',
160
+ describe: 'Enable/disable proof of index',
137
161
  type: 'boolean',
138
162
  default: false,
139
163
  },
140
- 'network-dictionary': {
141
- alias: 'd',
164
+ 'query-limit': {
142
165
  demandOption: false,
143
- describe: 'Specify the dictionary api for this network',
166
+ describe: 'The limit of items a project can query with store.getByField at once',
167
+ type: 'number',
168
+ default: 100,
169
+ },
170
+ 'scale-batch-size': {
171
+ type: 'boolean',
172
+ demandOption: false,
173
+ describe: 'scale batch size based on memory usage',
174
+ default: false,
175
+ },
176
+ 'pg-ca': {
177
+ demandOption: false,
178
+ 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',
144
179
  type: 'string',
145
180
  },
146
- 'dictionary-timeout': {
181
+ 'pg-key': {
147
182
  demandOption: false,
148
- describe: 'Max timeout for dictionary query',
149
- type: 'number',
183
+ describe: 'Postgres client key - Path to key file e.g /path/to/client-key/postgresql.key',
184
+ type: 'string',
150
185
  },
151
- 'mmr-path': {
152
- alias: 'm',
186
+ 'pg-cert': {
153
187
  demandOption: false,
154
- describe: 'Local path of the merkle mountain range (.mmr) file',
188
+ describe: 'Postgres client certificate - Path to client certificate e.g /path/to/client-certificates/postgresql.crt',
155
189
  type: 'string',
156
190
  },
157
- 'proof-of-index': {
191
+ 'store-cache-threshold': {
158
192
  demandOption: false,
159
- describe: 'Enable/disable proof of index',
193
+ describe: 'Store cache will flush data to the database when number of records excess this threshold',
194
+ type: 'number',
195
+ },
196
+ 'store-get-cache-size': {
197
+ demandOption: false,
198
+ describe: 'Store get cache size for each model',
199
+ type: 'number',
200
+ },
201
+ 'store-cache-async': {
202
+ demandOption: false,
203
+ describe: 'If enabled the store cache will flush data asyncronously relative to indexing data',
160
204
  type: 'boolean',
161
- default: false,
162
205
  },
163
- ipfs: {
206
+ subquery: {
207
+ alias: 'f',
208
+ demandOption: true,
209
+ default: process.cwd(),
210
+ describe: 'Local path or IPFS cid of the subquery project',
211
+ type: 'string',
212
+ },
213
+ 'subquery-name': {
214
+ deprecated: true,
164
215
  demandOption: false,
165
- describe: 'IPFS gateway endpoint',
216
+ describe: 'Name of the subquery project',
166
217
  type: 'string',
167
218
  },
168
- port: {
169
- alias: 'p',
219
+ subscription: {
170
220
  demandOption: false,
171
- describe: 'The port the service will bind to',
221
+ describe: 'Enable subscription by create notification triggers',
222
+ type: 'boolean',
223
+ default: false,
224
+ },
225
+ timeout: {
226
+ demandOption: false,
227
+ describe: 'Timeout for indexer sandbox to execute the mapping functions',
172
228
  type: 'number',
173
229
  },
174
- 'disable-historical': {
230
+ 'timestamp-field': {
175
231
  demandOption: false,
232
+ describe: 'Enable/disable created_at and updated_at in schema',
233
+ type: 'boolean',
176
234
  default: false,
177
- describe: 'Disable storing historical state entities',
235
+ },
236
+ 'unfinalized-blocks': {
237
+ demandOption: false,
238
+ default: false,
239
+ describe: 'Enable to fetch and index unfinalized blocks',
178
240
  type: 'boolean',
179
241
  },
242
+ unsafe: {
243
+ type: 'boolean',
244
+ demandOption: false,
245
+ describe: 'Allows usage of any built-in module within the sandbox',
246
+ },
180
247
  workers: {
181
248
  alias: 'w',
182
249
  demandOption: false,
183
250
  describe: 'Number of worker threads to use for fetching and processing blocks. Disabled by default.',
184
251
  type: 'number',
185
252
  },
186
- 'query-limit': {
187
- demandOption: false,
188
- describe: 'The limit of items a project can query with store.getByField at once',
189
- type: 'number',
190
- default: 100,
191
- },
192
253
  });
193
254
  //# 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,gEAAgE;AAChE,sCAAsC;;;;;;AAEtC,oDAAqD;AACrD,2CAAwC;AACxC,wDAAgC;AAEnB,QAAA,YAAY,GAAG,IAAA,eAAK,EAAC,IAAA,iBAAO,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KACrD,OAAO,CAAC;IACP,OAAO,EAAE,aAAa;IACtB,QAAQ,EACN,mIAAmI;IACrI,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;QAEF,4EAA4E;QAC5E,8DAA8D;QAC9D,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;QACpE,OAAO,cAAc,EAAE,CAAC;IAC1B,CAAC;CACF,CAAC;KACD,OA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AAQ;QACd,OAAO,EAAE,GAAG;KACb;CACF,CAAC,CAAC","sourcesContent":["// Copyright 2020-2022 OnFinality Limited authors & contributors\n// SPDX-License-Identifier: Apache-2.0\n\nimport { initLogger } from '@subql/node-core/logger';\nimport { hideBin } from 'yargs/helpers';\nimport yargs from 'yargs/yargs';\n\nexport const yargsOptions = yargs(hideBin(process.argv))\n .command({\n command: 'force-clean',\n describe:\n 'Clean the database dropping project schemas and tables. Once the command is executed, the application would exit upon completion.',\n builder: {},\n handler: (argv) => {\n initLogger(\n argv.debug as boolean,\n argv.outputFmt as 'json' | 'colored',\n argv.logLevel as string | undefined,\n );\n\n // lazy import to make sure logger is instantiated before all other services\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { forceCleanInit } = require('./subcommands/forceClean.init');\n return forceCleanInit();\n },\n })\n .command({\n command: 'reindex',\n describe:\n 'Reindex to specified block height. Historical must be enabled for the targeted project (--disable-historical=false). Once the command is executed, the application would exit upon completion.',\n builder: (yargs) =>\n yargs.options('targetHeight', {\n type: 'number',\n description: 'set targetHeight',\n require: true,\n }),\n handler: (argv) => {\n initLogger(\n argv.debug as boolean,\n argv.outputFmt as 'json' | 'colored',\n argv.logLevel as string | undefined,\n );\n // lazy import to make sure logger is instantiated before all other services\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { reindexInit } = require('./subcommands/reindex.init');\n return reindexInit(argv.targetHeight);\n },\n })\n .options({\n subquery: {\n alias: 'f',\n demandOption: true,\n default: process.cwd(),\n describe: 'Local path or IPFS cid of the subquery project',\n type: 'string',\n },\n 'subquery-name': {\n deprecated: true,\n demandOption: false,\n describe: 'Name of the subquery project',\n type: 'string',\n },\n config: {\n alias: 'c',\n demandOption: false,\n describe: 'Specify configuration file',\n type: 'string',\n },\n local: {\n deprecated: true,\n type: 'boolean',\n demandOption: false,\n describe: 'Use local mode',\n },\n 'db-schema': {\n demandOption: false,\n describe: 'Db schema name of the project',\n type: 'string',\n },\n unsafe: {\n type: 'boolean',\n demandOption: false,\n describe: 'Allows usage of any built-in module within the sandbox',\n },\n subscription: {\n demandOption: false,\n describe: 'Enable subscription by create notification triggers',\n type: 'boolean',\n default: false,\n },\n 'batch-size': {\n demandOption: false,\n describe: 'Batch size of blocks to fetch in one round',\n type: 'number',\n },\n 'scale-batch-size': {\n type: 'boolean',\n demandOption: false,\n describe: 'scale batch size based on memory usage',\n default: false,\n },\n timeout: {\n demandOption: false,\n describe: 'Timeout for indexer sandbox to execute the mapping functions',\n type: 'number',\n },\n debug: {\n demandOption: false,\n describe:\n 'Show debug information to console output. will forcefully set log level to debug',\n type: 'boolean',\n default: false,\n },\n profiler: {\n demandOption: false,\n describe: 'Show profiler information to console output',\n type: 'boolean',\n default: false,\n },\n 'network-endpoint': {\n demandOption: false,\n type: 'string',\n describe: 'Blockchain network endpoint to connect',\n },\n 'output-fmt': {\n demandOption: false,\n describe: 'Print log as json or plain text',\n type: 'string',\n choices: ['json', 'colored'],\n },\n 'log-level': {\n demandOption: false,\n describe: 'Specify log level to print. Ignored when --debug is used',\n type: 'string',\n choices: ['fatal', 'error', 'warn', 'info', 'debug', 'trace', 'silent'],\n },\n migrate: {\n demandOption: false,\n describe: 'Migrate db schema (for management tables only)',\n type: 'boolean',\n default: false,\n },\n 'timestamp-field': {\n demandOption: false,\n describe: 'Enable/disable created_at and updated_at in schema',\n type: 'boolean',\n default: false,\n },\n 'network-dictionary': {\n alias: 'd',\n demandOption: false,\n describe: 'Specify the dictionary api for this network',\n type: 'string',\n },\n 'dictionary-timeout': {\n demandOption: false,\n describe: 'Max timeout for dictionary query',\n type: 'number',\n },\n 'mmr-path': {\n alias: 'm',\n demandOption: false,\n describe: 'Local path of the merkle mountain range (.mmr) file',\n type: 'string',\n },\n 'proof-of-index': {\n demandOption: false,\n describe: 'Enable/disable proof of index',\n type: 'boolean',\n default: false,\n },\n ipfs: {\n demandOption: false,\n describe: 'IPFS gateway endpoint',\n type: 'string',\n },\n port: {\n alias: 'p',\n demandOption: false,\n describe: 'The port the service will bind to',\n type: 'number',\n },\n 'disable-historical': {\n demandOption: false,\n default: false,\n describe: 'Disable storing historical state entities',\n type: 'boolean',\n },\n workers: {\n alias: 'w',\n demandOption: false,\n describe:\n 'Number of worker threads to use for fetching and processing blocks. Disabled by default.',\n type: 'number',\n },\n 'query-limit': {\n demandOption: false,\n describe:\n 'The limit of items a project can query with store.getByField at once',\n type: 'number',\n default: 100,\n },\n });\n"]}
1
+ {"version":3,"file":"yargs.js","sourceRoot":"","sources":["../src/yargs.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,sCAAsC;;;;;;AAEtC,oDAAqD;AACrD,2CAAwC;AACxC,wDAAgC;AAEnB,QAAA,YAAY,GAAG,IAAA,eAAK,EAAC,IAAA,iBAAO,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KACrD,GAAG,CAAC,YAAY,CAAC;KACjB,OAAO,CAAC;IACP,OAAO,EAAE,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,4EAA4E;QAC5E,8DAA8D;QAC9D,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;QAC9D,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;CACF,CAAC;KACD,OAAO,CAAC;IACP,OAAO,EAAE,aAAa;IACtB,QAAQ,EACN,mIAAmI;IACrI,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;QAEF,4EAA4E;QAC5E,8DAA8D;QAC9D,MAAM,EAAE,cAAc,EAAE,GAAG,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AAI,EAAE,QAAQ;KACf;IACD,mBAAmB,EAAE;QACnB,YAAY,EAAE,KAAK;QACnB,QAAQ,EACN,oFAAoF;QACtF,IAAI,EAAE,SAAS;KAChB;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,GAAG;QACV,YAAY,EAAE,IAAI;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,OAAO,EAAE,KAAK;QACd,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;CACF,CAAC,CAAC","sourcesContent":["// Copyright 2020-2022 OnFinality Limited authors & contributors\n// SPDX-License-Identifier: Apache-2.0\n\nimport { initLogger } from '@subql/node-core/logger';\nimport { hideBin } from 'yargs/helpers';\nimport yargs from 'yargs/yargs';\n\nexport const yargsOptions = yargs(hideBin(process.argv))\n .env('SUBQL_NODE')\n .command({\n command: '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: 'boolean',\n default: false,\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 default: 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 '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-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 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 default: 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 });\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@subql/node-ethereum",
3
- "version": "1.10.1-2",
3
+ "version": "2.0.0",
4
4
  "description": "",
5
5
  "author": "Ian He",
6
6
  "license": "Apache-2.0",
@@ -24,18 +24,20 @@
24
24
  "@nestjs/event-emitter": "^1.3.0",
25
25
  "@nestjs/platform-express": "^8.2.6",
26
26
  "@nestjs/schedule": "^1.0.2",
27
- "@subql/common": "latest",
28
- "@subql/common-ethereum": "0.0.1-1",
29
- "@subql/node-core": "latest",
30
- "@subql/types-ethereum": "0.0.1-1",
31
- "@subql/utils": "latest",
27
+ "@subql/common": "^2.0.0",
28
+ "@subql/common-ethereum": "2.0.0",
29
+ "@subql/node-core": "^2.0.3-0",
30
+ "@subql/testing": "^2.0.0",
31
+ "@subql/types-ethereum": "2.0.0",
32
+ "@subql/utils": "^2.0.0",
32
33
  "@subql/x-merkle-mountain-range": "2.0.0-0.1.2",
33
34
  "@willsoto/nestjs-prometheus": "^4.4.0",
34
35
  "algosdk": "^1.13.1",
35
36
  "app-module-path": "^2.2.0",
37
+ "cacheable-lookup": "6",
36
38
  "cron-converter": "^1.0.2",
37
39
  "dayjs": "^1.10.7",
38
- "ethers": "^5.6.1",
40
+ "ethers": "^5.7.0",
39
41
  "eventemitter2": "^6.4.5",
40
42
  "lodash": "^4.17.21",
41
43
  "merkle-tools": "^1.4.1",
@@ -45,9 +47,8 @@
45
47
  "reflect-metadata": "^0.1.13",
46
48
  "rimraf": "^3.0.2",
47
49
  "rxjs": "^7.5.2",
48
- "sequelize": "6.23.0",
50
+ "sequelize": "6.28.0",
49
51
  "tar": "^6.1.11",
50
- "typescript": "^4.4.4",
51
52
  "web3-providers-http": "^1.8.0",
52
53
  "web3-providers-ws": "^1.8.0",
53
54
  "yargs": "^16.2.0"
@@ -68,11 +69,11 @@
68
69
  "supertest": "^6.2.2"
69
70
  },
70
71
  "resolutions": {
71
- "@polkadot/util": "^9"
72
+ "@polkadot/util": "11.1.1",
73
+ "node-fetch": "2.6.7"
72
74
  },
73
75
  "files": [
74
76
  "/dist",
75
77
  "/bin"
76
- ],
77
- "stableVersion": "1.10.1-1"
78
+ ]
78
79
  }
@@ -1,69 +0,0 @@
1
- import { OnApplicationShutdown } from '@nestjs/common';
2
- import { EventEmitter2 } from '@nestjs/event-emitter';
3
- import { ApiService, NodeConfig } from '@subql/node-core';
4
- import { IndexerManager } from '../indexer.manager';
5
- import { ProjectService } from '../project.service';
6
- export interface IBlockDispatcher {
7
- init(onDynamicDsCreated: (height: number) => Promise<void>): Promise<void>;
8
- enqueueBlocks(heights: number[]): void;
9
- queueSize: number;
10
- freeSize: number;
11
- latestBufferedHeight: number | undefined;
12
- flushQueue(height: number): void;
13
- }
14
- /**
15
- * @description Intended to behave the same as WorkerBlockDispatcherService but doesn't use worker threads or any parallel processing
16
- */
17
- export declare class BlockDispatcherService implements IBlockDispatcher, OnApplicationShutdown {
18
- private apiService;
19
- private nodeConfig;
20
- private indexerManager;
21
- private eventEmitter;
22
- private projectService;
23
- private fetchQueue;
24
- private processQueue;
25
- private fetching;
26
- private isShutdown;
27
- private onDynamicDsCreated;
28
- private _latestBufferedHeight;
29
- private _processedBlockCount;
30
- private fetchBlocksBatches;
31
- private latestProcessedHeight;
32
- constructor(apiService: ApiService, nodeConfig: NodeConfig, indexerManager: IndexerManager, eventEmitter: EventEmitter2, projectService: ProjectService);
33
- init(onDynamicDsCreated: (height: number) => Promise<void>): Promise<void>;
34
- onApplicationShutdown(): void;
35
- enqueueBlocks(heights: number[]): void;
36
- flushQueue(height: number): void;
37
- private setProcessedBlockCount;
38
- private fetchBlocksFromQueue;
39
- get queueSize(): number;
40
- get freeSize(): number;
41
- get latestBufferedHeight(): number;
42
- set latestBufferedHeight(height: number);
43
- }
44
- export declare class WorkerBlockDispatcherService implements IBlockDispatcher, OnApplicationShutdown {
45
- private nodeConfig;
46
- private eventEmitter;
47
- private projectService;
48
- private workers;
49
- private numWorkers;
50
- private onDynamicDsCreated;
51
- private taskCounter;
52
- private isShutdown;
53
- private queue;
54
- private _latestBufferedHeight;
55
- private _processedBlockCount;
56
- constructor(nodeConfig: NodeConfig, eventEmitter: EventEmitter2, projectService: ProjectService);
57
- init(onDynamicDsCreated: (height: number) => Promise<void>): Promise<void>;
58
- private setProcessedBlockCount;
59
- onApplicationShutdown(): Promise<void>;
60
- enqueueBlocks(heights: number[]): void;
61
- flushQueue(height: number): void;
62
- private enqueueBlock;
63
- sampleWorkerStatus(): Promise<void>;
64
- get queueSize(): number;
65
- get freeSize(): number;
66
- get latestBufferedHeight(): number;
67
- set latestBufferedHeight(height: number);
68
- private getNextWorkerIndex;
69
- }