
LocalScan — A Lightweight EVM Blockchain Indexer That Runs on Your Machine
I built LocalScan, a lightweight EVM blockchain indexer and explorer that runs entirely on your machine.
The idea is simple: connect it to any EVM-compatible node (Anvil, Hardhat, Geth, Infura, Alchemy, or any other), and it starts indexing blocks and transactions in real time into a local SQLite database. No external database setup, no infrastructure overhead.
Why I Built It
Working extensively with local EVM testing tools like Anvil, I found transaction tracking tedious and error-prone. LocalScan was the solution I kept reaching for.
What It Does
- Real-time indexing via WebSocket (
eth_subscribe) or HTTP polling, depending on what your node supports - ERC-20 transfer tracking — logs are captured and token balances are cached per address
- Contract metadata resolution — creator transaction, creation block, and bytecode hash
- Built-in block explorer UI — served out of the box, no extra frontend setup
- REST API — query blocks, transactions, and address data with structured endpoints
- Robustness — automatic reconnects and chain reorg detection built in
Tech Stack
The entire stack is Python-based:
- FastAPI — API layer
- SQLAlchemy + SQLite — storage
- web3.py — chain interaction
- Jinja2 — UI template rendering
- Pydantic — schema validation
One thing worth mentioning: LocalScan uses chain-sniper under the hood — a separate Python package I also built that handles the low-level EVM interaction layer, including WebSocket subscription management and HTTP polling logic. It is available independently on PyPI if you need that functionality without the full explorer.
Installation
pip install localscan
Then point it at any node:
localscan --rpc-url ws://localhost:8545
GitHub
Check it out on GitHub: rakibhossain72/localscan
PyPI
Check it out on PyPI: localscan
