query_archive_sql
Execute read-only SQL queries against Mina's archive database to fetch blockchain data such as blocks, commands, and accounts. Only SELECT, WITH, and EXPLAIN statements are permitted.
Instructions
[infra][tutorial+snapshot] Execute a read-only SQL query against the archive database. Only SELECT/WITH/EXPLAIN statements are allowed. Query timeout is 10 seconds. Not available in live mode (no archive DB). Common tables: blocks, user_commands, internal_commands, public_keys, accounts_accessed. Call get_archive_schema first if you don't know the table layout.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | Read-only SQL (SELECT / WITH / EXPLAIN only). Example: SELECT state_hash, height FROM blocks WHERE chain_status = 'canonical' ORDER BY height DESC LIMIT 10 | |
| params | No | Parameterized values: $1, $2, ... in the SQL |