Midnight Explorer is an open-source blockchain explorer for the Midnight Network — a privacy-preserving blockchain platform. It provides a real-time interface to search, trace, and analyze on-chain activity including transactions, blocks, smart contracts, and liquidity pools.
This project extends the Midnight Network with additional developer tooling.
- 🔍 Universal Search — Look up blocks, transactions, addresses, and contracts by hash or ID
- 📦 Block Explorer — Browse the latest blocks with full block details and transaction lists
- 💸 Transaction Viewer — Inspect transaction data, inputs, outputs, and contract interactions
- 👤 Address Explorer — View address history, balances, and associated contracts
- 📜 Smart Contracts — Browse deployed contracts and their on-chain state
- 🌊 Pool Analytics — Track liquidity pool metrics and activity
- 📊 Network Charts — Visualize on-chain statistics and trends over time
- 📡 Live Network Stats — Real-time metrics including current epoch, slot, total blocks, transactions, and average block time
- � Network Switcher — Switch between Midnight environments (Preprod, Mainnet) from the header
| Layer | Technology |
|---|---|
| Framework | Next.js 15 (App Router) |
| Language | TypeScript |
| Styling | Tailwind CSS v4 |
| UI Components | Radix UI |
| Data Fetching | TanStack Query (React Query) |
| Charts | Recharts |
| Database | PostgreSQL (pg) |
| Runtime | Midnight Network SDK (@midnight-ntwrk/*) |
- Node.js 20+
- npm
# Install dependencies
npm install
# Start dev server (runs on port 8080)
npm run devOpen http://localhost:8080 in your browser.
docker compose up -dPoint your domain to the server IP:
A @ YOUR_SERVER_IP
A www YOUR_SERVER_IP
# Stop Nginx
docker stop midnight-explorer-web-nginx
# Obtain certificate via Let's Encrypt
docker run --rm -p 80:80 \
-v $(pwd)/nginx/certs:/etc/letsencrypt \
certbot/certbot certonly --standalone \
-d yourdomain.com \
--email your@email.com \
--agree-tos --no-eff-email --non-interactive
# Restart Nginx with HTTPS config
docker compose -f docker-compose.nginx.yml up -d nginxchmod +x renew-certs.sh
(crontab -l 2>/dev/null; echo "0 3 * * * /root/midnight-explorer-web/renew-certs.sh") | crontab -Certificates auto-renew daily at 3 AM.
Zero-downtime deployments using a blue-green strategy.
# 1. Start the new (test) container
docker compose up -d midnight-explorer-web-test
# 2. Switch Nginx traffic to new container
sed -i 's/midnight-explorer-web-dev/midnight-explorer-web-test/g' nginx/conf.d/default.conf
# 3. Reload Nginx (zero downtime)
docker exec midnight-explorer-web-nginx nginx -s reloadsed -i 's/midnight-explorer-web-test/midnight-explorer-web-dev/g' nginx/conf.d/default.conf
docker exec midnight-explorer-web-nginx nginx -s reloadEnsure all containers share the same Docker network:
docker network create midnight-net
docker network connect midnight-net midnight-explorer-web-nginx
docker network connect midnight-net midnight-explorer-web-dev
docker network connect midnight-net midnight-explorer-web-testCopyright (c) 2026 TexLabs - texlabs.org
Licensed under the Apache License, Version 2.0.