GetBlock - Get Block Data
Retrieve a single block from Hyperliquid L1 Gateway via gRPC. Get blockchain data at a specific position.
Retrieve a single block at a specific position from the Hyperliquid L1 Gateway.
Full Code Examples
Clone our gRPC Code Examples Repository for complete, runnable implementations in Go, Python, and Node.js.
When to Use This Method
GetBlock is essential for:
- Point-in-Time Analysis - Get blockchain state at a specific block or timestamp
- Backtesting - Retrieve historical block data for strategy analysis
- Auditing - Verify transactions and state changes at specific points
- Debugging - Investigate specific blocks during development
Method signature
rpc GetBlock(GetRequest) returns (Record) {}V3 accepts an inclusive position.block_number or Unix-millisecond position.timestamp; explicit zero is invalid. A positioned call returns the selected block record. An empty GetRequest waits for the next block written after the call begins, so set a deadline. Blocks do not accept filters.
position: {
block_number: 1058646974
}The V3 Record contains optional sequential block_number and Unix-millisecond timestamp cursors plus raw replica_cmds bytes in data. The sequential cursor is distinct from abci_block.round. A pruned position returns NOT_FOUND; an above-head block returns OUT_OF_RANGE; malformed cursors and filters return INVALID_ARGUMENT.
Common Use Cases
For V3, select the block with GetRequest.position.block_number, then decode the returned Record.data. Use the decoded replica_cmds payload to analyze signed actions, compare blocks, or locate a transaction hash. See StreamBlocks for the complete decoded shape.
Best Practices
- Position Selection: Use the exact sequential block cursor for precise queries; timestamp lookups may return different blocks across requests near block boundaries
- Data Validation: Always validate JSON structure before processing
- Error Recovery: Implement retry logic with exponential backoff
- Resource Management: Close gRPC connections properly to avoid resource leaks
- Caching: Cache block data when analyzing the same blocks multiple times
Current Limitations
- Replay History: Available replay history varies by feed and endpoint. A cursor outside retained history returns
NOT_FOUND - Rate Limits: Be mindful of request frequency to avoid overwhelming the service
Resources
- GitHub: gRPC Code Examples - Complete working examples
- StreamBlocks Documentation - Full block specification and action types reference
Need help? Contact our support team or check the Hyperliquid gRPC documentation.
StreamTwapStatuses - Real-time TWAP Status Streaming
Stream TWAP order lifecycle events from Hyperliquid L1 Gateway via gRPC. Track TWAP status changes and execution progress per block in real time.
GetFills - Get Fill Data
Retrieve fills at a specific position from Hyperliquid L1 Gateway via gRPC. Get order execution data for analysis and reconciliation.