A comprehensive blockchain explorer for the OpenGovChain Cosmos blockchain that provides real-time monitoring of transactions, blocks, and network statistics.
- Real-time Statistics: View latest block height, total transactions, active validators, and chain ID
- Recent Transactions: Quick view of the 5 most recent transactions with status indicators
- Recent Blocks: Display of the latest 5 blocks with transaction counts and timestamps
- Auto-refresh: Data automatically updates every 10 seconds
- Transaction List: Paginated view of all blockchain transactions
- Transaction Details: Click any transaction to view complete details including:
- Transaction hash and status (success/failed)
- Block height and timestamp
- Gas used and gas wanted
- All messages and operations
- Fee information
- Execution events
- Raw logs
- Status Indicators: Visual indicators for successful (green) and failed (red) transactions
- Message Types: Display of transaction message types (e.g., CreateEntry, Send, etc.)
- Block List: Paginated view of all blocks
- Block Details: View block information including:
- Block height and hash
- Number of transactions
- Block proposer address
- Timestamp
- Navigation: Easy pagination through blocks
- Search by Transaction Hash: Look up specific transactions
- Search by Block Height: Find blocks by their height number
- Smart Search: Automatically detects whether input is a hash or block number
GET /api/explorer/stats
Returns blockchain statistics including latest height, total transactions, validators, and chain ID.
GET /api/explorer/transactions?page=1&limit=20
GET /api/explorer/transactions?height=12345
Fetch paginated transactions or transactions for a specific block height.
GET /api/explorer/transaction/[hash]
Get complete details for a specific transaction by hash.
GET /api/explorer/blocks?page=1&limit=20
GET /api/explorer/blocks?height=12345
Fetch paginated blocks or a specific block by height.
Navigate to /explorer in the web application to access the blockchain explorer.
- Go to the Transactions tab
- Browse the paginated list of transactions
- Click on any transaction hash to view detailed information
- Use pagination controls to navigate through transaction history
- Go to the Blocks tab
- Browse the paginated list of blocks
- View block details including proposer and transaction count
- Use pagination controls to navigate through block history
- Use the search bar at the top of the explorer
- Enter a transaction hash (64 character hex string) or block height (number)
- Press Enter or click the Search button
- View the results in the appropriate tab
/web/src/app/explorer/page.tsx: Main explorer page with tabs for overview, transactions, and blocks/web/src/app/explorer/tx/[hash]/page.tsx: Detailed transaction view page
/web/src/app/api/explorer/stats/route.ts: Blockchain statistics endpoint/web/src/app/api/explorer/transactions/route.ts: Transaction list endpoint/web/src/app/api/explorer/transaction/[hash]/route.ts: Single transaction details endpoint/web/src/app/api/explorer/blocks/route.ts: Block list endpoint
The explorer connects to:
- Cosmos REST API (default:
http://localhost:1317) - For transaction and validator data - Tendermint RPC (default:
http://localhost:26657) - For block and status data
Configure the following in your .env or docker-compose:
BLOCKCHAIN_API=http://localhost:1317
BLOCKCHAIN_NODE=http://localhost:26657- shadcn/ui: Card, Table, Badge, Button, Input, Tabs, Separator
- Lucide Icons: Activity, Box, Hash, CheckCircle2, XCircle, etc.
- date-fns: For timestamp formatting
- Advanced filtering (by message type, status, date range)
- Validator details page
- Network statistics graphs
- Export transaction data
- WebSocket support for real-time updates
- Account/address explorer
- Pagination limits results to 20 items per page by default
- Auto-refresh interval set to 10 seconds to balance freshness with API load
- Transaction hashes and addresses are truncated for better UI display
- Lazy loading of detailed transaction data
The explorer is built with modern web technologies and supports:
- Chrome/Edge (latest)
- Firefox (latest)
- Safari (latest)
When adding new features to the explorer:
- Follow the existing component structure
- Use TypeScript for type safety
- Implement proper error handling
- Add loading states for async operations
- Ensure mobile responsiveness
- Update this documentation