- CNTool's gLiveView - Dashboard inspiration and design
- @RcadaPool SPO - Key-checker script logic
- LiveView version: 0.2.1
- Tested on: Midnight Validator Node - Testnet - Version: 0.12.0-cab67f3b
A comprehensive monitoring solution for Midnight blockchain nodes, featuring real-time dashboard monitoring and persistent block tracking.
- LiveView.sh - Real-time monitoring dashboard (inspired by CNTool's gLiveView)
- simple_block_monitor.sh - Persistent block tracking that survives Docker restarts
- Integration - Historic block counting that shows total blocks since monitoring started
Midnight Node Monitor - Version: 0.12.0-29935d2f
jq- Command-line JSON processorcurl- For API callsdocker- If using Docker deployment- Standard utilities:
awk,date,grep, etc.
partner-chains-public-keys.json- Must be in the same directory as LiveView.sh- Midnight node running (Docker container named "midnight" by default)
To enable full monitoring features, update your .envrc file:
Modify the APPEND_ARGS line:
If you have 2 server setup ( Side chain on one and Midnight node on one )
# From:
export APPEND_ARGS="--allow-private-ip --pool-limit 10 --trie-cache-size 0 --prometheus-external --rpc-external"
# To:
export APPEND_ARGS="--validator --allow-private-ip --pool-limit 10 --trie-cache-size 0 --prometheus-external --unsafe-rpc-external --rpc-methods=Unsafe --rpc-cors all"If you have 1 server setup ( Side chain and Midnight node on same server )
# From:
export APPEND_ARGS="--allow-private-ip --pool-limit 10 --trie-cache-size 0 --prometheus-external --rpc-external"
# To:
export APPEND_ARGS="--validator --allow-private-ip --pool-limit 10 --trie-cache-size 0 --prometheus-external --unsafe-rpc-external --rpc-methods=Unsafe --rpc-cors all --rpc-port 9944 --keystore-path=/data/chains/partner_chains_template/keystore/"NOTE = Change the key store path if necessary
# Download all files to your preferred directory
wget -O ./LiveView.sh https://raw.githubusercontent.com/Midnight-Scripts/Midnight-Live-View/refs/heads/main/LiveView.sh
wget -O ./simple_block_monitor.sh https://raw.githubusercontent.com/Midnight-Scripts/Midnight-Live-View/refs/heads/main/simple_block_monitor.sh
chmod +x LiveView.sh simple_block_monitor.sh# Just run the dashboard
./LiveView.sh# Step 1: Start the block monitor (creates all_blocks.json)
./simple_block_monitor.sh start
# Step 2: Run the dashboard (will show historic blocks)
./LiveView.sh- Node Information: Version, uptime, container start time
- Security: Node key (masked), port, key status
- Registration: Registration status
- Block Data:
- Historic blocks (total since monitoring started)
- Blocks produced (since Docker restart)
- Latest/finalized blocks, sync status
- Network: Peer count and details
- System: CPU, memory, disk usage
./LiveView.sh- [q] - Quit
- [p] - View peer details
Update these variables if needed:
Make sure to check and update the user variables below according to your setup:
# ─── USER VARIABLES ────────────────────────────────
CONTAINER_NAME="${CONTAINER_NAME:-midnight}"
PORT="${PORT:-9944}"
USE_DOCKER="${USE_DOCKER:-true}"Monitors Docker logs for new blocks and maintains a persistent all_blocks.json file. This data survives Docker restarts and provides long term block tracking.
./simple_block_monitor.sh start- Runs in background
- Creates
block_monitor.logand.block_monitor.pid - Continuously appends new blocks to
all_blocks.json
./simple_block_monitor.sh stop./simple_block_monitor.sh status- Shows if monitor is running
- Displays current block count
./simple_block_monitor.sh run- Shows real-time output
- Press Ctrl+C to stop
all_blocks.json- Persistent block databaseblock_monitor.log- Monitor activity log.block_monitor.pid- Process tracking file
# Just run the dashboard
./LiveView.sh- Shows current session blocks only
- Blocks reset on Docker restart
# Start persistent block tracking
./simple_block_monitor.sh start
# Run dashboard with historic data
./LiveView.sh- Dashboard shows both historic and current blocks
- Historic count survives Docker restarts
- Continuous background monitoring
# Check monitor status
./simple_block_monitor.sh status
# Run dashboard
./LiveView.shWhen both tools are used together:
- Historic Blocks Line: LiveView shows total blocks since monitoring started
- Persistent Data: Block count survives Docker container restarts
- Duplicate Prevention: Only truly new blocks are added to the database
- Automatic Integration: LiveView automatically detects and uses
all_blocks.json
full pack/
├── LiveView.sh # Real-time dashboard
├── simple_block_monitor.sh # Block tracking script
├── partner-chains-public-keys.json # Required keys file
├── all_blocks.json # Block database (created automatically)
├── block_monitor.log # Monitor logs (created automatically)
├── .block_monitor.pid # Process tracking (created automatically)
└── README.md # This file
Dashboard not showing data:
# Test RPC connection
curl -s http://127.0.0.1:9615/metrics- Should return metrics data
- Update CONTAINER_NAME and PORT variables if needed
"Blocks file not found":
- Run
./simple_block_monitor.sh startto createall_blocks.json
"Monitor already running":
./simple_block_monitor.sh stop
./simple_block_monitor.sh startNo new blocks appearing:
- Check if node is producing blocks
- Verify container name:
docker ps - Check logs:
tail -f block_monitor.log
Permission denied:
chmod +x LiveView.sh simple_block_monitor.shMissing dependencies:
# Ubuntu/Debian
sudo apt update && sudo apt install jq curl
# macOS
brew install jq curlCONTAINER_NAME- Docker container name (default: "midnight")PORT- RPC port (default: 9944)USE_DOCKER- Use Docker commands (default: true)
- Docker logs are not persistent by default use Simple Block Monitor for long term tracking
- The dashboard refreshes every second
- Block monitor prevents duplicate entries automatically
- Both tools can run independently or together
Please stake some ADA to Enigma ticker one. This helps us to continue building and maintaining the midnight tools.