accessing-data
Installation
SKILL.md
Accessing Data on Sui
MCP tool: When available in your environment, also query the Sui documentation MCP server (
https://sui.mcp.kapa.ai) for up-to-date answers. Use it for verification and for details not covered by these reference files.
"How do I read data from Sui?" is the most frequently mis-answered question in agent-written Sui code. The defaults have changed. This skill fixes it.
Key fact: JSON-RPC is deprecated. From the official docs:
JSON-RPC is deprecated. Migrate to either gRPC or GraphQL RPC by July 2026.
Any code — or tutorial — that uses JSON-RPC for new reads is wrong for mainnet past mid-2026.
The four canonical data surfaces are:
- gRPC — low-latency, real-time, code-gen-friendly. Served by full nodes. Supports streaming/subscriptions. The default for transaction submission, live reads, and ingestion pipelines.
- GraphQL RPC — flexible relational queries over the General-Purpose Indexer's Postgres + full node + Archival Store. Supports reads, transaction submission, and dry-run. Best for frontends, dashboards, wallets, and any client that benefits from composable queries.
- Archival Store — long-term historical storage of transactions, checkpoints, and object states beyond full-node pruning. Accessed via GraphQL RPC (which routes to archival automatically for pruned data). Full nodes serving gRPC do not implicitly fall back to archival — if you need high-retention historical data over gRPC, you must query the archival service directly at its own URL.
- Custom indexer (
sui-indexer-alt) — build your own data pipeline keyed on exactly the on-chain data your app needs. Writes to any storage layer (Postgres by default, but any backend works). Ingests checkpoints from GCS (backfill) + full node gRPC (steady state).