envio 3.0.0-alpha.19-main-node-pg-client → 3.0.0-alpha.20

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 CHANGED
@@ -1,45 +1,179 @@
1
- # HyperIndex: Ultra-Fast Multichain Indexer
1
+ <div align="center">
2
+ <h1>HyperIndex: Ultra-Fast Multichain Indexer</h1>
3
+ <p><strong>The fastest independently benchmarked multichain blockchain indexer.</strong></p>
4
+ <p>
5
+ <a href="https://github.com/enviodev/hyperindex/releases"><img src="https://img.shields.io/github/release/enviodev/hyperindex.svg" alt="GitHub release" /></a>
6
+ <a href="https://github.com/enviodev/hyperindex/issues"><img src="https://img.shields.io/github/issues/enviodev/hyperindex.svg" alt="GitHub issues" /></a>
7
+ <a href="https://github.com/enviodev/hyperindex/graphs/contributors"><img src="https://img.shields.io/github/contributors/enviodev/hyperindex.svg" alt="GitHub contributors" /></a>
8
+ <a href="https://discord.gg/DhfFhzuJQh"><img src="https://img.shields.io/badge/Discord-Join%20Chat-7289da?logo=discord&logoColor=white" alt="Discord" /></a>
9
+ <a href="https://github.com/enviodev/hyperindex/stargazers"><img src="https://img.shields.io/github/stars/enviodev/hyperindex.svg" alt="GitHub stars" /></a>
10
+ </p>
11
+ <p>
12
+ <a href="https://docs.envio.dev">Documentation</a> ·
13
+ <a href="https://envio.dev">Hosted Service</a> ·
14
+ <a href="https://discord.gg/DhfFhzuJQh">Discord</a> ·
15
+ <a href="https://docs.envio.dev/blog/best-blockchain-indexers-2026">Benchmarks</a>
16
+ </p>
17
+ </div>
2
18
 
