Skip to content

Rough draft alpha 23 migration#898

Merged
DZakh merged 2 commits into
mainfrom
nb/migration-guide-update
May 4, 2026
Merged

Rough draft alpha 23 migration#898
DZakh merged 2 commits into
mainfrom
nb/migration-guide-update

Conversation

@nikbhintade
Copy link
Copy Markdown
Member

@nikbhintade nikbhintade commented May 4, 2026

WIP: still working on cross checking the new snippet generated by claude

Summary by CodeRabbit

  • Documentation
    • Migration guide updated for HyperIndex v3 alpha: unified indexer handlers, new handler filtering (where) and start-block overrides, ESM + top-level await examples, and updated testing/import guidance.
    • RPC terminology changed from “live” → “realtime”; Solana docs note onSlot-only support and no reorgs.
    • ClickHouse rebranded to “ClickHouse Storage” with multi-backend storage config, operational notes, and expanded FAQ.
    • TUI now auto-disables in CI/agents and env var renamed to disable it; blog/index links updated.

@nikbhintade nikbhintade requested a review from DZakh May 4, 2026 13:02
@nikbhintade nikbhintade self-assigned this May 4, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented May 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
envio-docs Ready Ready Preview, Comment May 4, 2026 2:11pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7624469e-eff4-4998-b893-1526fe80b6e5

📥 Commits

Reviewing files that changed from the base of the PR and between 3eadc2f and 30de62c.

