chain_getBlock - FLOP RPC Method
Retrieve block data by hash on FLOP. Essential for accessing block headers and extrinsics on the Substrate Proof of Inference Layer 1 built for autonomous AI agents.
FLOP RPC endpoint: endpoint URLs, plans and pricing.
Retrieves complete block information from FLOP, including the block header, extrinsics, and justifications.
Why FLOP? Build on the Substrate Proof of Inference Layer 1 built for autonomous AI agents with Proof of Inference with TOPLOC activation commitments, full historical archive state from genesis, and JSON-RPC v2 archive and chainHead APIs.
Use Cases
The chain_getBlock method is essential for:
- Block explorers - Display complete block information
- Chain analysis - Analyze block production patterns
- Transaction verification - Confirm extrinsic inclusion for Proof of Inference settlement, 1-second BABE blocks with AlephBFT finality, archive state queries, and HTLC atomic swaps
- Data indexing - Build historical blockchain databases
Best Practices
- Cache block data by hash -- blocks are immutable once finalized on Substrate chains
- Use
chain_getBlockHashfirst to resolve block number to hash before calling this method - Handle
nullresults gracefully for non-existent blocks - Combine with
chain_getFinalizedHeadfor consensus-safe block retrieval
{
"jsonrpc": "2.0",
"method": "chain_getBlock",
"params": ["0x33cb4ba72b743fe7d82e581aeac97dd7108b5dfbf87c84a624e943379a33a96e"],
"id": 1
}Code Examples
# Get latest block
curl https://api-flop-testnet.n.dwellir.com/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "chain_getBlock",
"params": [],
"id": 1
}'
# Get specific block
curl https://api-flop-testnet.n.dwellir.com/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "chain_getBlock",
"params": ["0x33cb4ba72b743fe7d82e581aeac97dd7108b5dfbf87c84a624e943379a33a96e"],
"id": 1
}'Related Methods
chain_getBlockHash- Get block hash by numberchain_getHeader- Get block header onlychain_getFinalizedHead- Get finalized block hash
FLOP RPC Documentation
Complete JSON-RPC API documentation for FLOP Testnet. Connect over HTTPS and WebSocket with full archive state from genesis, Substrate JSON-RPC, JSON-RPC v2 archive and chainHead APIs, and HTLC queries.
chain_getBlockHash
Get block hash by number on FLOP. Essential for converting block numbers to hashes, historical queries, and blockchain navigation on the Substrate Proof of Inference Layer 1 built for autonomous AI agents.