envio 0.0.40 → 0.9.9-branch-test-cache
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/evm.schema.json +499 -0
- package/fuel.schema.json +212 -0
- package/package.json +16 -11
- package/package.json.tmpl +0 -58
- package/src/index.ts +0 -39
- package/tsconfig.json +0 -12
package/evm.schema.json
ADDED
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "Envio Config Schema",
|
|
4
|
+
"description": "Schema for a YAML config for an envio indexer",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"description": {
|
|
8
|
+
"description": "Description of the project",
|
|
9
|
+
"type": [
|
|
10
|
+
"string",
|
|
11
|
+
"null"
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
"name": {
|
|
15
|
+
"description": "Name of the project",
|
|
16
|
+
"type": "string"
|
|
17
|
+
},
|
|
18
|
+
"ecosystem": {
|
|
19
|
+
"description": "Ecosystem of the project.",
|
|
20
|
+
"anyOf": [
|
|
21
|
+
{
|
|
22
|
+
"$ref": "#/$defs/EcosystemTag"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"type": "null"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"schema": {
|
|
30
|
+
"description": "Custom path to schema.yaml file",
|
|
31
|
+
"type": [
|
|
32
|
+
"string",
|
|
33
|
+
"null"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"contracts": {
|
|
37
|
+
"description": "Global contract definitions that must contain all definitions except addresses. You can share a single handler/abi/event definitions for contracts across multiple chains.",
|
|
38
|
+
"type": [
|
|
39
|
+
"array",
|
|
40
|
+
"null"
|
|
41
|
+
],
|
|
42
|
+
"items": {
|
|
43
|
+
"$ref": "#/$defs/GlobalContract_for_ContractConfig"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"networks": {
|
|
47
|
+
"description": "Configuration of the blockchain networks that the project is deployed on.",
|
|
48
|
+
"type": "array",
|
|
49
|
+
"items": {
|
|
50
|
+
"$ref": "#/$defs/Network"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"unordered_multichain_mode": {
|
|
54
|
+
"description": "A flag to indicate if the indexer should use a single queue for all chains or a queue per chain (default: false)",
|
|
55
|
+
"type": [
|
|
56
|
+
"boolean",
|
|
57
|
+
"null"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"event_decoder": {
|
|
61
|
+
"description": "The event decoder to use for the indexer (default: hypersync-client)",
|
|
62
|
+
"anyOf": [
|
|
63
|
+
{
|
|
64
|
+
"$ref": "#/$defs/EventDecoder"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"type": "null"
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
"rollback_on_reorg": {
|
|
72
|
+
"description": "A flag to indicate if the indexer should rollback to the last known valid block on a reorg. This currently incurs a performance hit on historical sync and is recommended to turn this off while developing (default: true)",
|
|
73
|
+
"type": [
|
|
74
|
+
"boolean",
|
|
75
|
+
"null"
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
"save_full_history": {
|
|
79
|
+
"description": "A flag to indicate if the indexer should save the full history of events. This is useful for debugging but will increase the size of the database (default: false)",
|
|
80
|
+
"type": [
|
|
81
|
+
"boolean",
|
|
82
|
+
"null"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"field_selection": {
|
|
86
|
+
"description": "An object representing additional fields to add to the event passed to handlers.",
|
|
87
|
+
"anyOf": [
|
|
88
|
+
{
|
|
89
|
+
"$ref": "#/$defs/FieldSelection"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"type": "null"
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
"raw_events": {
|
|
97
|
+
"description": "If true, the indexer will store the raw event data in the database. This is useful for debugging, but will increase the size of the database and the amount of time it takes to process events (default: false)",
|
|
98
|
+
"type": [
|
|
99
|
+
"boolean",
|
|
100
|
+
"null"
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"additionalProperties": false,
|
|
105
|
+
"required": [
|
|
106
|
+
"name",
|
|
107
|
+
"networks"
|
|
108
|
+
],
|
|
109
|
+
"$defs": {
|
|
110
|
+
"EcosystemTag": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"enum": [
|
|
113
|
+
"evm"
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
"GlobalContract_for_ContractConfig": {
|
|
117
|
+
"type": "object",
|
|
118
|
+
"properties": {
|
|
119
|
+
"name": {
|
|
120
|
+
"description": "A unique project-wide name for this contract (no spaces)",
|
|
121
|
+
"type": "string"
|
|
122
|
+
},
|
|
123
|
+
"abi_file_path": {
|
|
124
|
+
"description": "Relative path (from config) to a json abi. If this is used then each configured event should simply be referenced by its name",
|
|
125
|
+
"type": [
|
|
126
|
+
"string",
|
|
127
|
+
"null"
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
"handler": {
|
|
131
|
+
"description": "The relative path to a file where handlers are registered for the given contract",
|
|
132
|
+
"type": "string"
|
|
133
|
+
},
|
|
134
|
+
"events": {
|
|
135
|
+
"description": "A list of events that should be indexed on this contract",
|
|
136
|
+
"type": "array",
|
|
137
|
+
"items": {
|
|
138
|
+
"$ref": "#/$defs/EventConfig"
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"additionalProperties": false,
|
|
143
|
+
"required": [
|
|
144
|
+
"name",
|
|
145
|
+
"handler",
|
|
146
|
+
"events"
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
"EventConfig": {
|
|
150
|
+
"type": "object",
|
|
151
|
+
"properties": {
|
|
152
|
+
"event": {
|
|
153
|
+
"description": "The human readable signature of an event 'eg. Transfer(address indexed from, address indexed to, uint256 value)' OR a reference to the name of an event in a json ABI file defined in your contract config. A provided signature will take precedence over what is defined in the json ABI",
|
|
154
|
+
"type": "string"
|
|
155
|
+
},
|
|
156
|
+
"name": {
|
|
157
|
+
"description": "Name of the event in the HyperIndex generated code. When ommitted, the event field will be used. Should be unique per contract",
|
|
158
|
+
"type": [
|
|
159
|
+
"string",
|
|
160
|
+
"null"
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"additionalProperties": false,
|
|
165
|
+
"required": [
|
|
166
|
+
"event"
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
"Network": {
|
|
170
|
+
"type": "object",
|
|
171
|
+
"properties": {
|
|
172
|
+
"id": {
|
|
173
|
+
"description": "Public chain/network id",
|
|
174
|
+
"type": "integer",
|
|
175
|
+
"format": "uint64",
|
|
176
|
+
"minimum": 0
|
|
177
|
+
},
|
|
178
|
+
"rpc_config": {
|
|
179
|
+
"description": "RPC Config that will be used to subscribe to blockchain data on this network (TIP: This is optional and in most cases does not need to be specified if the network is supported with HyperSync. We recommend using HyperSync instead of RPC for 100x speed-up)",
|
|
180
|
+
"anyOf": [
|
|
181
|
+
{
|
|
182
|
+
"$ref": "#/$defs/RpcConfig"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"type": "null"
|
|
186
|
+
}
|
|
187
|
+
]
|
|
188
|
+
},
|
|
189
|
+
"hypersync_config": {
|
|
190
|
+
"description": "Optional HyperSync Config for additional fine-tuning",
|
|
191
|
+
"anyOf": [
|
|
192
|
+
{
|
|
193
|
+
"$ref": "#/$defs/HypersyncConfig"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"type": "null"
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
"confirmed_block_threshold": {
|
|
201
|
+
"description": "The number of blocks from the head that the indexer should account for in case of reorgs.",
|
|
202
|
+
"type": [
|
|
203
|
+
"integer",
|
|
204
|
+
"null"
|
|
205
|
+
],
|
|
206
|
+
"format": "int32"
|
|
207
|
+
},
|
|
208
|
+
"start_block": {
|
|
209
|
+
"description": "The block at which the indexer should start ingesting data",
|
|
210
|
+
"type": "integer",
|
|
211
|
+
"format": "int32"
|
|
212
|
+
},
|
|
213
|
+
"end_block": {
|
|
214
|
+
"description": "The block at which the indexer should terminate.",
|
|
215
|
+
"type": [
|
|
216
|
+
"integer",
|
|
217
|
+
"null"
|
|
218
|
+
],
|
|
219
|
+
"format": "int32"
|
|
220
|
+
},
|
|
221
|
+
"contracts": {
|
|
222
|
+
"description": "All the contracts that should be indexed on the given network",
|
|
223
|
+
"type": "array",
|
|
224
|
+
"items": {
|
|
225
|
+
"$ref": "#/$defs/NetworkContract_for_ContractConfig"
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
"additionalProperties": false,
|
|
230
|
+
"required": [
|
|
231
|
+
"id",
|
|
232
|
+
"start_block",
|
|
233
|
+
"contracts"
|
|
234
|
+
]
|
|
235
|
+
},
|
|
236
|
+
"RpcConfig": {
|
|
237
|
+
"type": "object",
|
|
238
|
+
"properties": {
|
|
239
|
+
"url": {
|
|
240
|
+
"description": "URL of the RPC endpoint. Can be a single URL or an array of URLs. If multiple URLs are provided, the first one will be used as the primary RPC endpoint and the rest will be used as fallbacks.",
|
|
241
|
+
"anyOf": [
|
|
242
|
+
{
|
|
243
|
+
"type": "string"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"type": "array",
|
|
247
|
+
"items": {
|
|
248
|
+
"type": "string"
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
]
|
|
252
|
+
},
|
|
253
|
+
"initial_block_interval": {
|
|
254
|
+
"description": "The starting interval in range of blocks per query",
|
|
255
|
+
"type": [
|
|
256
|
+
"integer",
|
|
257
|
+
"null"
|
|
258
|
+
],
|
|
259
|
+
"format": "uint32",
|
|
260
|
+
"minimum": 0
|
|
261
|
+
},
|
|
262
|
+
"backoff_multiplicative": {
|
|
263
|
+
"description": "After an RPC error, how much to scale back the number of blocks requested at once",
|
|
264
|
+
"type": [
|
|
265
|
+
"number",
|
|
266
|
+
"null"
|
|
267
|
+
],
|
|
268
|
+
"format": "double"
|
|
269
|
+
},
|
|
270
|
+
"acceleration_additive": {
|
|
271
|
+
"description": "Without RPC errors or timeouts, how much to increase the number of blocks requested by for the next batch",
|
|
272
|
+
"type": [
|
|
273
|
+
"integer",
|
|
274
|
+
"null"
|
|
275
|
+
],
|
|
276
|
+
"format": "uint32",
|
|
277
|
+
"minimum": 0
|
|
278
|
+
},
|
|
279
|
+
"interval_ceiling": {
|
|
280
|
+
"description": "Do not further increase the block interval past this limit",
|
|
281
|
+
"type": [
|
|
282
|
+
"integer",
|
|
283
|
+
"null"
|
|
284
|
+
],
|
|
285
|
+
"format": "uint32",
|
|
286
|
+
"minimum": 0
|
|
287
|
+
},
|
|
288
|
+
"backoff_millis": {
|
|
289
|
+
"description": "After an error, how long to wait before retrying",
|
|
290
|
+
"type": [
|
|
291
|
+
"integer",
|
|
292
|
+
"null"
|
|
293
|
+
],
|
|
294
|
+
"format": "uint32",
|
|
295
|
+
"minimum": 0
|
|
296
|
+
},
|
|
297
|
+
"fallback_stall_timeout": {
|
|
298
|
+
"description": "If a fallback RPC is provided, the amount of time in ms to wait before kicking off the next provider",
|
|
299
|
+
"type": [
|
|
300
|
+
"integer",
|
|
301
|
+
"null"
|
|
302
|
+
],
|
|
303
|
+
"format": "uint32",
|
|
304
|
+
"minimum": 0
|
|
305
|
+
},
|
|
306
|
+
"query_timeout_millis": {
|
|
307
|
+
"description": "How long to wait before cancelling an RPC request",
|
|
308
|
+
"type": [
|
|
309
|
+
"integer",
|
|
310
|
+
"null"
|
|
311
|
+
],
|
|
312
|
+
"format": "uint32",
|
|
313
|
+
"minimum": 0
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
"additionalProperties": false,
|
|
317
|
+
"required": [
|
|
318
|
+
"url"
|
|
319
|
+
]
|
|
320
|
+
},
|
|
321
|
+
"HypersyncConfig": {
|
|
322
|
+
"type": "object",
|
|
323
|
+
"properties": {
|
|
324
|
+
"url": {
|
|
325
|
+
"description": "URL of the HyperSync endpoint (default: The most performant HyperSync endpoint for the network)",
|
|
326
|
+
"type": "string"
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
"additionalProperties": false,
|
|
330
|
+
"required": [
|
|
331
|
+
"url"
|
|
332
|
+
]
|
|
333
|
+
},
|
|
334
|
+
"NetworkContract_for_ContractConfig": {
|
|
335
|
+
"type": "object",
|
|
336
|
+
"properties": {
|
|
337
|
+
"name": {
|
|
338
|
+
"description": "A unique project-wide name for this contract if events and handler are defined OR a reference to the name of contract defined globally at the top level",
|
|
339
|
+
"type": "string"
|
|
340
|
+
},
|
|
341
|
+
"address": {
|
|
342
|
+
"description": "A single address or a list of addresses to be indexed. This can be left as null in the case where this contracts addresses will be registered dynamically.",
|
|
343
|
+
"$ref": "#/$defs/Addresses"
|
|
344
|
+
},
|
|
345
|
+
"abi_file_path": {
|
|
346
|
+
"description": "Relative path (from config) to a json abi. If this is used then each configured event should simply be referenced by its name",
|
|
347
|
+
"type": [
|
|
348
|
+
"string",
|
|
349
|
+
"null"
|
|
350
|
+
]
|
|
351
|
+
},
|
|
352
|
+
"handler": {
|
|
353
|
+
"description": "The relative path to a file where handlers are registered for the given contract",
|
|
354
|
+
"type": "string"
|
|
355
|
+
},
|
|
356
|
+
"events": {
|
|
357
|
+
"description": "A list of events that should be indexed on this contract",
|
|
358
|
+
"type": "array",
|
|
359
|
+
"items": {
|
|
360
|
+
"$ref": "#/$defs/EventConfig"
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
"additionalProperties": false,
|
|
365
|
+
"required": [
|
|
366
|
+
"name"
|
|
367
|
+
]
|
|
368
|
+
},
|
|
369
|
+
"Addresses": {
|
|
370
|
+
"anyOf": [
|
|
371
|
+
{
|
|
372
|
+
"anyOf": [
|
|
373
|
+
{
|
|
374
|
+
"type": "string"
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
"type": "integer",
|
|
378
|
+
"format": "uint",
|
|
379
|
+
"minimum": 0
|
|
380
|
+
}
|
|
381
|
+
]
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
"type": "array",
|
|
385
|
+
"items": {
|
|
386
|
+
"anyOf": [
|
|
387
|
+
{
|
|
388
|
+
"type": "string"
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"type": "integer",
|
|
392
|
+
"format": "uint",
|
|
393
|
+
"minimum": 0
|
|
394
|
+
}
|
|
395
|
+
]
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
]
|
|
399
|
+
},
|
|
400
|
+
"EventDecoder": {
|
|
401
|
+
"type": "string",
|
|
402
|
+
"enum": [
|
|
403
|
+
"viem",
|
|
404
|
+
"hypersync-client"
|
|
405
|
+
]
|
|
406
|
+
},
|
|
407
|
+
"FieldSelection": {
|
|
408
|
+
"type": "object",
|
|
409
|
+
"properties": {
|
|
410
|
+
"transaction_fields": {
|
|
411
|
+
"description": "Fields of a transaction to add to the event passed to handlers",
|
|
412
|
+
"type": [
|
|
413
|
+
"array",
|
|
414
|
+
"null"
|
|
415
|
+
],
|
|
416
|
+
"items": {
|
|
417
|
+
"$ref": "#/$defs/TransactionField"
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
"block_fields": {
|
|
421
|
+
"description": "Fields of a block to add to the event passed to handlers",
|
|
422
|
+
"type": [
|
|
423
|
+
"array",
|
|
424
|
+
"null"
|
|
425
|
+
],
|
|
426
|
+
"items": {
|
|
427
|
+
"$ref": "#/$defs/BlockField"
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
"additionalProperties": false
|
|
432
|
+
},
|
|
433
|
+
"TransactionField": {
|
|
434
|
+
"type": "string",
|
|
435
|
+
"enum": [
|
|
436
|
+
"transactionIndex",
|
|
437
|
+
"hash",
|
|
438
|
+
"from",
|
|
439
|
+
"to",
|
|
440
|
+
"gas",
|
|
441
|
+
"gasPrice",
|
|
442
|
+
"maxPriorityFeePerGas",
|
|
443
|
+
"maxFeePerGas",
|
|
444
|
+
"cumulativeGasUsed",
|
|
445
|
+
"effectiveGasPrice",
|
|
446
|
+
"gasUsed",
|
|
447
|
+
"input",
|
|
448
|
+
"nonce",
|
|
449
|
+
"value",
|
|
450
|
+
"v",
|
|
451
|
+
"r",
|
|
452
|
+
"s",
|
|
453
|
+
"contractAddress",
|
|
454
|
+
"logsBloom",
|
|
455
|
+
"root",
|
|
456
|
+
"status",
|
|
457
|
+
"yParity",
|
|
458
|
+
"chainId",
|
|
459
|
+
"maxFeePerBlobGas",
|
|
460
|
+
"blobVersionedHashes",
|
|
461
|
+
"kind",
|
|
462
|
+
"l1Fee",
|
|
463
|
+
"l1GasPrice",
|
|
464
|
+
"l1GasUsed",
|
|
465
|
+
"l1FeeScalar",
|
|
466
|
+
"gasUsedForL1"
|
|
467
|
+
]
|
|
468
|
+
},
|
|
469
|
+
"BlockField": {
|
|
470
|
+
"type": "string",
|
|
471
|
+
"enum": [
|
|
472
|
+
"parentHash",
|
|
473
|
+
"nonce",
|
|
474
|
+
"sha3Uncles",
|
|
475
|
+
"logsBloom",
|
|
476
|
+
"transactionsRoot",
|
|
477
|
+
"stateRoot",
|
|
478
|
+
"receiptsRoot",
|
|
479
|
+
"miner",
|
|
480
|
+
"difficulty",
|
|
481
|
+
"totalDifficulty",
|
|
482
|
+
"extraData",
|
|
483
|
+
"size",
|
|
484
|
+
"gasLimit",
|
|
485
|
+
"gasUsed",
|
|
486
|
+
"uncles",
|
|
487
|
+
"baseFeePerGas",
|
|
488
|
+
"blobGasUsed",
|
|
489
|
+
"excessBlobGas",
|
|
490
|
+
"parentBeaconBlockRoot",
|
|
491
|
+
"withdrawalsRoot",
|
|
492
|
+
"l1BlockNumber",
|
|
493
|
+
"sendCount",
|
|
494
|
+
"sendRoot",
|
|
495
|
+
"mixHash"
|
|
496
|
+
]
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
package/fuel.schema.json
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "Envio Config Schema",
|
|
4
|
+
"description": "Schema for a YAML config for an envio indexer",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"description": {
|
|
8
|
+
"description": "Description of the project",
|
|
9
|
+
"type": [
|
|
10
|
+
"string",
|
|
11
|
+
"null"
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
"name": {
|
|
15
|
+
"description": "Name of the project",
|
|
16
|
+
"type": "string"
|
|
17
|
+
},
|
|
18
|
+
"ecosystem": {
|
|
19
|
+
"description": "Ecosystem of the project.",
|
|
20
|
+
"$ref": "#/$defs/EcosystemTag"
|
|
21
|
+
},
|
|
22
|
+
"schema": {
|
|
23
|
+
"description": "Custom path to schema.yaml file",
|
|
24
|
+
"type": [
|
|
25
|
+
"string",
|
|
26
|
+
"null"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"contracts": {
|
|
30
|
+
"description": "Global contract definitions that must contain all definitions except addresses. You can share a single handler/abi/event definitions for contracts across multiple chains.",
|
|
31
|
+
"type": [
|
|
32
|
+
"array",
|
|
33
|
+
"null"
|
|
34
|
+
],
|
|
35
|
+
"items": {
|
|
36
|
+
"$ref": "#/$defs/GlobalContract_for_ContractConfig"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"networks": {
|
|
40
|
+
"description": "Configuration of the blockchain networks that the project is deployed on.",
|
|
41
|
+
"type": "array",
|
|
42
|
+
"items": {
|
|
43
|
+
"$ref": "#/$defs/Network"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"additionalProperties": false,
|
|
48
|
+
"required": [
|
|
49
|
+
"name",
|
|
50
|
+
"ecosystem",
|
|
51
|
+
"networks"
|
|
52
|
+
],
|
|
53
|
+
"$defs": {
|
|
54
|
+
"EcosystemTag": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"enum": [
|
|
57
|
+
"fuel"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"GlobalContract_for_ContractConfig": {
|
|
61
|
+
"type": "object",
|
|
62
|
+
"properties": {
|
|
63
|
+
"name": {
|
|
64
|
+
"description": "A unique project-wide name for this contract (no spaces)",
|
|
65
|
+
"type": "string"
|
|
66
|
+
},
|
|
67
|
+
"abi_file_path": {
|
|
68
|
+
"description": "Relative path (from config) to a json abi.",
|
|
69
|
+
"type": "string"
|
|
70
|
+
},
|
|
71
|
+
"handler": {
|
|
72
|
+
"description": "The relative path to a file where handlers are registered for the given contract",
|
|
73
|
+
"type": "string"
|
|
74
|
+
},
|
|
75
|
+
"events": {
|
|
76
|
+
"description": "A list of events that should be indexed on this contract",
|
|
77
|
+
"type": "array",
|
|
78
|
+
"items": {
|
|
79
|
+
"$ref": "#/$defs/EventConfig"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"additionalProperties": false,
|
|
84
|
+
"required": [
|
|
85
|
+
"name",
|
|
86
|
+
"abi_file_path",
|
|
87
|
+
"handler",
|
|
88
|
+
"events"
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
"EventConfig": {
|
|
92
|
+
"type": "object",
|
|
93
|
+
"properties": {
|
|
94
|
+
"name": {
|
|
95
|
+
"description": "A reference to a struct in the ABI or a unique name for the provided log_id",
|
|
96
|
+
"type": "string"
|
|
97
|
+
},
|
|
98
|
+
"logId": {
|
|
99
|
+
"description": "A reference to a log_id in the ABI",
|
|
100
|
+
"type": [
|
|
101
|
+
"string",
|
|
102
|
+
"null"
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"additionalProperties": false,
|
|
107
|
+
"required": [
|
|
108
|
+
"name"
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
"Network": {
|
|
112
|
+
"type": "object",
|
|
113
|
+
"properties": {
|
|
114
|
+
"id": {
|
|
115
|
+
"description": "Public chain/network id",
|
|
116
|
+
"type": "integer",
|
|
117
|
+
"format": "uint64",
|
|
118
|
+
"minimum": 0
|
|
119
|
+
},
|
|
120
|
+
"start_block": {
|
|
121
|
+
"description": "The block at which the indexer should start ingesting data",
|
|
122
|
+
"type": "integer",
|
|
123
|
+
"format": "int32"
|
|
124
|
+
},
|
|
125
|
+
"end_block": {
|
|
126
|
+
"description": "The block at which the indexer should terminate.",
|
|
127
|
+
"type": [
|
|
128
|
+
"integer",
|
|
129
|
+
"null"
|
|
130
|
+
],
|
|
131
|
+
"format": "int32"
|
|
132
|
+
},
|
|
133
|
+
"contracts": {
|
|
134
|
+
"description": "All the contracts that should be indexed on the given network",
|
|
135
|
+
"type": "array",
|
|
136
|
+
"items": {
|
|
137
|
+
"$ref": "#/$defs/NetworkContract_for_ContractConfig"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"additionalProperties": false,
|
|
142
|
+
"required": [
|
|
143
|
+
"id",
|
|
144
|
+
"start_block",
|
|
145
|
+
"contracts"
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
"NetworkContract_for_ContractConfig": {
|
|
149
|
+
"type": "object",
|
|
150
|
+
"properties": {
|
|
151
|
+
"name": {
|
|
152
|
+
"description": "A unique project-wide name for this contract if events and handler are defined OR a reference to the name of contract defined globally at the top level",
|
|
153
|
+
"type": "string"
|
|
154
|
+
},
|
|
155
|
+
"address": {
|
|
156
|
+
"description": "A single address or a list of addresses to be indexed. This can be left as null in the case where this contracts addresses will be registered dynamically.",
|
|
157
|
+
"$ref": "#/$defs/Addresses"
|
|
158
|
+
},
|
|
159
|
+
"abi_file_path": {
|
|
160
|
+
"description": "Relative path (from config) to a json abi.",
|
|
161
|
+
"type": "string"
|
|
162
|
+
},
|
|
163
|
+
"handler": {
|
|
164
|
+
"description": "The relative path to a file where handlers are registered for the given contract",
|
|
165
|
+
"type": "string"
|
|
166
|
+
},
|
|
167
|
+
"events": {
|
|
168
|
+
"description": "A list of events that should be indexed on this contract",
|
|
169
|
+
"type": "array",
|
|
170
|
+
"items": {
|
|
171
|
+
"$ref": "#/$defs/EventConfig"
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"additionalProperties": false,
|
|
176
|
+
"required": [
|
|
177
|
+
"name"
|
|
178
|
+
]
|
|
179
|
+
},
|
|
180
|
+
"Addresses": {
|
|
181
|
+
"anyOf": [
|
|
182
|
+
{
|
|
183
|
+
"anyOf": [
|
|
184
|
+
{
|
|
185
|
+
"type": "string"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"type": "integer",
|
|
189
|
+
"format": "uint",
|
|
190
|
+
"minimum": 0
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"type": "array",
|
|
196
|
+
"items": {
|
|
197
|
+
"anyOf": [
|
|
198
|
+
{
|
|
199
|
+
"type": "string"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"type": "integer",
|
|
203
|
+
"format": "uint",
|
|
204
|
+
"minimum": 0
|
|
205
|
+
}
|
|
206
|
+
]
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "envio",
|
|
3
|
-
"version": "v0.
|
|
4
|
-
"description": "A
|
|
3
|
+
"version": "v0.9.9-branch-test-cache",
|
|
4
|
+
"description": "A latency and sync speed optimized, developer friendly blockchain data indexer.",
|
|
5
5
|
"bin": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"typecheck": "tsc --noEmit",
|
|
@@ -12,21 +12,22 @@
|
|
|
12
12
|
},
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
|
-
"url": "git+https://github.com/enviodev/
|
|
15
|
+
"url": "git+https://github.com/enviodev/hyperindex.git"
|
|
16
16
|
},
|
|
17
17
|
"keywords": [
|
|
18
18
|
"blockchain",
|
|
19
19
|
"indexer",
|
|
20
20
|
"ethereum",
|
|
21
|
+
"fuel",
|
|
21
22
|
"data",
|
|
22
23
|
"dapp"
|
|
23
24
|
],
|
|
24
25
|
"author": "envio contributors <about@envio.dev>",
|
|
25
26
|
"license": "GPL-3.0",
|
|
26
27
|
"bugs": {
|
|
27
|
-
"url": "https://github.com/enviodev/
|
|
28
|
+
"url": "https://github.com/enviodev/hyperindex/issues"
|
|
28
29
|
},
|
|
29
|
-
"homepage": "https://
|
|
30
|
+
"homepage": "https://envio.dev",
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"@types/node": "^18.11.18",
|
|
32
33
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
|
@@ -35,11 +36,10 @@
|
|
|
35
36
|
"typescript": "^4.9.4"
|
|
36
37
|
},
|
|
37
38
|
"optionalDependencies": {
|
|
38
|
-
"envio-linux-x64": "v0.
|
|
39
|
-
"envio-linux-arm64": "v0.
|
|
40
|
-
"envio-darwin-x64": "v0.
|
|
41
|
-
"envio-darwin-arm64": "v0.
|
|
42
|
-
"envio-win32-x64": "v0.0.40"
|
|
39
|
+
"envio-linux-x64": "v0.9.9-branch-test-cache",
|
|
40
|
+
"envio-linux-arm64": "v0.9.9-branch-test-cache",
|
|
41
|
+
"envio-darwin-x64": "v0.9.9-branch-test-cache",
|
|
42
|
+
"envio-darwin-arm64": "v0.9.9-branch-test-cache"
|
|
43
43
|
},
|
|
44
44
|
"eslintConfig": {
|
|
45
45
|
"extends": [
|
|
@@ -54,5 +54,10 @@
|
|
|
54
54
|
"lib/*"
|
|
55
55
|
],
|
|
56
56
|
"root": true
|
|
57
|
-
}
|
|
57
|
+
},
|
|
58
|
+
"files": [
|
|
59
|
+
"lib",
|
|
60
|
+
"evm.schema.json",
|
|
61
|
+
"fuel.schema.json"
|
|
62
|
+
]
|
|
58
63
|
}
|
package/package.json.tmpl
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "envio",
|
|
3
|
-
"version": "${version}",
|
|
4
|
-
"description": "A ️latency and sync speed optimized, developer friendly blockchain data indexer.",
|
|
5
|
-
"bin": "lib/index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"typecheck": "tsc --noEmit",
|
|
8
|
-
"lint": "eslint .",
|
|
9
|
-
"lint:fix": "eslint . --fix",
|
|
10
|
-
"build": "tsc",
|
|
11
|
-
"dev": "pnpm build && node lib/index.js"
|
|
12
|
-
},
|
|
13
|
-
"repository": {
|
|
14
|
-
"type": "git",
|
|
15
|
-
"url": "git+https://github.com/enviodev/indexer.git"
|
|
16
|
-
},
|
|
17
|
-
"keywords": [
|
|
18
|
-
"blockchain",
|
|
19
|
-
"indexer",
|
|
20
|
-
"ethereum",
|
|
21
|
-
"data",
|
|
22
|
-
"dapp"
|
|
23
|
-
],
|
|
24
|
-
"author": "envio contributors <about@envio.dev>",
|
|
25
|
-
"license": "GPL-3.0",
|
|
26
|
-
"bugs": {
|
|
27
|
-
"url": "https://github.com/enviodev/indexer/issues"
|
|
28
|
-
},
|
|
29
|
-
"homepage": "https://github.com/enviodev/indexer#readme",
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"@types/node": "^18.11.18",
|
|
32
|
-
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
|
33
|
-
"@typescript-eslint/parser": "^5.48.0",
|
|
34
|
-
"eslint": "^8.31.0",
|
|
35
|
-
"typescript": "^4.9.4"
|
|
36
|
-
},
|
|
37
|
-
"optionalDependencies": {
|
|
38
|
-
"envio-linux-x64": "${version}",
|
|
39
|
-
"envio-linux-arm64": "${version}",
|
|
40
|
-
"envio-darwin-x64": "${version}",
|
|
41
|
-
"envio-darwin-arm64": "${version}",
|
|
42
|
-
"envio-win32-x64": "${version}"
|
|
43
|
-
},
|
|
44
|
-
"eslintConfig": {
|
|
45
|
-
"extends": [
|
|
46
|
-
"eslint:recommended",
|
|
47
|
-
"plugin:@typescript-eslint/recommended"
|
|
48
|
-
],
|
|
49
|
-
"parser": "@typescript-eslint/parser",
|
|
50
|
-
"plugins": [
|
|
51
|
-
"@typescript-eslint"
|
|
52
|
-
],
|
|
53
|
-
"ignorePatterns": [
|
|
54
|
-
"lib/*"
|
|
55
|
-
],
|
|
56
|
-
"root": true
|
|
57
|
-
}
|
|
58
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { spawnSync } from "child_process"
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Returns the executable path for envio located inside node_modules
|
|
7
|
-
* The naming convention is envio-${os}-${arch}
|
|
8
|
-
* If the platform is `win32` or `cygwin`, executable will include a `.exe` extension
|
|
9
|
-
* @see https://nodejs.org/api/os.html#osarch
|
|
10
|
-
* @see https://nodejs.org/api/os.html#osplatform
|
|
11
|
-
* @example "x/xx/node_modules/envio-darwin-arm64"
|
|
12
|
-
*/
|
|
13
|
-
function getExePath() {
|
|
14
|
-
const arch = process.arch;
|
|
15
|
-
let os = process.platform as string;
|
|
16
|
-
let extension = '';
|
|
17
|
-
if (['win32', 'cygwin'].includes(process.platform)) {
|
|
18
|
-
os = 'windows';
|
|
19
|
-
extension = '.exe';
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
try {
|
|
23
|
-
// Since the bin will be located inside `node_modules`, we can simply call require.resolve
|
|
24
|
-
return require.resolve(`envio-${os}-${arch}/bin/envio${extension}`)
|
|
25
|
-
} catch (e) {
|
|
26
|
-
throw new Error(`Couldn't find envio binary inside node_modules for ${os}-${arch}`)
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Runs `envio` with args using nodejs spawn
|
|
32
|
-
*/
|
|
33
|
-
function runEnvio() {
|
|
34
|
-
const args = process.argv.slice(2)
|
|
35
|
-
const processResult = spawnSync(getExePath(), args, { stdio: "inherit" })
|
|
36
|
-
process.exit(processResult.status ?? 0)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
runEnvio()
|
package/tsconfig.json
DELETED