envio 2.32.6 → 3.0.0-alpha-main-clickhouse-experiment
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/bin.mjs +49 -0
- package/evm.schema.json +123 -166
- package/fuel.schema.json +89 -29
- package/index.d.ts +498 -28
- package/index.js +13 -6
- package/package.json +46 -28
- package/rescript.json +8 -4
- package/src/{Address.res.js → Address.res.mjs} +7 -6
- package/src/Batch.res +8 -5
- package/src/{Batch.res.js → Batch.res.mjs} +22 -20
- package/src/Benchmark.res +394 -0
- package/src/Benchmark.res.mjs +398 -0
- package/src/ChainFetcher.res +533 -0
- package/src/ChainFetcher.res.mjs +341 -0
- package/src/ChainManager.res +172 -0
- package/src/ChainManager.res.mjs +147 -0
- package/src/{ChainMap.res.js → ChainMap.res.mjs} +20 -19
- package/src/Change.res +9 -0
- package/src/ClickHouseStorage.res +410 -0
- package/src/ClickHouseStorage.res.mjs +288 -0
- package/src/Config.gen.ts +19 -0
- package/src/Config.res +644 -27
- package/src/Config.res.mjs +682 -0
- package/src/{Indexer.res → Ctx.res} +2 -2
- package/src/Ecosystem.res +25 -0
- package/src/Ecosystem.res.mjs +29 -0
- package/src/Env.res +265 -0
- package/src/Env.res.mjs +287 -0
- package/src/Envio.gen.ts +6 -17
- package/src/Envio.res +24 -38
- package/src/{Envio.res.js → Envio.res.mjs} +5 -16
- package/src/{ErrorHandling.res.js → ErrorHandling.res.mjs} +10 -9
- package/src/EventProcessing.res +478 -0
- package/src/EventProcessing.res.mjs +341 -0
- package/src/{EventUtils.res.js → EventUtils.res.mjs} +10 -9
- package/src/EvmTypes.gen.ts +6 -0
- package/src/EvmTypes.res +1 -0
- package/src/{EvmTypes.res.js → EvmTypes.res.mjs} +5 -4
- package/src/FetchState.res +1254 -639
- package/src/FetchState.res.mjs +1604 -0
- package/src/GlobalState.res +1183 -0
- package/src/GlobalState.res.mjs +1212 -0
- package/src/GlobalStateManager.res +68 -0
- package/src/GlobalStateManager.res.mjs +75 -0
- package/src/GlobalStateManager.resi +7 -0
- package/src/HandlerLoader.res +89 -0
- package/src/HandlerLoader.res.mjs +79 -0
- package/src/HandlerRegister.res +319 -0
- package/src/HandlerRegister.res.mjs +299 -0
- package/src/HandlerRegister.resi +29 -0
- package/src/Hasura.res +4 -4
- package/src/{Hasura.res.js → Hasura.res.mjs} +28 -27
- package/src/InMemoryStore.res +7 -15
- package/src/{InMemoryStore.res.js → InMemoryStore.res.mjs} +23 -24
- package/src/InMemoryTable.res +51 -36
- package/src/{InMemoryTable.res.js → InMemoryTable.res.mjs} +74 -105
- package/src/Internal.gen.ts +7 -18
- package/src/Internal.res +69 -52
- package/src/Internal.res.mjs +58 -0
- package/src/{LazyLoader.res.js → LazyLoader.res.mjs} +14 -13
- package/src/LoadLayer.res +444 -0
- package/src/LoadLayer.res.mjs +296 -0
- package/src/LoadLayer.resi +32 -0
- package/src/{LoadManager.res.js → LoadManager.res.mjs} +11 -10
- package/src/LogSelection.res +33 -27
- package/src/{LogSelection.res.js → LogSelection.res.mjs} +20 -13
- package/src/Logging.res +14 -7
- package/src/{Logging.res.js → Logging.res.mjs} +51 -42
- package/src/Main.res +377 -0
- package/src/Main.res.mjs +326 -0
- package/src/Persistence.res +190 -52
- package/src/Persistence.res.mjs +213 -0
- package/src/PgStorage.gen.ts +10 -0
- package/src/PgStorage.res +743 -33
- package/src/PgStorage.res.d.mts +5 -0
- package/src/{PgStorage.res.js → PgStorage.res.mjs} +525 -79
- package/src/Prometheus.res +72 -9
- package/src/{Prometheus.res.js → Prometheus.res.mjs} +164 -93
- package/src/ReorgDetection.res +6 -10
- package/src/{ReorgDetection.res.js → ReorgDetection.res.mjs} +18 -17
- package/src/SafeCheckpointTracking.res +5 -4
- package/src/{SafeCheckpointTracking.res.js → SafeCheckpointTracking.res.mjs} +6 -5
- package/src/Sink.res +49 -0
- package/src/Sink.res.mjs +38 -0
- package/src/{TableIndices.res.js → TableIndices.res.mjs} +8 -7
- package/src/TestIndexer.res +695 -0
- package/src/TestIndexer.res.mjs +529 -0
- package/src/TestIndexerProxyStorage.res +205 -0
- package/src/TestIndexerProxyStorage.res.mjs +151 -0
- package/src/{Throttler.res.js → Throttler.res.mjs} +7 -6
- package/src/{Time.res.js → Time.res.mjs} +8 -7
- package/src/TopicFilter.res +1 -1
- package/src/{TopicFilter.res.js → TopicFilter.res.mjs} +18 -17
- package/src/Types.ts +1 -1
- package/src/UserContext.res +412 -0
- package/src/UserContext.res.mjs +279 -0
- package/src/Utils.res +120 -4
- package/src/{Utils.res.js → Utils.res.mjs} +146 -50
- package/src/bindings/BigDecimal.gen.ts +2 -2
- package/src/bindings/BigDecimal.res +5 -5
- package/src/bindings/BigDecimal.res.d.mts +5 -0
- package/src/bindings/{BigDecimal.res.js → BigDecimal.res.mjs} +10 -9
- package/src/bindings/BigInt.gen.ts +2 -2
- package/src/bindings/BigInt.res.d.mts +5 -0
- package/src/bindings/{BigInt.res.js → BigInt.res.mjs} +25 -24
- package/src/bindings/ClickHouse.res +428 -0
- package/src/bindings/ClickHouse.res.mjs +302 -0
- package/src/bindings/DateFns.res +71 -0
- package/src/bindings/DateFns.res.mjs +22 -0
- package/src/bindings/Ethers.res.d.mts +5 -0
- package/src/bindings/EventSource.res +8 -1
- package/src/bindings/EventSource.res.mjs +9 -0
- package/src/bindings/Express.res +1 -0
- package/src/bindings/Hrtime.res +1 -1
- package/src/bindings/{Hrtime.res.js → Hrtime.res.mjs} +15 -14
- package/src/bindings/{Lodash.res.js → Lodash.res.mjs} +4 -3
- package/src/bindings/NodeJs.res +55 -2
- package/src/bindings/NodeJs.res.mjs +56 -0
- package/src/bindings/Pino.res +30 -16
- package/src/bindings/{Pino.res.js → Pino.res.mjs} +30 -23
- package/src/bindings/Postgres.gen.ts +8 -0
- package/src/bindings/Postgres.res +20 -2
- package/src/bindings/Postgres.res.d.mts +5 -0
- package/src/bindings/{Postgres.res.js → Postgres.res.mjs} +4 -3
- package/src/bindings/{PromClient.res.js → PromClient.res.mjs} +6 -5
- package/src/bindings/{Promise.res.js → Promise.res.mjs} +6 -5
- package/src/bindings/{SDSL.res.js → SDSL.res.mjs} +3 -2
- package/src/bindings/{Viem.res.js → Viem.res.mjs} +9 -8
- package/src/bindings/Vitest.res +142 -0
- package/src/bindings/Vitest.res.mjs +9 -0
- package/src/bindings/WebSocket.res +27 -0
- package/src/bindings/WebSocket.res.mjs +2 -0
- package/src/bindings/Yargs.res +8 -0
- package/src/bindings/Yargs.res.mjs +2 -0
- package/src/bindings/vendored-lodash-fns.js +3 -35
- package/src/db/EntityHistory.res +35 -158
- package/src/db/EntityHistory.res.mjs +121 -0
- package/src/db/InternalTable.gen.ts +2 -2
- package/src/db/InternalTable.res +56 -116
- package/src/db/{InternalTable.res.js → InternalTable.res.mjs} +89 -141
- package/src/db/{Schema.res.js → Schema.res.mjs} +10 -9
- package/src/db/Table.res +107 -30
- package/src/db/{Table.res.js → Table.res.mjs} +128 -50
- package/src/sources/{EventRouter.res.js → EventRouter.res.mjs} +17 -16
- package/src/sources/Evm.res +87 -0
- package/src/sources/Evm.res.mjs +105 -0
- package/src/sources/EvmChain.res +94 -0
- package/src/sources/EvmChain.res.mjs +60 -0
- package/src/sources/Fuel.res +19 -34
- package/src/sources/Fuel.res.mjs +47 -0
- package/src/sources/FuelSDK.res +38 -0
- package/src/sources/{Fuel.res.js → FuelSDK.res.mjs} +6 -5
- package/src/sources/HyperFuel.res +2 -2
- package/src/sources/{HyperFuel.res.js → HyperFuel.res.mjs} +14 -13
- package/src/sources/HyperFuel.resi +1 -1
- package/src/sources/HyperFuelClient.res +2 -2
- package/src/sources/{HyperFuelClient.res.js → HyperFuelClient.res.mjs} +7 -6
- package/src/sources/HyperFuelSource.res +13 -9
- package/src/sources/{HyperFuelSource.res.js → HyperFuelSource.res.mjs} +38 -33
- package/src/sources/HyperSync.res +15 -6
- package/src/sources/{HyperSync.res.js → HyperSync.res.mjs} +30 -27
- package/src/sources/HyperSync.resi +4 -0
- package/src/sources/HyperSyncClient.gen.ts +1 -1
- package/src/sources/HyperSyncClient.res +5 -4
- package/src/sources/{HyperSyncClient.res.js → HyperSyncClient.res.mjs} +14 -13
- package/src/sources/HyperSyncHeightStream.res +48 -117
- package/src/sources/HyperSyncHeightStream.res.mjs +100 -0
- package/src/sources/{HyperSyncJsonApi.res.js → HyperSyncJsonApi.res.mjs} +10 -9
- package/src/sources/HyperSyncSource.res +83 -123
- package/src/sources/{HyperSyncSource.res.js → HyperSyncSource.res.mjs} +99 -127
- package/src/sources/Rpc.res +92 -12
- package/src/sources/{Rpc.res.js → Rpc.res.mjs} +117 -24
- package/src/sources/RpcSource.res +518 -309
- package/src/sources/RpcSource.res.mjs +1274 -0
- package/src/sources/RpcWebSocketHeightStream.res +177 -0
- package/src/sources/RpcWebSocketHeightStream.res.mjs +196 -0
- package/src/sources/Source.res +4 -3
- package/src/sources/{Source.res.js → Source.res.mjs} +4 -3
- package/src/sources/SourceManager.res +191 -113
- package/src/sources/{SourceManager.res.js → SourceManager.res.mjs} +190 -120
- package/src/sources/SourceManager.resi +4 -5
- package/src/sources/Svm.res +72 -0
- package/src/sources/Svm.res.mjs +85 -0
- package/src/sources/vendored-fuel-abi-coder.js +94 -149
- package/src/tui/Tui.res +260 -0
- package/src/tui/Tui.res.mjs +357 -0
- package/src/tui/bindings/Ink.res +371 -0
- package/src/tui/bindings/Ink.res.mjs +72 -0
- package/src/tui/bindings/Style.res +123 -0
- package/src/tui/bindings/Style.res.mjs +2 -0
- package/src/tui/components/BufferedProgressBar.res +40 -0
- package/src/tui/components/BufferedProgressBar.res.mjs +57 -0
- package/src/tui/components/CustomHooks.res +122 -0
- package/src/tui/components/CustomHooks.res.mjs +179 -0
- package/src/tui/components/Messages.res +41 -0
- package/src/tui/components/Messages.res.mjs +75 -0
- package/src/tui/components/SyncETA.res +193 -0
- package/src/tui/components/SyncETA.res.mjs +269 -0
- package/src/tui/components/TuiData.res +46 -0
- package/src/tui/components/TuiData.res.mjs +29 -0
- package/src/vendored/{Rest.res.js → Rest.res.mjs} +12 -11
- package/svm.schema.json +138 -0
- package/bin.js +0 -46
- package/src/Config.res.js +0 -84
- package/src/EventRegister.res +0 -253
- package/src/EventRegister.res.js +0 -239
- package/src/EventRegister.resi +0 -35
- package/src/FetchState.res.js +0 -1080
- package/src/Internal.res.js +0 -62
- package/src/Persistence.res.js +0 -159
- package/src/bindings/Ethers.gen.ts +0 -14
- package/src/bindings/Ethers.res +0 -204
- package/src/bindings/Ethers.res.js +0 -129
- package/src/bindings/NodeJs.res.js +0 -35
- package/src/db/EntityHistory.res.js +0 -195
- package/src/sources/HyperSyncHeightStream.res.js +0 -126
- package/src/sources/RpcSource.res.js +0 -850
- /package/src/{Indexer.res.js → Change.res.mjs} +0 -0
- /package/src/{bindings/EventSource.res.js → Ctx.res.mjs} +0 -0
- /package/src/bindings/{Express.res.js → Express.res.mjs} +0 -0
package/README.md
CHANGED
|
@@ -12,13 +12,13 @@ HyperIndex is a fast, developer-friendly multichain indexer, optimized for both
|
|
|
12
12
|
## Key Features
|
|
13
13
|
|
|
14
14
|
- **[Indexer auto-generation](https://docs.envio.dev/docs/HyperIndex/contract-import)** – Generate Indexers directly from smart contract addresses
|
|
15
|
-
- **High performance** – Historical backfills at over
|
|
15
|
+
- **High performance** – Historical backfills at over 25,000+ events per second ([fastest in market](https://docs.envio.dev/blog/indexer-benchmarking-results))
|
|
16
16
|
- **Local development** – Full-featured local environment with Docker
|
|
17
|
-
- **[Multichain indexing](https://docs.envio.dev/docs/HyperIndex/multichain-indexing)** – Index any EVM
|
|
17
|
+
- **[Multichain indexing](https://docs.envio.dev/docs/HyperIndex/multichain-indexing)** – Index any EVM-, SVM-, or Fuel-compatible blockchain
|
|
18
18
|
- **Real-time indexing** – Instantly track blockchain events
|
|
19
19
|
- **[Reorg support](https://docs.envio.dev/docs/HyperIndex/reorgs-support)** – Graceful handling of blockchain reorganizations
|
|
20
20
|
- **GraphQL API** – Easy-to-query indexed data
|
|
21
|
-
- **Flexible language support** –
|
|
21
|
+
- **Flexible language support** – TypeScript, JavaScript, and ReScript
|
|
22
22
|
- **Factory contract support** – Index data from 1M+ dynamically registered contracts seamlessly
|
|
23
23
|
- **On-chain & off-chain data integration** – Easily combine multiple data sources
|
|
24
24
|
- **[Self-hosted & managed options](https://docs.envio.dev/docs/HyperIndex/hosted-service)** – Run your own setup or use HyperIndex hosted services
|
package/bin.mjs
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
//@ts-check
|
|
3
|
+
|
|
4
|
+
import { spawnSync } from "child_process";
|
|
5
|
+
import { createRequire } from "module";
|
|
6
|
+
|
|
7
|
+
const require = createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Returns the executable path for envio located inside node_modules.
|
|
11
|
+
* The naming convention is envio-${os}-${arch}
|
|
12
|
+
* @see https://nodejs.org/api/os.html#osarch
|
|
13
|
+
* @see https://nodejs.org/api/os.html#osplatform
|
|
14
|
+
* @example "x/xx/node_modules/envio-darwin-arm64"
|
|
15
|
+
*/
|
|
16
|
+
function getExePath() {
|
|
17
|
+
const pkg = `envio-${process.platform}-${process.arch}`;
|
|
18
|
+
const bin = "bin/envio";
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
return require.resolve(`${pkg}/${bin}`);
|
|
22
|
+
} catch {}
|
|
23
|
+
|
|
24
|
+
throw new Error(
|
|
25
|
+
`Couldn't find envio binary package "${pkg}".\n` +
|
|
26
|
+
`Checked: require.resolve("${pkg}/${bin}")\n` +
|
|
27
|
+
`If you're using pnpm, yarn, or npm with --omit=optional, ensure optional ` +
|
|
28
|
+
`dependencies are installed:\n` +
|
|
29
|
+
` npm install ${pkg}\n`
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Runs `envio` with args using nodejs spawn
|
|
35
|
+
*/
|
|
36
|
+
function runEnvio() {
|
|
37
|
+
const args = process.argv.slice(2);
|
|
38
|
+
const exePath = getExePath();
|
|
39
|
+
|
|
40
|
+
const processResult = spawnSync(exePath, args, { stdio: "inherit" });
|
|
41
|
+
|
|
42
|
+
if (processResult.error) {
|
|
43
|
+
console.error(`Failed to run envio binary at ${exePath}: ${processResult.error.message}`);
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
process.exit(processResult.status ?? 1);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
runEnvio();
|
package/evm.schema.json
CHANGED
|
@@ -15,17 +15,6 @@
|
|
|
15
15
|
"description": "Name of the project",
|
|
16
16
|
"type": "string"
|
|
17
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
18
|
"schema": {
|
|
30
19
|
"description": "Custom path to schema.graphql file",
|
|
31
20
|
"type": [
|
|
@@ -40,41 +29,61 @@
|
|
|
40
29
|
"null"
|
|
41
30
|
]
|
|
42
31
|
},
|
|
43
|
-
"
|
|
44
|
-
"description": "
|
|
32
|
+
"handlers": {
|
|
33
|
+
"description": "Optional relative path to handlers directory for auto-loading. Defaults to 'src/handlers' if not specified.",
|
|
45
34
|
"type": [
|
|
46
|
-
"
|
|
35
|
+
"string",
|
|
47
36
|
"null"
|
|
48
|
-
]
|
|
49
|
-
"items": {
|
|
50
|
-
"$ref": "#/$defs/GlobalContract_for_ContractConfig"
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
"networks": {
|
|
54
|
-
"description": "Configuration of the blockchain networks that the project is deployed on.",
|
|
55
|
-
"type": "array",
|
|
56
|
-
"items": {
|
|
57
|
-
"$ref": "#/$defs/Network"
|
|
58
|
-
}
|
|
37
|
+
]
|
|
59
38
|
},
|
|
60
|
-
"
|
|
61
|
-
"description": "
|
|
39
|
+
"full_batch_size": {
|
|
40
|
+
"description": "Target number of events to be processed per batch. Set it to smaller number if you have many Effect API calls which are slow to resolve and can't be batched. (Default: 5000)",
|
|
62
41
|
"type": [
|
|
63
|
-
"
|
|
42
|
+
"integer",
|
|
64
43
|
"null"
|
|
44
|
+
],
|
|
45
|
+
"format": "uint64",
|
|
46
|
+
"minimum": 0
|
|
47
|
+
},
|
|
48
|
+
"storage": {
|
|
49
|
+
"description": "Storage backend for the indexer. Options: 'postgres' (default) or 'clickhouse'.",
|
|
50
|
+
"anyOf": [
|
|
51
|
+
{
|
|
52
|
+
"$ref": "#/$defs/Storage"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"type": "null"
|
|
56
|
+
}
|
|
65
57
|
]
|
|
66
58
|
},
|
|
67
|
-
"
|
|
68
|
-
"description": "
|
|
59
|
+
"ecosystem": {
|
|
60
|
+
"description": "Ecosystem of the project.",
|
|
69
61
|
"anyOf": [
|
|
70
62
|
{
|
|
71
|
-
"$ref": "#/$defs/
|
|
63
|
+
"$ref": "#/$defs/EcosystemTag"
|
|
72
64
|
},
|
|
73
65
|
{
|
|
74
66
|
"type": "null"
|
|
75
67
|
}
|
|
76
68
|
]
|
|
77
69
|
},
|
|
70
|
+
"contracts": {
|
|
71
|
+
"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.",
|
|
72
|
+
"type": [
|
|
73
|
+
"array",
|
|
74
|
+
"null"
|
|
75
|
+
],
|
|
76
|
+
"items": {
|
|
77
|
+
"$ref": "#/$defs/GlobalContract_for_ContractConfig"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"chains": {
|
|
81
|
+
"description": "Configuration of the blockchain chains that the project is deployed on.",
|
|
82
|
+
"type": "array",
|
|
83
|
+
"items": {
|
|
84
|
+
"$ref": "#/$defs/Chain"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
78
87
|
"rollback_on_reorg": {
|
|
79
88
|
"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)",
|
|
80
89
|
"type": [
|
|
@@ -107,13 +116,6 @@
|
|
|
107
116
|
"null"
|
|
108
117
|
]
|
|
109
118
|
},
|
|
110
|
-
"preload_handlers": {
|
|
111
|
-
"description": "Makes handlers run twice to enable preload optimisations. Removes handlerWithLoader API, since it's not needed. (recommended, default: false)",
|
|
112
|
-
"type": [
|
|
113
|
-
"boolean",
|
|
114
|
-
"null"
|
|
115
|
-
]
|
|
116
|
-
},
|
|
117
119
|
"address_format": {
|
|
118
120
|
"description": "Address format for Ethereum addresses: 'checksum' or 'lowercase' (default: checksum)",
|
|
119
121
|
"anyOf": [
|
|
@@ -129,9 +131,24 @@
|
|
|
129
131
|
"additionalProperties": false,
|
|
130
132
|
"required": [
|
|
131
133
|
"name",
|
|
132
|
-
"
|
|
134
|
+
"chains"
|
|
133
135
|
],
|
|
134
136
|
"$defs": {
|
|
137
|
+
"Storage": {
|
|
138
|
+
"description": "Storage backend option",
|
|
139
|
+
"oneOf": [
|
|
140
|
+
{
|
|
141
|
+
"description": "Use PostgreSQL as the storage backend (default)",
|
|
142
|
+
"type": "string",
|
|
143
|
+
"const": "postgres"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"description": "Use ClickHouse as the storage backend",
|
|
147
|
+
"type": "string",
|
|
148
|
+
"const": "clickhouse"
|
|
149
|
+
}
|
|
150
|
+
]
|
|
151
|
+
},
|
|
135
152
|
"EcosystemTag": {
|
|
136
153
|
"type": "string",
|
|
137
154
|
"enum": [
|
|
@@ -153,8 +170,11 @@
|
|
|
153
170
|
]
|
|
154
171
|
},
|
|
155
172
|
"handler": {
|
|
156
|
-
"description": "
|
|
157
|
-
"type":
|
|
173
|
+
"description": "Optional relative path to a file where handlers are registered for the given contract. If not provided, handlers can be auto-loaded from src directory.",
|
|
174
|
+
"type": [
|
|
175
|
+
"string",
|
|
176
|
+
"null"
|
|
177
|
+
]
|
|
158
178
|
},
|
|
159
179
|
"events": {
|
|
160
180
|
"description": "A list of events that should be indexed on this contract",
|
|
@@ -167,7 +187,6 @@
|
|
|
167
187
|
"additionalProperties": false,
|
|
168
188
|
"required": [
|
|
169
189
|
"name",
|
|
170
|
-
"handler",
|
|
171
190
|
"events"
|
|
172
191
|
]
|
|
173
192
|
},
|
|
@@ -253,11 +272,10 @@
|
|
|
253
272
|
"root",
|
|
254
273
|
"status",
|
|
255
274
|
"yParity",
|
|
256
|
-
"chainId",
|
|
257
275
|
"accessList",
|
|
258
276
|
"maxFeePerBlobGas",
|
|
259
277
|
"blobVersionedHashes",
|
|
260
|
-
"
|
|
278
|
+
"type",
|
|
261
279
|
"l1Fee",
|
|
262
280
|
"l1GasPrice",
|
|
263
281
|
"l1GasUsed",
|
|
@@ -295,31 +313,20 @@
|
|
|
295
313
|
"mixHash"
|
|
296
314
|
]
|
|
297
315
|
},
|
|
298
|
-
"
|
|
316
|
+
"Chain": {
|
|
299
317
|
"type": "object",
|
|
300
318
|
"properties": {
|
|
301
319
|
"id": {
|
|
302
|
-
"description": "The public blockchain
|
|
320
|
+
"description": "The public blockchain chain ID.",
|
|
303
321
|
"type": "integer",
|
|
304
322
|
"format": "uint64",
|
|
305
323
|
"minimum": 0
|
|
306
324
|
},
|
|
307
|
-
"rpc_config": {
|
|
308
|
-
"description": "RPC configuration for utilizing as the network's data-source. Typically optional for chains with HyperSync support, which is highly recommended. HyperSync dramatically enhances performance, providing up to a 1000x speed boost over traditional RPC.",
|
|
309
|
-
"anyOf": [
|
|
310
|
-
{
|
|
311
|
-
"$ref": "#/$defs/RpcConfig"
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
"type": "null"
|
|
315
|
-
}
|
|
316
|
-
]
|
|
317
|
-
},
|
|
318
325
|
"rpc": {
|
|
319
|
-
"description": "RPC configuration for your indexer. If not specified otherwise, for
|
|
326
|
+
"description": "RPC configuration for your indexer. If not specified otherwise, for chains supported by HyperSync, RPC serves as a fallback for added reliability. For others, it acts as the primary data-source. HyperSync offers significant performance improvements, up to a 1000x faster than traditional RPC.",
|
|
320
327
|
"anyOf": [
|
|
321
328
|
{
|
|
322
|
-
"$ref": "#/$defs/
|
|
329
|
+
"$ref": "#/$defs/RpcSelection"
|
|
323
330
|
},
|
|
324
331
|
{
|
|
325
332
|
"type": "null"
|
|
@@ -337,80 +344,17 @@
|
|
|
337
344
|
}
|
|
338
345
|
]
|
|
339
346
|
},
|
|
340
|
-
"
|
|
347
|
+
"max_reorg_depth": {
|
|
341
348
|
"description": "The number of blocks from the head that the indexer should account for in case of reorgs.",
|
|
342
349
|
"type": [
|
|
343
350
|
"integer",
|
|
344
351
|
"null"
|
|
345
352
|
],
|
|
346
|
-
"format": "int32"
|
|
347
|
-
},
|
|
348
|
-
"start_block": {
|
|
349
|
-
"description": "The block at which the indexer should start ingesting data",
|
|
350
|
-
"type": "integer",
|
|
351
|
-
"format": "uint64",
|
|
352
|
-
"minimum": 0
|
|
353
|
-
},
|
|
354
|
-
"end_block": {
|
|
355
|
-
"description": "The block at which the indexer should terminate.",
|
|
356
|
-
"type": [
|
|
357
|
-
"integer",
|
|
358
|
-
"null"
|
|
359
|
-
],
|
|
360
|
-
"format": "uint64",
|
|
361
|
-
"minimum": 0
|
|
362
|
-
},
|
|
363
|
-
"contracts": {
|
|
364
|
-
"description": "All the contracts that should be indexed on the given network",
|
|
365
|
-
"type": "array",
|
|
366
|
-
"items": {
|
|
367
|
-
"$ref": "#/$defs/NetworkContract_for_ContractConfig"
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
},
|
|
371
|
-
"additionalProperties": false,
|
|
372
|
-
"required": [
|
|
373
|
-
"id",
|
|
374
|
-
"start_block",
|
|
375
|
-
"contracts"
|
|
376
|
-
]
|
|
377
|
-
},
|
|
378
|
-
"RpcConfig": {
|
|
379
|
-
"type": "object",
|
|
380
|
-
"properties": {
|
|
381
|
-
"url": {
|
|
382
|
-
"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.",
|
|
383
|
-
"anyOf": [
|
|
384
|
-
{
|
|
385
|
-
"type": "string"
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
"type": "array",
|
|
389
|
-
"items": {
|
|
390
|
-
"type": "string"
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
]
|
|
394
|
-
},
|
|
395
|
-
"initial_block_interval": {
|
|
396
|
-
"description": "The starting interval in range of blocks per query",
|
|
397
|
-
"type": [
|
|
398
|
-
"integer",
|
|
399
|
-
"null"
|
|
400
|
-
],
|
|
401
353
|
"format": "uint32",
|
|
402
354
|
"minimum": 0
|
|
403
355
|
},
|
|
404
|
-
"
|
|
405
|
-
"description": "
|
|
406
|
-
"type": [
|
|
407
|
-
"number",
|
|
408
|
-
"null"
|
|
409
|
-
],
|
|
410
|
-
"format": "double"
|
|
411
|
-
},
|
|
412
|
-
"acceleration_additive": {
|
|
413
|
-
"description": "Without RPC errors or timeouts, how much to increase the number of blocks requested by for the next batch",
|
|
356
|
+
"block_lag": {
|
|
357
|
+
"description": "The number of blocks behind the chain head that the indexer should lag. Useful for avoiding reorg issues by indexing slightly behind the tip.",
|
|
414
358
|
"type": [
|
|
415
359
|
"integer",
|
|
416
360
|
"null"
|
|
@@ -418,49 +362,39 @@
|
|
|
418
362
|
"format": "uint32",
|
|
419
363
|
"minimum": 0
|
|
420
364
|
},
|
|
421
|
-
"
|
|
422
|
-
"description": "
|
|
423
|
-
"type":
|
|
424
|
-
|
|
425
|
-
"null"
|
|
426
|
-
],
|
|
427
|
-
"format": "uint32",
|
|
428
|
-
"minimum": 0
|
|
429
|
-
},
|
|
430
|
-
"backoff_millis": {
|
|
431
|
-
"description": "After an error, how long to wait before retrying",
|
|
432
|
-
"type": [
|
|
433
|
-
"integer",
|
|
434
|
-
"null"
|
|
435
|
-
],
|
|
436
|
-
"format": "uint32",
|
|
365
|
+
"start_block": {
|
|
366
|
+
"description": "The block at which the indexer should start ingesting data",
|
|
367
|
+
"type": "integer",
|
|
368
|
+
"format": "uint64",
|
|
437
369
|
"minimum": 0
|
|
438
370
|
},
|
|
439
|
-
"
|
|
440
|
-
"description": "
|
|
371
|
+
"end_block": {
|
|
372
|
+
"description": "The block at which the indexer should terminate.",
|
|
441
373
|
"type": [
|
|
442
374
|
"integer",
|
|
443
375
|
"null"
|
|
444
376
|
],
|
|
445
|
-
"format": "
|
|
377
|
+
"format": "uint64",
|
|
446
378
|
"minimum": 0
|
|
447
379
|
},
|
|
448
|
-
"
|
|
449
|
-
"description": "
|
|
380
|
+
"contracts": {
|
|
381
|
+
"description": "All the contracts that should be indexed on the given chain",
|
|
450
382
|
"type": [
|
|
451
|
-
"
|
|
383
|
+
"array",
|
|
452
384
|
"null"
|
|
453
385
|
],
|
|
454
|
-
"
|
|
455
|
-
|
|
386
|
+
"items": {
|
|
387
|
+
"$ref": "#/$defs/ChainContract_for_ContractConfig"
|
|
388
|
+
}
|
|
456
389
|
}
|
|
457
390
|
},
|
|
458
391
|
"additionalProperties": false,
|
|
459
392
|
"required": [
|
|
460
|
-
"
|
|
393
|
+
"id",
|
|
394
|
+
"start_block"
|
|
461
395
|
]
|
|
462
396
|
},
|
|
463
|
-
"
|
|
397
|
+
"RpcSelection": {
|
|
464
398
|
"anyOf": [
|
|
465
399
|
{
|
|
466
400
|
"type": "string"
|
|
@@ -484,8 +418,22 @@
|
|
|
484
418
|
"type": "string"
|
|
485
419
|
},
|
|
486
420
|
"for": {
|
|
487
|
-
"description": "Determines if this RPC is for historical sync, real-time chain indexing, or as a fallback.",
|
|
488
|
-
"
|
|
421
|
+
"description": "Determines if this RPC is for historical sync, real-time chain indexing, or as a fallback. If not specified, defaults to \"fallback\" when HyperSync is available for the chain, or \"sync\" otherwise.",
|
|
422
|
+
"anyOf": [
|
|
423
|
+
{
|
|
424
|
+
"$ref": "#/$defs/For"
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
"type": "null"
|
|
428
|
+
}
|
|
429
|
+
]
|
|
430
|
+
},
|
|
431
|
+
"ws": {
|
|
432
|
+
"description": "Optional WebSocket endpoint URL (wss:// or ws://) for real-time block header notifications via eth_subscribe(\"newHeads\"). Provides lower latency than HTTP polling for detecting new blocks.",
|
|
433
|
+
"type": [
|
|
434
|
+
"string",
|
|
435
|
+
"null"
|
|
436
|
+
]
|
|
489
437
|
},
|
|
490
438
|
"initial_block_interval": {
|
|
491
439
|
"description": "The starting interval in range of blocks per query",
|
|
@@ -548,12 +496,20 @@
|
|
|
548
496
|
],
|
|
549
497
|
"format": "uint32",
|
|
550
498
|
"minimum": 0
|
|
499
|
+
},
|
|
500
|
+
"polling_interval": {
|
|
501
|
+
"description": "How frequently (in milliseconds) to check for new blocks in realtime. Default is 1000ms. Note: Setting this higher than block time does not reduce RPC usage as every block is still fetched to check for reorgs.",
|
|
502
|
+
"type": [
|
|
503
|
+
"integer",
|
|
504
|
+
"null"
|
|
505
|
+
],
|
|
506
|
+
"format": "uint32",
|
|
507
|
+
"minimum": 0
|
|
551
508
|
}
|
|
552
509
|
},
|
|
553
510
|
"additionalProperties": false,
|
|
554
511
|
"required": [
|
|
555
|
-
"url"
|
|
556
|
-
"for"
|
|
512
|
+
"url"
|
|
557
513
|
]
|
|
558
514
|
},
|
|
559
515
|
"For": {
|
|
@@ -567,6 +523,11 @@
|
|
|
567
523
|
"description": "Use RPC as a backup for the main data-source. Currently, it acts as a fallback when real-time indexing stalls, with potential for more cases in the future.",
|
|
568
524
|
"type": "string",
|
|
569
525
|
"const": "fallback"
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
"description": "Use RPC for real-time indexing only. HyperSync will be used for historical sync, then automatically switch to this RPC once synced for lower latency.",
|
|
529
|
+
"type": "string",
|
|
530
|
+
"const": "live"
|
|
570
531
|
}
|
|
571
532
|
]
|
|
572
533
|
},
|
|
@@ -583,7 +544,7 @@
|
|
|
583
544
|
"url"
|
|
584
545
|
]
|
|
585
546
|
},
|
|
586
|
-
"
|
|
547
|
+
"ChainContract_for_ContractConfig": {
|
|
587
548
|
"type": "object",
|
|
588
549
|
"properties": {
|
|
589
550
|
"name": {
|
|
@@ -595,7 +556,7 @@
|
|
|
595
556
|
"$ref": "#/$defs/Addresses"
|
|
596
557
|
},
|
|
597
558
|
"start_block": {
|
|
598
|
-
"description": "The block at which the indexer should start ingesting data for this specific contract. If not specified, uses the
|
|
559
|
+
"description": "The block at which the indexer should start ingesting data for this specific contract. If not specified, uses the chain start_block. Can be greater than the chain start_block for more specific indexing.",
|
|
599
560
|
"type": [
|
|
600
561
|
"integer",
|
|
601
562
|
"null"
|
|
@@ -611,8 +572,11 @@
|
|
|
611
572
|
]
|
|
612
573
|
},
|
|
613
574
|
"handler": {
|
|
614
|
-
"description": "
|
|
615
|
-
"type":
|
|
575
|
+
"description": "Optional relative path to a file where handlers are registered for the given contract. If not provided, handlers can be auto-loaded from src directory.",
|
|
576
|
+
"type": [
|
|
577
|
+
"string",
|
|
578
|
+
"null"
|
|
579
|
+
]
|
|
616
580
|
},
|
|
617
581
|
"events": {
|
|
618
582
|
"description": "A list of events that should be indexed on this contract",
|
|
@@ -658,13 +622,6 @@
|
|
|
658
622
|
}
|
|
659
623
|
]
|
|
660
624
|
},
|
|
661
|
-
"EventDecoder": {
|
|
662
|
-
"type": "string",
|
|
663
|
-
"enum": [
|
|
664
|
-
"viem",
|
|
665
|
-
"hypersync-client"
|
|
666
|
-
]
|
|
667
|
-
},
|
|
668
625
|
"AddressFormat": {
|
|
669
626
|
"type": "string",
|
|
670
627
|
"enum": [
|