Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
922b2b3
Add `envio data` CLI for raw HyperSync queries
claude May 22, 2026
86b07a4
envio data: switch --where to JSON5, drop HyperSync from user copy
claude May 22, 2026
2b32768
envio data: use native hypersync_client for EVM queries
claude May 25, 2026
4d3ee6e
Remove Fuel support from envio data, use end-to-end integration tests
claude May 25, 2026
bbf08b5
Clean up review feedback
claude May 25, 2026
cddad45
Replace mapping table and field accessors with Arrow + strum
claude May 25, 2026
5735b50
Address review: exact error snapshots, .env token loading, revert use…
claude May 25, 2026
37a2cde
Case-insensitive field lookup: accept camelCase, snake_case, UPPER, etc.
claude May 25, 2026
30f7e04
Full-message assertions, concise skill, CLAUDE.md no-contains rule
claude May 27, 2026
55ae083
Fix quantity rendering, operator merging, trim integration tests
claude May 27, 2026
6ffa229
Show full stdout + stderr in integration test failures
claude May 27, 2026
b41c66b
Snapshot full stdout in integration tests
claude May 27, 2026
b36e910
Rename TOON height header to knownHeight, assert full stderr in tests
claude May 27, 2026
06fd192
Fix clippy lints in data::mapping
claude May 29, 2026
7f5bf0b
Fix doctest failures: mark Data clap help code blocks as `text`
claude May 29, 2026
7777822
Use inline backticks for Data clap help examples
claude Jun 2, 2026
6b565a6
Add bash language tag to SKILL.md synopsis fence
claude Jun 2, 2026
78db141
Make column_format match exhaustive; trim pagination output
claude Jun 2, 2026
25781b9
Distinguish chain-head from mid-range pagination output
claude Jun 2, 2026
6a1a665
Render knownHeight as a scalar TOON value
claude Jun 2, 2026
84f6cb2
Mention transactions in envio-data SKILL description
claude Jun 2, 2026
56f59b7
Tighten envio-data SKILL field/where notes
claude Jun 2, 2026
263e4d8
Trim envio-data SKILL intro and cross-link from indexer-testing
claude Jun 2, 2026
274e45d
Apply code-review quality cleanups across the data subcommand
claude Jun 2, 2026
7e8d6de
Split data tests from hypersync health check via separate features
claude Jun 2, 2026
6831592
Run envio data integration tests in the normal cargo test flow
claude Jun 2, 2026
5edd5cb
Merge branch 'main' into claude/amazing-thompson-IzI1M
DZakh Jun 2, 2026
38961ae
Support client-side filtering and comparison operators in --where (#1…
DZakh Jun 3, 2026
47320f7
Support block-only selections and block.number set filters (#1277)
DZakh Jun 3, 2026
dedd179
envio data: preserve field casing in TOON, trim block.number page hin…
DZakh Jun 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_and_verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ jobs:
- uses: ./.github/actions/cargo-cache

- name: Hypersync Health Test
run: cargo test --features integration_tests
run: cargo test --features hypersync_health

# Template tests - verify envio templates can be initialized and built
template-tests:
Expand Down
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
- Use `pnpm` over `npm`/`npx`.
- Always use single assert to check the whole value instead of multiple asserts for every field.
- Never use `contains` in test assertions — assert the full expected value. Use `assert_eq!` or `insta::assert_snapshot!` for error messages.

## Comments

Expand Down
61 changes: 36 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions packages/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ pathdiff = "0.2.3"
serde = { version = "1.0.228", features = ["derive"] }
serde_json = { version = "1.0.149", features = ["raw_value"] }
serde_yaml = "0.9.19"
json5 = "0.4"
regex = "1.12"
reqwest = { version = "0.11", features = ["json"] }
strum = { version = "0.26", features = ["derive"] }
strum_macros = "0.26"
strum = { version = "0.27", features = ["derive"] }
strum_macros = "0.27"
tokio = { version = "1.49", features = [
"macros",
"process",
Expand All @@ -45,6 +46,7 @@ colored = "2.0.4"
thiserror = "1.0.50"
fuel-abi-types = "0.7.0"
hypersync-client = "1.2.0"
arrow = { version = "57", default-features = false, features = ["prettyprint"] }
faster-hex = "0.9"
ruint = "1"
env_logger = "0.11"
Expand All @@ -59,7 +61,12 @@ napi = { version = "=3.8.5", features = ["napi10", "async", "serde-json"] }
napi-derive = "=3.5.4"

[features]
integration_tests = []
hypersync_health = []
# Compatibility alias for the previous feature name. Older CI workflows
# (still on main until this PR merges) reference `integration_tests`;
# enabling it must keep the hypersync health check working. Drop after
# main picks up the renamed workflow step.
integration_tests = ["hypersync_health"]

[build-dependencies]
napi-build = "=2.3.1"
Expand Down
25 changes: 25 additions & 0 deletions packages/cli/CommandLineHelp.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ This document contains the help content for the `envio` command-line program.
* [`envio local db-migrate setup`↴](#envio-local-db-migrate-setup)
* [`envio start`↴](#envio-start)
* [`envio metrics`↴](#envio-metrics)
* [`envio data`↴](#envio-data)
* [`envio skills`↴](#envio-skills)
* [`envio skills update`↴](#envio-skills-update)
* [`envio tools`↴](#envio-tools)
Expand All @@ -50,6 +51,7 @@ This document contains the help content for the `envio` command-line program.
* `local` — Prepare local environment for envio testing
* `start` — Start the indexer. Runs codegen automatically before launching so the on-disk types stay in sync with `config.yaml` and `schema.graphql`
* `metrics` — Fetch raw Prometheus metrics from the running indexer's /metrics endpoint
* `data` — Query raw blockchain data — blocks, logs, transactions on EVM chains using the same `where` syntax as indexer filters
* `skills` — Manage Envio-provided Claude Code skills under `.claude/skills/`
* `tools` — Tools for people and AI agents (search-docs, fetch-docs). Run `envio tools help` for details
* `config` — Inspect the indexer config
Expand Down Expand Up @@ -381,6 +383,29 @@ Fetch raw Prometheus metrics from the running indexer's /metrics endpoint



## `envio data`

Query raw blockchain data — blocks, logs, transactions on EVM chains using the same `where` syntax as indexer filters.

Output is TOON (token-oriented) tabular form.

Example — earliest USDC transfers on Base: `envio data block.number log.srcAddress --chain=base --where='{ block: { number: { _gte: 0 } }, log: { srcAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" } }'`

Example — current archive height: `envio data knownHeight --chain=arbitrum-one`

**Usage:** `envio data [OPTIONS] --chain <CHAIN> [FIELD]...`

###### **Arguments:**

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 | 🟡 Minor | ⚡ Quick win

Use consistent heading increments in new sections.

These ###### headings skip levels and trigger markdownlint MD001. Please change them to the next expected level (e.g., ###) to keep heading structure valid.

Also applies to: 443-443, 456-456, 468-468

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 404-404: Heading levels should only increment by one level at a time
Expected: h3; Actual: h6

(MD001, heading-increment)

🤖 Prompt for 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.

In `@packages/cli/CommandLineHelp.md` at line 404, Replace the inconsistent
level-6 headings (e.g., the literal string "###### **Arguments:**" and the other
similar occurrences noted) with the next expected heading level (for example
"### **Arguments:**") so the document uses a consistent, valid heading hierarchy
and fixes markdownlint MD001; update each matching heading instance (the ones
around the sections flagged) to the correct level.


* `<FIELD>` — Fields to fetch (e.g. `block.number`, `log.srcAddress`, `transaction.transactionIndex`). Use `knownHeight` to get the chain's current archive height

###### **Options:**

* `--chain <CHAIN>` — Chain id (e.g. `8453`) or kebab-case name (e.g. `base`, `arbitrum-one`). Solana is not supported yet
* `--where <WHERE_FILTER>` — Filter rows (JSON5: unquoted keys, single quotes, trailing commas, `//` comments). Group fields under `block`, `transaction`, `log`. Match any field with a value, array, or `_eq`/`_in`; numeric fields also take `_gt`/`_gte`/`_lt`/`_lte`. Example: --where='{ block: { number: { _gte: 1000, _lte: 2000 } }, log: { srcAddress: "0xa0b8..." } }'



## `envio skills`

Manage Envio-provided Claude Code skills under `.claude/skills/`
Expand Down
15 changes: 9 additions & 6 deletions packages/cli/examples/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ async fn main() -> Result<()> {
)
.context("Failed parsing command line arguments")?;

// Guard against accidental misuse — only `script` subcommands go through
// this path. Everything else (init/codegen/dev/start/...) runs via the
// NAPI host and would be missing the JS dispatch side if invoked here.
if !matches!(command_line_args.command, CommandType::Script(_)) {
// Guard against accidental misuse — only commands that finish entirely
// in Rust (no JS dispatch needed) go through this path. Everything else
// (init/codegen/dev/start/...) runs via the NAPI host.
if !matches!(
command_line_args.command,
CommandType::Script(_) | CommandType::Data(_)
) {
anyhow::bail!(
"This example only supports `script` subcommands. Run envio via the NAPI host \
(packages/envio/bin.mjs) for init/codegen/dev/start/etc."
"This example only supports `script` and `data` subcommands. Run envio via the NAPI \
host (packages/envio/bin.mjs) for init/codegen/dev/start/etc."
);
}

Expand Down
34 changes: 34 additions & 0 deletions packages/cli/src/cli_args/clap_definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@ pub enum CommandType {
///Fetch raw Prometheus metrics from the running indexer's /metrics endpoint
Metrics,

///Query raw blockchain data — blocks, logs, transactions on EVM chains
///using the same `where` syntax as indexer filters.
///
///Output is TOON (token-oriented) tabular form.
///
///Example — earliest USDC transfers on Base:
///`envio data block.number log.srcAddress --chain=base --where='{ block: { number: { _gte: 0 } }, log: { srcAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" } }'`
///
///Example — current archive height:
///`envio data knownHeight --chain=arbitrum-one`
Data(DataArgs),

///Manage Envio-provided Claude Code skills under `.claude/skills/`
#[command(subcommand)]
Skills(SkillsSubcommand),
Expand Down Expand Up @@ -130,6 +142,28 @@ pub enum JsonSchema {
Svm,
}

#[derive(Debug, Args)]
pub struct DataArgs {
///Fields to fetch (e.g. `block.number`, `log.srcAddress`,
///`transaction.transactionIndex`). Use `knownHeight` to get the
///chain's current archive height.
#[arg(value_name = "FIELD")]
pub fields: Vec<String>,

///Chain id (e.g. `8453`) or kebab-case name (e.g. `base`,
///`arbitrum-one`). Solana is not supported yet.
#[arg(long)]
pub chain: String,

///Filter rows (JSON5: unquoted keys, single quotes, trailing commas,
///`//` comments). Group fields under `block`, `transaction`, `log`.
///Match any field with a value, array, or `_eq`/`_in`; numeric fields
///also take `_gt`/`_gte`/`_lt`/`_lte`. Example:
///--where='{ block: { number: { _gte: 1000, _lte: 2000 } }, log: { srcAddress: "0xa0b8..." } }'
#[arg(long = "where")]
pub where_filter: Option<String>,
}

#[derive(Debug, Args)]
pub struct DevArgs {
///Force restart: clear the database and re-index from scratch. Required when config/schema/ABI changes are incompatible with the existing indexer state.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Commands:
local Prepare local environment for envio testing
start Start the indexer. Runs codegen automatically before launching so the on-disk types stay in sync with `config.yaml` and `schema.graphql`
metrics Fetch raw Prometheus metrics from the running indexer's /metrics endpoint
data Query raw blockchain data — blocks, logs, transactions on EVM chains using the same `where` syntax as indexer filters
skills Manage Envio-provided Claude Code skills under `.claude/skills/`
tools Tools for people and AI agents (search-docs, fetch-docs). Run `envio tools help` for details
config Inspect the indexer config
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/src/config_parsing/hypersync_endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ mod test {
}
}

/// Integration tests that require network access.
/// Run with: cargo test --features integration_tests
/// Hypersync endpoint health checks that require network access.
/// Run with: cargo test --features hypersync_health
#[cfg(test)]
#[cfg(feature = "integration_tests")]
mod integration_tests {
#[cfg(feature = "hypersync_health")]
mod hypersync_health {
use super::{network_to_hypersync_url, HypersyncChain};
use crate::scripts::print_missing_networks::Diff;
use strum::IntoEnumIterator;
Expand Down
Loading
Loading