⛔ Files ignored due to path filters (1)
  • static/blog-assets/clickhouse-storage.png is excluded by !**/*.png
📒 Files selected for processing (6)
  • blog/2026-04-24-clickhouse-storage.md
  • blog/2026-04-28-dev-update-april-2026.md
  • docs/HyperIndex-LLM/hyperindex-complete.mdx
  • docs/HyperIndex/migrate-to-v3.md
  • docs/HyperIndex/solana/solana.md
  • static/blog-posts-index.json

📝 Walkthrough

Walkthrough

Updates HyperIndex v3 docs to reflect Alpha v3 unified indexer handler registration (indexer.onEvent, indexer.contractRegister, indexer.onBlock) and the new where filtering/block-range model. Refreshes examples to ESM + top-level await, renames ClickHouse “Sink” → “Storage”, adds realtime RPC mode, testing API changes, TUI env var rename, and bumps to v3.0.0-alpha.24.

Changes

V3 Migration & ClickHouse Storage Documentation

Layer / File(s) Summary
Unified Handlers API
docs/HyperIndex/migrate-to-v3.md (lines 21–135, 723–736, 1129–1220)
Describes removal of contract-specific exports and introduces indexer.onEvent, indexer.contractRegister, indexer.onBlock. Documents where replacement for eventFilters, boolean enable/disable, and per-event start-block via where.block.number._gte.
Code Examples & Patterns
docs/HyperIndex/migrate-to-v3.md (lines 136–171, 189–283, 504–516, 771–797, 787–797)
Rewrites examples to use ESM/top-level await, access context.chain/indexer, shows event.contractName/event.eventName, and updates testing examples to createTestIndexer() imports and usage.
RPC / Realtime Mode
docs/HyperIndex/migrate-to-v3.md (lines 189–283), docs/HyperIndex-LLM/hyperindex-complete.mdx (lines 744–753, 1026–1027)
Renames RPC “live” → “realtime”, updates YAML/WebSocket examples and documents context.chain.isRealtime.
ClickHouse: Sink → Storage
docs/HyperIndex/migrate-to-v3.md (lines 310–327, 915–939), blog/2026-04-24-clickhouse-storage.md, docs/HyperIndex-LLM/hyperindex-complete.mdx (lines 844–860)
Replaces experimental "Sink" docs with "Storage": config model storage: { postgres, clickhouse }, env var rename to ENVIO_CLICKHOUSE_*, operational notes (backfill writes final-state-per-batch), and warning against multiple indexers writing same DB.
Solana Handler Semantics
docs/HyperIndex/migrate-to-v3.md (lines 346–353, 10901–10916 in hyperindex-complete), docs/HyperIndex/solana/solana.md (lines 6–14, 27–29)
Clarifies Solana supports onSlot (not block handlers), manual slot fetching, finalized-slot latency (~20s), and no reorg support.
Packaging, Types & Test Migration
docs/HyperIndex/migrate-to-v3.md (lines 915–939, 1283–1333, 754–756)
Bumps envio to v3.0.0-alpha.24, removes local generated package (types emitted to .envio/types.d.ts), removes output option, updates Quick Migration Checklist and MockDb → createTestIndexer() migration steps.
TUI / CLI / Env Var Updates
docs/HyperIndex/migrate-to-v3.md (lines 384–385, 771–772, 782–786)
Documents TUI auto-disable in CI/AI agents, renames TUI_OFFENVIO_TUI=false, and clarifies envio dev vs envio start behavior.
Site Index & Blog Links
static/blog-posts-index.json, blog/2026-04-28-dev-update-april-2026.md
Replaces ClickHouse Sink post metadata/slug with ClickHouse Storage and updates internal blog links to the new slug.
Release Notes / References
docs/HyperIndex/migrate-to-v3.md (lines 1346–1351)
Updates Release Notes links to include v3.0.0-alpha.24 (and recent alphas).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • DZakh
  • moose-code

"🐰 I hopped through docs with a pen so spry,
Indexers, 'where' and realtime now fly,
ClickHouse wears 'Storage' in the sun,
Alpha twenty-four — the migration's begun! 🥕"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Rough draft alpha 23 migration' is vague and uses informal language ('Rough draft') that doesn't clearly convey the specific changes made to the migration documentation. Use a more descriptive and professional title that clearly indicates the main change, such as 'Update HyperIndex v3 migration guide to alpha 23' or 'Migrate documentation examples to HyperIndex v3 alpha 23 API'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch nb/migration-guide-update

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/HyperIndex/migrate-to-v3.md`:
- Around line 1020-1023: Add a short, temporary cross-doc warning at the top of
the "Migrate to the unified `indexer` API" section that tells readers that
legacy handler exports like `Contract.Event.handler` and `.contractRegister` are
still shown elsewhere and links back to this migration section; explicitly
recommend using `indexer.onEvent`, `indexer.contractRegister`, or
`indexer.onBlock` instead, and add the same one-line warning to the other
migration area that mirrors this content so copy-pasted legacy patterns won't
break readers.
- Around line 1066-1073: The snippet is incomplete because it uses
indexer.contractRegister without showing how to obtain the indexer instance;
update the “After” example to include a preceding import/initialization of the
indexer (so the indexer variable referenced by indexer.contractRegister exists),
e.g., show importing or creating the indexer instance (using the project's
indexer factory or createIndexer entrypoint) before calling
indexer.contractRegister, and ensure the snippet demonstrates a ready-to-use
indexer variable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9798c664-33a2-4a82-b23f-3f3c420091c9

📥 Commits

Reviewing files that changed from the base of the PR and between a6bc8b6 and 3eadc2f.

📒 Files selected for processing (1)
  • docs/HyperIndex/migrate-to-v3.md

Comment on lines +1020 to +1023
**Migrate to the unified `indexer` API:**

All contract-specific handler exports (`ERC20.Transfer.handler`, `Greeter.NewGreeting.contractRegister`, etc.) have been removed. Register every handler through `indexer.onEvent`, `indexer.contractRegister`, or `indexer.onBlock`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add a temporary cross-doc warning while legacy tutorials are still published.

This guide says the old handler API is hard removed, but other docs in-repo still show legacy Contract.Event.handler / .contractRegister patterns. Please add a short warning here linking users back to this migration section until those pages are updated, to avoid copy-paste failures.

Also applies to: 639-643

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/HyperIndex/migrate-to-v3.md` around lines 1020 - 1023, Add a short,
temporary cross-doc warning at the top of the "Migrate to the unified `indexer`
API" section that tells readers that legacy handler exports like
`Contract.Event.handler` and `.contractRegister` are still shown elsewhere and
links back to this migration section; explicitly recommend using
`indexer.onEvent`, `indexer.contractRegister`, or `indexer.onBlock` instead, and
add the same one-line warning to the other migration area that mirrors this
content so copy-pasted legacy patterns won't break readers.

Comment thread docs/HyperIndex/migrate-to-v3.md
Comment thread docs/HyperIndex/migrate-to-v3.md Outdated
**Event handlers** with `indexer.onEvent`:

```typescript
import { indexer } from "generated";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { indexer } from "generated";
import { indexer } from "envio";

Comment thread docs/HyperIndex/migrate-to-v3.md Outdated
**Dynamic contracts** with `indexer.contractRegister`:

```typescript
import { indexer } from "generated";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { indexer } from "generated";
import { indexer } from "envio";

Comment thread docs/HyperIndex/migrate-to-v3.md Outdated
**Block handlers** with `indexer.onBlock` consolidate across chains in a single call:

```typescript
import { indexer } from "generated";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { indexer } from "generated";
import { indexer } from "envio";

Comment thread docs/HyperIndex/migrate-to-v3.md Outdated

```typescript
import { ERC20 } from "generated";
import { indexer } from "generated";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { indexer } from "generated";
import { indexer } from "envio";

Comment thread docs/HyperIndex/migrate-to-v3.md Outdated
Comment on lines +160 to +165
where: () => ({
params: [
{ from: ZERO_ADDRESS, to: addressesFromServer },
{ from: addressesFromServer, to: ZERO_ADDRESS },
],
}),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
where: () => ({
params: [
{ from: ZERO_ADDRESS, to: addressesFromServer },
{ from: addressesFromServer, to: ZERO_ADDRESS },
],
}),
where: {
params: [
{ from: ZERO_ADDRESS, to: addressesFromServer },
{ from: addressesFromServer, to: ZERO_ADDRESS },
],
},

Comment thread docs/HyperIndex/migrate-to-v3.md Outdated
console.log(context.chain.id); // 1 - The chain id of the event
console.log(context.chain.isLive); // true - Whether the event chain is indexing at the head
});
import { indexer } from "generated";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { indexer } from "generated";
import { indexer } from "envio";

Comment thread docs/HyperIndex/migrate-to-v3.md Outdated
{ contract: "ERC20", event: "Approval" },
async ({ context }) => {
console.log(context.chain.id); // 1 - The chain id of the event
console.log(context.chain.isLive); // true - Whether the event chain is indexing at the head
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
console.log(context.chain.isLive); // true - Whether the event chain is indexing at the head
console.log(context.chain.isRealtime); // true - Whether the indexer entered realtime mode

Comment thread docs/HyperIndex/migrate-to-v3.md Outdated
async ({ event, context }) => {
// ... your handler logic
},
import { indexer } from "generated";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { indexer } from "generated";
import { indexer } from "envio";

Comment thread docs/HyperIndex/migrate-to-v3.md Outdated
clickhouse: true
```

Then configure the ClickHouse connection with environment variables: `ENVIO_CLICKHOUSE_SINK_HOST`, `ENVIO_CLICKHOUSE_SINK_DATABASE`, `ENVIO_CLICKHOUSE_SINK_USERNAME`, `ENVIO_CLICKHOUSE_SINK_PASSWORD`. Currently supported only on Dedicated Plan.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The env vars without SINK now. Also remove sync mention, it is just a clickhouse storage.

Comment thread docs/HyperIndex/migrate-to-v3.md Outdated

```bash
pnpx envio@3.0.0-alpha.21 init svm
pnpx envio@3.0.0-alpha.23 init svm
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pnpx envio@3.0.0-alpha.23 init svm
pnpx envio@3.0.0-alpha.24 init svm

* docs: apply PR review fixes to v3 migration guide

- Switch indexer imports from "generated" to "envio"
- Use static where object in top-level await snippet
- Rename context.chain.isLive to isRealtime (and chains[].isLive)
- Drop SINK from ClickHouse env vars and reframe as storage, not sink
- Bump alpha version 23 -> 24 in init/package.json snippets and release list

* docs: rename RPC source mode from live to realtime

The `for: live` config option was renamed to `for: realtime`. Update
both the migration guide and the LLM doc bundle.

* docs: cover v3.0.0-alpha.24 release in migration guide

- Switch remaining V3 example imports from "generated" to "envio"
  (test indexer, type imports, MockDb diff, capitalized entity types)
- Document removal of the local "generated" package and the new
  envio-env.d.ts / .envio types layout
- Note the "output" config flag removal and TUI_OFF -> ENVIO_TUI=false
  breaking change, with checklist entries
- Add new feature blurbs for "envio metrics" and continue-on-config-change

* docs: clarify realtime RPC mode promotes the source to primary

* docs: cover remaining v3.0.0-alpha.23 release notes

- Expand ClickHouse Storage section with auto-launch dev container
  and rename of the early-V3 Sink feature
- Add new feature sections: optimized envio codegen, -88MB package
  size, no hard pnpm requirement, Bun support, --package-manager
  flag on init, named-field tuple params, throttled multichain
  backfill, indexer state restored from DB, ReScript v12 / TypeScript v6
- Note ENVIO_PG_HOST and S.nullable fixes under Fixes

* docs: tighten ClickHouse coverage and Indexer State section

- Drop the early-V3 Sink reference from the migration ClickHouse blurb
- Update the ClickHouse blog and the LLM doc bundle to use the new
  ENVIO_CLICKHOUSE_* env vars and config.yaml storage block, and
  bump the init command to alpha.24
- Fold the DB-restored indexer state note into the Indexer State &
  Config section instead of standing alone
- Add types: ["node"] to the suggested tsconfig

* docs: rename ClickHouse Sink to ClickHouse Storage in blog

- Rephrase every "Sink"/"sink" usage to "Storage"/"ClickHouse Storage"
  in the dedicated blog post and rename the file/slug accordingly
- Update the dev-update blog link to the new slug
- Drop "now" from the indexer-state DB-restore note in migration guide
- Bump suggested package.json devDependencies to add @types/node and
  vitest pins and bring TypeScript to 6.0.3

* docs: rename ClickHouse cover image to clickhouse-storage.png

* docs: rename Solana onBlock handler to onSlot

Solana uses slots rather than blocks, so the handler is exposed as
indexer.onSlot. Update the Solana page (frontmatter, supported list,
notes) and the LLM doc bundle, and add a one-line note in the V3
migration guide's Solana Support section.

* docs: rename remaining 'live' RPC mode references to 'realtime'

* docs: add explicit Envio Dev/Start Update sections side by side

---------

Co-authored-by: Claude <noreply@anthropic.com>
@DZakh DZakh merged commit b00cb51 into main May 4, 2026
2 of 3 checks passed
@DZakh DZakh deleted the nb/migration-guide-update branch May 4, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants