Quick Reference
| Method | Description | Parameters |
|---|---|---|
block | Get block details by height, hash, or finality | finality OR block_id |
block_effects | Get changes in a specific block | finality OR block_id |
chunk | Get chunk details by chunk_id or block_id + shard_id | chunk_id OR [block_id, shard_id] |
Block details
Queries network and returns block for given height or hash. You can also usefinality param to return latest block details.
You may choose to search by a specific block or finality, you can not choose both.
blockBlock finality (
optimistic, near-final, or final). See finality param.Block height or hash. See block_id param.
Query by finality
Query by block height
Query by block hash
Block Effects
Returns changes in block for given block height or hash over all transactions for all the types. Includes changes likeaccount_touched, access_key_touched, data_touched, contract_code_touched. You can also use finality param to return latest block details.
You may choose to search by a specific block or finality, you can not choose both.
block_effectsBlock finality. See finality param.
Block height or hash. See block_id param.
Chunk Details
Returns details of a specific chunk. You can run a block details query to get a valid chunk hash.chunkChunk hash
Block height or hash. See block_id param.
Shard ID (required when using
block_id)Query by chunk_id
Query by block_id and shard_id
Error Handling
Common Error Types
| Error Code | Description | Solution |
|---|---|---|
UNKNOWN_BLOCK | Block not found or garbage-collected | Check block validity; use archival node for old blocks |
UNKNOWN_CHUNK | Chunk not found in database | Verify chunk ID; use archival node for old chunks |
INVALID_SHARD_ID | Shard ID does not exist | Provide valid shard ID for existing shard |
NOT_SYNCED_YET | Node still syncing | Wait for sync completion or use different node |
PARSE_ERROR | Invalid request parameters | Check parameter format and completeness |
INTERNAL_ERROR | Server-side issue | Retry request or try different RPC endpoint |
Response Validation
- Block responses: Always include
block_hash,block_height, andheaderfields - Chunk responses: Contain
author,header,receipts, andtransactionsarrays - Changes responses: Include
block_hashandblock_effectsarray with change details
Best Practices
- Cache block data: Block information is immutable once finalized, ideal for caching
- Use archival nodes for old data: Blocks older than 5 epochs require archival nodes
- Validate shard IDs: Ensure shard IDs are within the network’s shard range