Runs, queries, and extends leani, a self-hosted Ethereum indexing node and CLI. Follows Mainnet blocks over P2P with no API key, backfills historical ranges, and turns blocks, transactions, and logs into application data through processors served over a local HTTP API, TypeScript SDK, and JSON-RPC subset.
Ships in leani. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Leani is an Ethereum Mainnet indexing node you run yourself. It verifies
consensus with a light client, reads execution data from P2P peers or public
datasets, runs processors that turn blocks into application data, and keeps
only their results. One binary provides the CLI, the node (leani serve), a
native HTTP API with streaming, and a JSON-RPC subset.
The binary carries this guide for its own release: leani guide prints it and
leani guide processors prints the processor reference. A skill copy can be
newer or older than the binary; leani guide and --help always describe the
installed one. Binaries before 0.1.0-rc.7 have no guide command.
A question about Ethereum data becomes a processor: it reads each block and keeps only the result the question needs. Work in this order:
Use a built-in processor if one fits. They cover block summaries,
decoded contract events (evm-events), ERC-20 balances, transactions
between one address pair, Uniswap pools, blobs, and rollup transactions.
references/processors.md
(leani guide processors) lists them and their configuration.
Otherwise write a custom processor. That is the normal path, not a
workaround. A processor is a map from block material to a compact delta
and a reduce that folds deltas into state; Leani supplies the sources,
backfill, finality, reorgs, storage, and HTTP API. Write one when the
answer needs:
reduce rather than exporting every event and counting
client-side;evm-events sees only
logs;evm-events stores
such log0 data only raw);leani processor create --spec generates a Wasm processor from a spec of the
data to keep, in Rust or, with --language typescript, TypeScript, which the
stock binary runs; a native Rust processor starts from the maintained
example. Section 4 of the processor reference describes both.
Backfill the range, serve, and query. Check coverage before you report a number.
Leani keeps no EVM state, so it refuses eth_call, eth_getBalance,
eth_getCode, eth_getStorageAt, eth_estimateGas, and traces. Use an
execution provider for those. Derived balances and prices are processor
outputs with a documented scope, not a replacement for arbitrary state.
leani <command> --help is the source of truth for flags; check it rather
than guessing, because flags change between releases. If
leani subscribe --help lacks --timeout, the binary predates this skill.
subscribe --json prints NDJSON, doctor --json prints a
report, and backfill and db always print JSON. Progress and logs go to
stderr, so stdout stays parseable.subscribe follows until interrupted and a cold
start can take minutes while peers are discovered. For one answer use
--once --timeout 5m. Run serve or an open-ended subscribe in the
background and poll /health/ready on the node's [api] bind (port 18080
for a node made by leani init).init, and a subscribe that
runs its own embedded runtime (no node to attach to) without a cached
anchor, fetch a finalized checkpoint that at least two public providers
agree on; it anchors all later verification. Without a terminal they print
the checkpoint summary to stderr and stop with checkpoint trust requires an interactive terminal or --yes. Show the user that summary and rerun with
--yes only after they approve it.unattested (peers agree and it
passes Leani's header rules; it can be undone), attested (signed by the
sync committee; a reorg can still remove it), confirmed (attested, and
the node's [confirmation] endpoints report Ethereum's Fast Confirmation
Rule confirmed it), or finalized; a rollup's blocks reach settled
too, days later, once its settlement contracts on Ethereum accept them,
which withdrawals wait for. Do not present unattested, attested or
confirmed data as final; pass --finality finalized when correctness
matters more than latency. --once returns
the first row that meets --finality (default unattested).schema. A stream mixes
leani.block-summary.v1 or leani.market-price.v2 rows with
leani.subscription-undo.v1 and leani.subscription-gap.v1. A row with
"operation": "undo" reverts one printed earlier.doctor
found the configuration unreadable or invalid; 124 --once hit --timeout
before a match; 130 interrupted before --once matched.leani reset all, leani reset subscription,
and leani db prune-changes remove data. db commands take the node's lock,
so stop serve first. Never point two nodes at one data directory.Run leani --version. If it is missing, ask how the user wants to install it:
brew install smart-byte/tap/leani, a release archive from
https://github.com/smart-byte/leani/releases, the container image
ghcr.io/smart-byte/leani:v<version>, or a source build
(cargo build --locked -p leani in a checkout, then add target/debug to
PATH and export LEANI_SOURCE as the checkout path). Keep the binary, the
SDK, and configuration on the same version.
Latest block or price, one row (a block row has blockNumber, blockHash,
timestamp, and finality):
leani subscribe blocks --json --once --timeout 5m
leani subscribe uniswap-v3 ETH/USDC --json --once --timeout 5m # also ETH/USDT, WBTC/ETH
Reusable node with an HTTP API, SDK subscriptions, and JSON-RPC:
mkdir leani-blocks && cd leani-blocks
leani init blocks # or: leani init uniswap-v3 ETH/USDC
leani serve # background it; API 127.0.0.1:18080, JSON-RPC 127.0.0.1:18545
curl -s http://127.0.0.1:18080/v1/capabilities
leani subscribe blocks --json # from this directory, attaches to the running node
Index contract events or another historical range: read
references/processors.md (leani guide processors)
first. It covers choosing a built-in processor, the event-decoding
configuration and its limits, backfills, coverage checks, and custom Rust
processors.
Configure a node for stated needs, such as "keep 30 days of these events on a
1 GiB host": let leani init build the configuration from requirements, with
flags or JSON for any processor, rather than editing settings by hand.
references/configuration.md
(leani guide config) describes the requirements and the report --json
prints:
leani init uniswap-v3 ETH/USDC --keep window --window-days 30 --memory 1GiB --yes --json
GET /v1/capabilities lists the configured processors; check it instead of
assuming a route works. GET /v1/processors/{processor}/status reports
coverage.GET /v1/processors/{processor}/collections/{collection}/entities?limit=100
pages results; follow nextCursor. Add fromBlock/toBlock for a range.
range_incomplete means the range is not indexed (not "no events");
output_not_retained means it was indexed and later pruned.GET /v1/processors/{processor}/stream is the server-sent-event change
stream; the TypeScript SDK wraps it:
createLeaniClient({ baseUrl }).blocks.subscribe() from
@smart-byte/leani-sdk. Install the SDK version that matches the node exactly;
prereleases are not latest on npm.streamLive() from @smart-byte/leani-sdk/backfill reads, delivers them
in undo-only batches, newest first. Rebuild derived aggregates once per
run, as "Undo runs" in
$LEANI_SOURCE/docs/concepts/coverage-finality-and-reorgs.mdx (or
https://leani.dev/_llms-txt/concepts.txt) describes.instance, settle the old instance's
backfill subscriptions before and after the switch, as "Processor rebuild
or rollback" in $LEANI_SOURCE/docs/operations/runbook.md (or
https://leani.dev/_llms-txt/operations.txt) describes.With a source checkout, read the Markdown under $LEANI_SOURCE/docs/; it is
what the site renders. Otherwise start at https://leani.dev/llms.txt, which
links one file per section: https://leani.dev/_llms-txt/getting-started.txt,
guides.txt, reference.txt, concepts.txt, and operations.txt. Fetch the
section you need rather than guessing page URLs.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
/leani:leanifrom leani
npx claudepluginhub smart-byte/leani --plugin leani