Reading Blockchain State
Overview
Push Chain is an EVM-compatible blockchain, so you can use familiar Ethereum tools to fetch on-chain data. This guide shows you how to:
- Initialize HTTP client for one-off requests
- Fetch transactions and blocks
- Initialize WebSocket client for real-time streaming
- Subscribe to new blocks and filter for specific transactions
For full reference on each library, see:
Initialize HTTP Client
- Ethers (v6)
- Viem
VIRTUAL NODE IDE
VIRTUAL NODE IDE
Fetch a Transaction by Hash
- Ethers (v6)
- Viem
VIRTUAL NODE IDE
VIRTUAL NODE IDE
Fetch Blocks
Latest Block
- Ethers (v6)
- Viem
VIRTUAL NODE IDE
VIRTUAL NODE IDE
Block by Hash
- Ethers (v6)
- Viem
VIRTUAL NODE IDE
VIRTUAL NODE IDE
Websocket Client
Initialize WebSocket Client
- Ethers (v6)
- Viem
VIRTUAL NODE IDE
VIRTUAL NODE IDE
Subscribing to New Blocks
- Ethers (v6)
- Viem
VIRTUAL NODE IDE
VIRTUAL NODE IDE
Filtering New Blocks for Specific Transactions
- Ethers (v6)
- Viem
VIRTUAL NODE IDE
VIRTUAL NODE IDE
Next Steps
- Dive into our Contract Helpers to detect and work with both cross-chain accounts and native Push Chain smart accounts.
- Use our UI Kit to abstract away wallet and chain logic and accelerate your front-end development.