ic-query
ic-query provides the icq executable for read-only Internet Computer
metadata queries.
icq currently supports NNS and SNS metadata queries: registry version,
subnet catalog lookup, node/provider/operator/data-center inventory, topology
reports, and deployed SNS reports.
Install
From this checkout:
From crates.io after publication:
Commands
Use icq nns <family> help, icq nns topology <report> help, or
icq sns <command> help for command options.
Most commands support text output by default and JSON output with
--format json:
Cache
The NNS subnet, node, provider, operator, data-center, and topology commands
use project-local cache files under .icq/. Refresh commands fetch current
mainnet registry data and replace the matching cache atomically:
List/info commands populate their component cache on first use and print the API endpoint they are calling before creating it. Refresh commands force a fresh fetch and replace the matching cache.
SNS neuron commands keep quick --sort api output on a bounded live query.
Whole-collection neuron sorts use complete snapshots:
Complete SNS neuron snapshots live under
.icq/sns/ic/<root-principal>/neurons/full.json. Failed or capped refresh
attempts are recorded separately and do not replace the last complete snapshot.
Refresh shows a same-line stderr progress counter with pages and rows fetched
when running in a terminal.
Inspect local SNS neuron snapshots and their latest refresh-attempt metadata without making live calls:
Live API neuron listings are capped at 100 rows per call. Cache-backed sorts
can use larger --limit values because they read from the complete local
snapshot.
Neuron IDs are shortened to eight characters in text tables by default. Use
icq sns neurons 1 --verbose to show full neuron IDs.
Text output shows current SNS token amounts, including token fee, total supply,
stake, maturity, and staked maturity, as token decimals with two places. JSON
keeps the raw base-unit and e8s fields.
SNS governance nervous system parameters can be queried by list id or root principal:
Development
This repository pins the local toolchain to Rust 1.96.0 while declaring
Rust 1.91.0 as the crate MSRV.
The combined local gate is:
Release version bumps are available after the release contents are committed and the worktree is clean:
Each target runs make test, bumps Cargo.toml and Cargo.lock, validates the
package, commits the release version, and creates an annotated vX.Y.Z tag.
Use the Canic-style release targets to push the release commit and tag after
the same gate succeeds:
Integration
icq is a standalone metadata lookup tool. Orchestration, deployment, and
application repositories can call the CLI when they need IC metadata instead of
linking registry adapters directly. For one integration example, see
Canic.
Status
The command namespace is intentionally small:
nnsis implemented.sns list,sns info,sns token,sns params, andsns neuronsare implemented for deployed mainnet SNS instances.sns neurons refreshcaches complete neuron snapshots for cache-backed sorting.sns neurons cache list|statusinspects local complete neuron snapshots and refresh-attempt metadata without live calls.- Additional IC query families can be added without coupling query code to deployment tooling.