Skip to content

blog: add Sei smart contract indexing tutorial#947

Merged
Jordy-Baby merged 7 commits into
mainfrom
add/sei-tutorial-blog
Jun 4, 2026
Merged

blog: add Sei smart contract indexing tutorial#947
Jordy-Baby merged 7 commits into
mainfrom
add/sei-tutorial-blog

Conversation

@Jordy-Baby
Copy link
Copy Markdown
Collaborator

@Jordy-Baby Jordy-Baby commented Jun 2, 2026

Summary

  • New blog tutorial walking through indexing Circle's native USDC on Sei mainnet with HyperIndex, plus a Sei testnet variant
  • Validated end-to-end against envio@3.0.2 (live test scaffolded the project, ran pnpm codegen + pnpm dev, and queried real on-chain data through the GraphQL endpoint)
  • Co-authored with @KenauVith32

Test plan

  • Image asset /blog-assets/index-sei-smart-contracts-envio.png to be added
  • Confirm the post renders at docs.envio.dev/blog/index-sei-smart-contracts-envio
  • Verify the in-page anchor link to #indexing-on-sei-testnet resolves

Summary by CodeRabbit

  • Documentation
    • Added a step-by-step blog tutorial showing how to scaffold and configure an ERC20 indexer for Sei (mainnet & testnet), define a GraphQL schema to track account balances and approvals, implement event handlers to update balances and approvals, run/dev commands and a sample GraphQL query, plus troubleshooting tips (API token requirement, DB reset, start-block checks, optional sync endpoint) and additional resources.

End-to-end HyperIndex tutorial walking through indexing Circle's
native USDC on Sei mainnet, with a testnet variant and a tested
GraphQL query. Validated live against envio@3.0.2.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

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

Project Deployment Actions Updated (UTC)
envio-docs Ready Ready Preview, Comment Jun 3, 2026 3:20pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8464d830-173b-48f6-8ec3-dd11d51f7c3d

📥 Commits

Reviewing files that changed from the base of the PR and between 23586a2 and 340ab69.

⛔ Files ignored due to path filters (1)
  • static/blog-assets/index-sei-smart-contracts-envio.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • blog/2026-06-02-index-sei-smart-contracts-envio.md

📝 Walkthrough

Walkthrough

Adds a new comprehensive blog tutorial that shows how to scaffold a HyperIndex ERC20 project for Sei (mainnet/testnet), configure chain and contract settings, define a GraphQL schema, implement Transfer and Approval event handlers, run the indexer, query the local GraphQL API, and troubleshoot common issues.

Changes

Sei Smart Contract Indexing Tutorial

Layer / File(s) Summary
Post frontmatter and intro
blog/2026-06-02-index-sei-smart-contracts-envio.md
Adds frontmatter metadata, hero image, TL;DR, and tutorial overview with a step list.
Project scaffolding and mainnet config
blog/2026-06-02-index-sei-smart-contracts-envio.md
Prerequisites and Step 1–3: scaffold ERC20 template, ENVIO_API_TOKEN notes, and replace config.yaml to target Sei mainnet (chain ID 1329, start_block 79123881) with USDC contract and selected events.
Schema and event handler implementation
blog/2026-06-02-index-sei-smart-contracts-envio.md
Step 3–4: schema.graphql defines Account and Approval (with @derivedFrom) and src/handlers/MyContract.ts implements Transfer (updates per-account balances) and Approval (persists approval records with block/timestamp and ensures Account existence).
Codegen, run, and query flow
blog/2026-06-02-index-sei-smart-contracts-envio.md
Step 5–8: run pnpm codegen, start the indexer (pnpm dev), sample GraphQL curl query for balances/approvals, and stop the indexer (pnpm envio stop).
Testnet configuration and troubleshooting
blog/2026-06-02-index-sei-smart-contracts-envio.md
Adds a Sei testnet section (chain ID 1328, testnet USDC address/start block) and troubleshooting notes (API token, stale DB/state, incorrect start blocks, optional manual hypersync_config).
Resources and footer
blog/2026-06-02-index-sei-smart-contracts-envio.md
Resources links for HyperIndex/HyperSync, schema and handler docs, CLI docs, USDC-on-Sei references, and Build With Envio/footer content.

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'blog: add Sei smart contract indexing tutorial' directly and clearly summarizes the main change: adding a new blog post that teaches how to index Sei smart contract data using Envio.
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.


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

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

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@blog/2026-06-02-index-sei-smart-contracts-envio.md`:
- Around line 64-67: Multiple fenced code blocks in the blog post are missing
language identifiers (MD040); update each fence to include the correct language
(e.g., ```bash for shell commands like "pnpx envio init template -t erc20 -d
./sei-indexer", "pnpm codegen", "pnpm dev", curl commands, and "pnpm envio
stop", and ```dotenv for environment snippets such as the ENVIO_API_TOKEN block)
so markdownlint passes; apply these changes to the other occurrences noted (the
blocks around the examples shown and the ranges called out in the review).
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8599143e-3a39-4117-9431-2cb6793cbb32

📥 Commits

Reviewing files that changed from the base of the PR and between 74139ba and 23586a2.

📒 Files selected for processing (1)
  • blog/2026-06-02-index-sei-smart-contracts-envio.md

Comment thread blog/2026-06-02-index-sei-smart-contracts-envio.md Outdated
Jordy-Baby and others added 2 commits June 2, 2026 13:49
Addresses CodeRabbit review — tagged shell blocks as bash and
env-file blocks as dotenv.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Links Indexer Explorer and case studies, matching the Sei docs
section we're submitting upstream.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Jordy-Baby Jordy-Baby enabled auto-merge (squash) June 2, 2026 17:51
Jordy-Baby and others added 2 commits June 2, 2026 13:53
Replace the Indexer Explorer + Case studies bullets with the
standard Build With Envio footer used on the Katana case study
and other recent posts.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The pnpx envio init flow already prompts for an API token, so the
separate "Add your API token" step is redundant. Mention the token
prompt inline in Step 1, drop Step 2, and renumber the rest.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Jordy-Baby Jordy-Baby merged commit 8615460 into main Jun 4, 2026
3 checks passed
@Jordy-Baby Jordy-Baby deleted the add/sei-tutorial-blog branch June 4, 2026 08:18
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