3
- [![GitHub release](https://img.shields.io/github/release/enviodev/hyperindex.svg)](https://github.com/enviodev/hyperindex/releases) [![GitHub issues](https://img.shields.io/github/issues/enviodev/hyperindex.svg)](https://github.com/enviodev/hyperindex/issues) [![GitHub contributors](https://img.shields.io/github/contributors/enviodev/hyperindex.svg)](https://github.com/enviodev/hyperindex/graphs/contributors) [![Discord](https://img.shields.io/badge/Discord-Join%20Chat-7289da?logo=discord&logoColor=white)](https://discord.gg/DhfFhzuJQh) [![GitHub stars](https://img.shields.io/github/stars/enviodev/hyperindex.svg)](https://github.com/enviodev/hyperindex/stargazers)
19
+ ---
20
+ ## What is HyperIndex?
4
21
 
5
- HyperIndex is a fast, developer-friendly multichain indexer, optimized for both local development and reliable hosted deployment. It empowers developers to effortlessly build robust backends for blockchain applications.
22
+ HyperIndex is Envio's full-featured blockchain indexing framework. It transforms onchain events into structured, queryable databases with GraphQL APIs, built for developers who care about performance and a clean local experience.
6
23
 
7
- > For comprehensive documentation, visit our [Documentation Portal](https://docs.envio.dev).
8
- > For hosted services and other solutions, visit [envio.dev](https://envio.dev).
24
+ Powered by [HyperSync](https://docs.envio.dev/docs/HyperSync/overview), Envio's proprietary data engine, HyperIndex delivers up to 2000x faster data access than traditional RPC endpoints. That's the difference between syncing in minutes instead of days.
9
25
 
10
- ![Envio Sync Gif](./sync.gif)
26
+ ![Envio Sync](sync.gif)
27
+
28
+ ---
29
+
30
+ ## Why HyperIndex?
31
+
32
+ Most blockchain indexers are bottlenecked by RPC. HyperIndex isn't. HyperSync, the data engine underneath, is a purpose-built, Rust-based query layer that retrieves multiple blocks per round trip, cuts out the overhead, and makes historical backfills genuinely fast.
33
+
34
+ Independent benchmarks run by Sentio confirm it:
35
+
36
+ - **Uniswap V2 Factory** (May 2025): HyperIndex completed in 1 minute. 15x faster than the nearest competitor (Subsquid), 143x faster than The Graph, 158x faster than Ponder
37
+ - **LBTC Token with RPC calls** (April 2025): HyperIndex completed in 3 minutes vs 3 hours 9 minutes for The Graph
38
+
39
+ [View full benchmark results →](https://docs.envio.dev/docs/HyperIndex/benchmarks)
40
+
41
+ ---
42
+
43
+ ## What you can build?
44
+
45
+ HyperIndex and HyperSync are the data layer for DeFi dashboards, protocol analytics, block explorers, stablecoin monitors, liquidation trackers, oracle comparisons, NFT explorers, and any application that needs fast, structured onchain data.
46
+
47
+ A few things already running in production:
48
+
49
+ - [v4.xyz](https://v4.xyz): the hub for Uniswap V4 data and analytics, indexing across 10 chains in real-time
50
+ - [Stable Volume](https://www.stablevolume.com/): real-time stablecoin transaction monitoring across 10+ chains
51
+ - [Stable Radar](https://stable-radar.com): real-time USDC transaction dashboard across multiple chains
52
+ - [Liqo](https://liqo.xyz): multichain liquidation tracking for DeFi lending protocols
53
+ - [Safe Stats](https://safe-stats.vercel.app/): real-time analytics for Safe multisig activity across all chains
54
+ - [Oracle Wars](https://oraclewars.xyz/): real-time oracle price comparison across multiple oracles
55
+ - [Chain Density](https://chaindensity.xyz/): transaction and event density analysis for any address across 70+ chains
56
+ - [LogTUI](https://www.npmjs.com/package/logtui): terminal UI for monitoring blockchain events in real-time
57
+
58
+ [See the full showcase →](https://docs.envio.dev/showcase)
59
+
60
+ ---
11
61
 
12
62
  ## Key Features
13
63
 
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 25,000+ events per second ([fastest in market](https://docs.envio.dev/blog/indexer-benchmarking-results))
16
- - **Local development** Full-featured local environment with Docker
17
- - **[Multichain indexing](https://docs.envio.dev/docs/HyperIndex/multichain-indexing)** Index any EVM-, SVM-, or Fuel-compatible blockchain
18
- - **Real-time indexing** Instantly track blockchain events
19
- - **[Reorg support](https://docs.envio.dev/docs/HyperIndex/reorgs-support)** – Graceful handling of blockchain reorganizations
20
- - **GraphQL API** – Easy-to-query indexed data
21
- - **Flexible language support** – TypeScript, JavaScript, and ReScript
22
- - **Factory contract support** Index data from 1M+ dynamically registered contracts seamlessly
23
- - **On-chain & off-chain data integration** Easily combine multiple data sources
24
- - **[Self-hosted & managed options](https://docs.envio.dev/docs/HyperIndex/hosted-service)** Run your own setup or use HyperIndex hosted services
25
- - **Detailed logging & error reporting** – Debug and optimize with clarity
26
- - **External API actions** – Trigger external services based on blockchain events
27
- - **[Wildcard topic indexing](https://docs.envio.dev/docs/HyperIndex/wildcard-indexing)** Flexible indexing based on event topics
28
- - **Fallback RPC data sources** Enhanced reliability with RPC connections
64
+ **Performance**
65
+ - Historical backfills at 10,000+ events per second
66
+ - Up to 2000x faster than traditional RPC via HyperSync (enabled by default, no config required)
67
+ - Sync times reduced from days to minutes
68
+ - Fallback RPC support for reliability without touching your indexer code
69
+
70
+ **Multichain indexing**
71
+ - Index EVM, SVM, and Fuel blockchains from a single indexer
72
+ - 70+ EVM chains with native HyperSync support, plus any EVM chain via RPC
73
+ - Unordered multichain mode for maximum throughput across chains
74
+ - Real-time indexing with reorg handling built in
75
+
76
+ **Developer experience**
77
+ - Auto-generate an indexer directly from a smart contract address or ABI, no manual setup required
78
+ - Write handlers in TypeScript, JavaScript, or ReScript
79
+ - Full local development environment with Docker
80
+ - GraphQL API generated automatically from your schema
81
+ - Wildcard topic indexing: index by event signatures across any contract, not just specified addresses
82
+ - Factory contract support for 1M+ dynamically registered contracts
83
+ - Onchain and off-chain data integration
84
+ - External API actions triggered by blockchain events
85
+ - Detailed logging and error reporting
86
+
87
+ **Deployment**
88
+ - Managed [hosted service](https://docs.envio.dev/docs/HyperIndex/hosted-service) with static endpoints, built-in alerts, and production-ready infrastructure
89
+ - Self-hosted via Docker
90
+ - No vendor lock-in. Switch between HyperSync and RPC at any time
91
+
92
+ **Agentic development**
93
+ - HyperIndex is the default indexing framework for AI-assisted and agentic workflows via Envio's hosted service CLI (`envio-cloud`) and Claude skills
94
+ - An agent can scaffold, configure, and deploy a production-ready indexer without touching a config file. [400,000 events indexed in ~20 seconds](https://docs.envio.dev/blog/agentic-blockchain-indexing-envio-hyperindex)
95
+
96
+ ---
97
+
98
+ ## Getting started
99
+
100
+ **Requirements**: Node.js, Docker (only needed for local development)
101
+
102
+ ```bash
103
+ npx envio init
104
+ ```
105
+
106
+ This scaffolds your entire indexer project, config, schema, and handler functions, in seconds. You can generate from a contract address, choose from templates, or start from an existing example.
107
+
108
+ From there, three files define your indexer:
109
+
110
+ - `config.yaml` — networks, contracts, events, and indexing behaviour
111
+ - `schema.graphql` — the shape of your indexed data
112
+ - `src/EventHandlers.*` — your handler logic in TypeScript, JavaScript, or ReScript
113
+
114
+ [Full getting started guide →](https://docs.envio.dev/docs/HyperIndex/getting-started)
29
115
 
30
- ## Getting Started
116
+ ---
31
117
 
32
- Check out our [Getting Started Guide](https://docs.envio.dev/docs/HyperIndex/getting-started) to start querying your smart contract data with just a few clicks!
118
+ ## HyperSync
33
119
 
34
- ## Performance
120
+ HyperSync is the data engine that makes HyperIndex fast. It's active by default for all supported networks, no configuration needed.
35
121
 
36
- HyperIndex delivers industry-leading indexing speeds, with capability to process thousands of events per second while maintaining data integrity across multiple chains.
122
+ Instead of making individual RPC calls per block, HyperSync retrieves multiple data points per round trip with advanced filtering. The result: sync speeds up to 2000x faster than standard RPC, dramatically lower infrastructure costs, and no rate limit headaches on supported networks.
37
123
 
38
- ## Contribution & Support
124
+ HyperSync can also be used directly for custom data pipelines in Python, Rust, Node.js, and Go, independent of HyperIndex.
125
+
126
+ [HyperSync docs →](https://docs.envio.dev/docs/HyperSync/overview)
127
+
128
+ ---
129
+
130
+ ## Supported networks
131
+
132
+ HyperIndex supports any EVM-compatible L1, L2, or L3, plus Fuel and Solana (experimental). 70+ chains have native HyperSync support for maximum speed. For any EVM chain not on the HyperSync list, RPC-based indexing works out of the box.
133
+
134
+ [Full network list →](https://docs.envio.dev/docs/HyperIndex/supported-networks)
135
+
136
+ ---
137
+
138
+ ## Migrating from The Graph, Ponder, or Subsquid
139
+
140
+ HyperIndex has a dedicated migration guide that covers config conversion, schema mapping, and query differences in 3 steps. Envio also offers white-glove migration support. Reach out on Discord and the team will help you get set up.
141
+
142
+ Teams migrating from The Graph can access 2 months of free hosting and full migration support.
143
+
144
+ [Migration guide →](https://docs.envio.dev/docs/HyperIndex/migration-guide)
145
+
146
+ ---
147
+
148
+ ## Documentation
149
+
150
+ Full documentation lives at [docs.envio.dev](https://docs.envio.dev).
151
+
152
+ Key sections:
153
+ - [Getting Started](https://docs.envio.dev/docs/HyperIndex/getting-started)
154
+ - [Contract Import / Auto-generation](https://docs.envio.dev/docs/HyperIndex/contract-import)
155
+ - [Multichain Indexing](https://docs.envio.dev/docs/HyperIndex/multichain-indexing)
156
+ - [Wildcard Indexing](https://docs.envio.dev/docs/HyperIndex/wildcard-indexing)
157
+ - [Reorg Support](https://docs.envio.dev/docs/HyperIndex/reorgs-support)
158
+ - [Hosted Service](https://docs.envio.dev/docs/HyperIndex/hosted-service)
159
+ - [HyperSync as Data Source](https://docs.envio.dev/docs/HyperIndex/hypersync)
160
+ - [Migration Guide](https://docs.envio.dev/docs/HyperIndex/migration-guide)
161
+
162
+ ---
163
+
164
+ ## Community and support
39
165
 
40
166
  - Follow us on [X](https://twitter.com/envio_indexer)
41
- - Join our [Discord community](https://discord.gg/DhfFhzuJQh)
42
- - Report issues on [GitHub](https://github.com/enviodev/hyperindex/issues/new/choose)
43
- - Check our [Common Issues](https://docs.envio.dev/docs/common-issues) page for troubleshooting
167
+ - Join the [Discord](https://discord.gg/DhfFhzuJQh), fastest way to get help
168
+ - Open an issue on [GitHub](https://github.com/enviodev/hyperindex/issues/new/choose)
169
+ - Browse [common issues](https://docs.envio.dev/docs/common-issues) for quick troubleshooting
170
+
171
+ If HyperIndex is useful to you, a ⭐ on this repo goes a long way.
172
+
173
+ ---
174
+
175
+ <div align="center">
176
+
177
+ Built by [Envio](https://envio.dev) · [Docs](https://docs.envio.dev)
44
178
 
45
- If you find HyperIndex useful, please consider giving us a ⭐ on this repo!
179
+ </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "envio",
3
- "version": "3.0.0-alpha.19-main-node-pg-client",
3
+ "version": "3.0.0-alpha.20",
4
4
  "type": "module",
5
5
  "description": "A latency and sync speed optimized, developer friendly blockchain data indexer.",
6
6
  "bin": "./bin.mjs",
@@ -61,13 +61,13 @@
61
61
  "ink": "6.8.0",
62
62
  "ink-big-text": "2.0.0",
63
63
  "ink-spinner": "5.0.0",
64
- "pg": "8.16.0",
64
+ "postgres": "3.4.8",
65
65
  "tsx": "4.21.0"
66
66
  },
67
67
  "optionalDependencies": {
68
- "envio-linux-x64": "3.0.0-alpha.19-main-node-pg-client",
69
- "envio-linux-arm64": "3.0.0-alpha.19-main-node-pg-client",
70
- "envio-darwin-x64": "3.0.0-alpha.19-main-node-pg-client",
71
- "envio-darwin-arm64": "3.0.0-alpha.19-main-node-pg-client"
68
+ "envio-linux-x64": "3.0.0-alpha.20",
69
+ "envio-linux-arm64": "3.0.0-alpha.20",
70
+ "envio-darwin-x64": "3.0.0-alpha.20",
71
+ "envio-darwin-arm64": "3.0.0-alpha.20"
72
72
  }
73
73
  }
@@ -245,6 +245,7 @@ let make = (
245
245
  sourceManager: SourceManager.make(
246
246
  ~sources,
247
247
  ~maxPartitionConcurrency=Env.maxPartitionConcurrency,
248
+ ~isLive=timestampCaughtUpToHeadOrEndblock->Option.isSome,
248
249
  ),
249
250
  reorgDetection: ReorgDetection.make(
250
251
  ~chainReorgCheckpoints,
@@ -152,7 +152,7 @@ function make(chainConfig, dynamicContracts, startBlock, endBlock, firstEventBlo
152
152
  return {
153
153
  logger: logger,
154
154
  fetchState: fetchState,
155
- sourceManager: SourceManager.make(sources$1, Env.maxPartitionConcurrency, undefined, undefined, undefined),
155
+ sourceManager: SourceManager.make(sources$1, Env.maxPartitionConcurrency, Belt_Option.isSome(timestampCaughtUpToHeadOrEndblock), undefined, undefined, undefined, undefined, undefined),
156
156
  chainConfig: chainConfig,
157
157
  isProgressAtHead: false,
158
158
  timestampCaughtUpToHeadOrEndblock: timestampCaughtUpToHeadOrEndblock,
package/src/Config.res CHANGED
@@ -385,7 +385,6 @@ let parseEntitiesFromJson = (
385
385
 
386
386
  let table = Table.mkTable(
387
387
  entityName,
388
- ~stmtId=index->Belt.Int.toString,
389
388
  ~fields=Array.concat(fields, derivedFields),
390
389
  ~compositeIndices,
391
390
  )
@@ -41,7 +41,7 @@ var schema = S$RescriptSchema.schema(function (s) {
41
41
 
42
42
  var rowsSchema = S$RescriptSchema.array(schema);
43
43
 
44
- var table = Table.mkTable(name, undefined, undefined, [
44
+ var table = Table.mkTable(name, undefined, [
45
45
  Table.mkField("id", "String", S$RescriptSchema.string, undefined, undefined, undefined, true, undefined, undefined),
46
46
  Table.mkField("chain_id", "Int32", S$RescriptSchema.$$int, undefined, undefined, undefined, undefined, undefined, undefined),
47
47
  Table.mkField("registering_event_block_number", "Int32", S$RescriptSchema.$$int, undefined, undefined, undefined, undefined, undefined, undefined),
@@ -320,7 +320,7 @@ function parseEntitiesFromJson(entitiesJson, enumConfigsByName) {
320
320
  };
321
321
  }));
322
322
  }));
323
- var table = Table.mkTable(entityName, String(index), compositeIndices, Belt_Array.concat(fields, derivedFields));
323
+ var table = Table.mkTable(entityName, compositeIndices, Belt_Array.concat(fields, derivedFields));
324
324
  var schema = S$RescriptSchema.schema(function (s) {
325
325
  var dict = {};
326
326
  Belt_Array.forEach(entityJson.properties, (function (prop) {
package/src/Env.res CHANGED
@@ -109,7 +109,7 @@ module Db = {
109
109
  )
110
110
  let ssl = envSafe->EnvSafe.get(
111
111
  "ENVIO_PG_SSL_MODE",
112
- Pg.sslOptionsSchema,
112
+ Postgres.sslOptionsSchema,
113
113
  //this is a dev fallback option for local deployments, shouldn't run in the prod env
114
114
  //the SSL modes should be provided as string otherwise as 'require' | 'allow' | 'prefer' | 'verify-full'
115
115
  ~devFallback=Bool(false),
package/src/Env.res.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as Pg from "./bindings/Pg.res.mjs";
4
3
  import * as EnvSafe from "rescript-envsafe/src/EnvSafe.res.mjs";
5
4
  import * as Logging from "./Logging.res.mjs";
5
+ import * as Postgres from "./bindings/Postgres.res.mjs";
6
6
  import * as Belt_Option from "rescript/lib/es6/belt_Option.js";
7
7
  import * as HyperSyncClient from "./sources/HyperSyncClient.res.mjs";
8
8
  import * as S$RescriptSchema from "rescript-schema/src/S.res.mjs";
@@ -82,7 +82,7 @@ var database = EnvSafe.get(envSafe, "ENVIO_PG_DATABASE", S$RescriptSchema.string
82
82
 
83
83
  var publicSchema = EnvSafe.get(envSafe, "ENVIO_PG_SCHEMA", S$RescriptSchema.string, undefined, EnvSafe.get(envSafe, "ENVIO_PG_PUBLIC_SCHEMA", S$RescriptSchema.string, undefined, "public", undefined, undefined), undefined, undefined);
84
84
 
85
- var ssl = EnvSafe.get(envSafe, "ENVIO_PG_SSL_MODE", Pg.sslOptionsSchema, undefined, undefined, false, undefined);
85
+ var ssl = EnvSafe.get(envSafe, "ENVIO_PG_SSL_MODE", Postgres.sslOptionsSchema, undefined, undefined, false, undefined);
86
86
 
87
87
  var maxConnections = EnvSafe.get(envSafe, "ENVIO_PG_MAX_CONNECTIONS", S$RescriptSchema.$$int, undefined, 2, undefined, undefined);
88
88
 
@@ -791,7 +791,11 @@ let checkAndFetchForChain = (
791
791
 
792
792
  await chainFetcher.sourceManager->SourceManager.fetchNext(
793
793
  ~fetchState,
794
- ~waitForNewBlock=(~knownHeight) => chainFetcher.sourceManager->waitForNewBlock(~knownHeight),
794
+ ~waitForNewBlock=(~knownHeight) =>
795
+ chainFetcher.sourceManager->waitForNewBlock(
796
+ ~knownHeight,
797
+ ~isLive=chainFetcher->ChainFetcher.isReady,
798
+ ),
795
799
  ~onNewBlock=(~knownHeight) => dispatchAction(FinishWaitingForNewBlock({chain, knownHeight})),
796
800
  ~executeQuery=async query => {
797
801
  try {
@@ -799,6 +803,7 @@ let checkAndFetchForChain = (
799
803
  await chainFetcher.sourceManager->executeQuery(
800
804
  ~query,
801
805
  ~knownHeight=fetchState.knownHeight,
806
+ ~isLive=chainFetcher->ChainFetcher.isReady,
802
807
  )
803
808
  dispatchAction(ValidatePartitionQueryResponse({chain, response, query}))
804
809
  } catch {
@@ -877,7 +877,7 @@ function checkAndFetchForChain(waitForNewBlock, executeQuery, state, dispatchAct
877
877
  var fetchState = chainFetcher.fetchState;
878
878
  return await SourceManager.fetchNext(chainFetcher.sourceManager, fetchState, (async function (query) {
879
879
  try {
880
- var response = await executeQuery(chainFetcher.sourceManager, query, fetchState.knownHeight);
880
+ var response = await executeQuery(chainFetcher.sourceManager, query, fetchState.knownHeight, ChainFetcher.isReady(chainFetcher));
881
881
  return dispatchAction({
882
882
  TAG: "ValidatePartitionQueryResponse",
883
883
  _0: {
@@ -895,7 +895,7 @@ function checkAndFetchForChain(waitForNewBlock, executeQuery, state, dispatchAct
895
895
  });
896
896
  }
897
897
  }), (function (knownHeight) {
898
- return waitForNewBlock(chainFetcher.sourceManager, knownHeight);
898
+ return waitForNewBlock(chainFetcher.sourceManager, knownHeight, ChainFetcher.isReady(chainFetcher));
899
899
  }), (function (knownHeight) {
900
900
  dispatchAction({
901
901
  TAG: "FinishWaitingForNewBlock",
@@ -148,7 +148,7 @@ var effectCacheItemRowsSchema = S$RescriptSchema.array(S$RescriptSchema.schema(f
148
148
  }));
149
149
 
150
150
  function makeCacheTable(effectName) {
151
- return Table.mkTable(cacheTablePrefix + effectName, undefined, undefined, [
151
+ return Table.mkTable(cacheTablePrefix + effectName, undefined, [
152
152
  Table.mkField("id", "String", S$RescriptSchema.string, undefined, undefined, undefined, true, undefined, undefined),
153
153
  Table.mkField("output", "Json", cacheOutputSchema, undefined, undefined, true, undefined, undefined, undefined)
154
154
  ]);
@@ -0,0 +1,10 @@
1
+ /* TypeScript file generated from PgStorage.res by genType. */
2
+
3
+ /* eslint-disable */
4
+ /* tslint:disable */
5
+
6
+ import * as PgStorageJS from './PgStorage.res.mjs';
7
+
8
+ import type {sql as Postgres_sql} from '../src/bindings/Postgres.gen.js';
9
+
10
+ export const makeClient: () => Postgres_sql = PgStorageJS.makeClient as any;