Automated deployment and management system for NIGHT token mining on Linux VPS servers.
Midnight Miner is a complete mining solution that combines:
- Python orchestrator for multi-wallet management
- Rust native libraries for high-performance AshMaize PoW algorithm
- Automated deployment via Makefile commands
- Systemd integration for 24/7 mining
- Automated VPS initialization with user setup and SSH keys
- One-command deployment and updates
- Multi-wallet mining with BIP39 mnemonic support
- Real-time status monitoring and backup
- Systemd service for automatic restarts
- Clean separation of code and sensitive data
See QUICKSTART.md for step-by-step instructions.
TL;DR:
# 1. Configure VPS
cp config/v01.conf.example config/v01.conf
# Edit config/v01.conf with your VPS details
# 2. Install mining software
make init-v01
# 3. Start mining
make start-v01
# 4. Check status
make status-v01
# 5. Backup wallets (important!)
make backup-v01This miner implements an optimized challenge selection strategy:
- Multi-Wallet Approach: Creates 16 wallets for 8 workers (2:1 ratio)
- Workers select from available wallets with unsolved challenges
- Reduces wallet contention and improves challenge selection
- Distributes solutions across multiple addresses
- Challenge Accumulation: Discovers and stores challenges over time
- Smart Selection: Always mines the easiest available challenge with sufficient deadline buffer
- Deadline Safety: 2-hour buffer ensures solutions are submitted before expiry
- Dynamic Expansion: Automatically creates more wallets if all 16 are busy
miner.py- Python orchestrator managing workers and API communicationlibs/linux-x64/ashmaize_py.so- Native Rust library for PoW computationscripts/- Helper scripts for deployment and status monitoringMakefile- Automation for all operations
- Unix-like OS (Linux/macOS)
make,ssh,rsyncinstalled
- Ubuntu 24.04 LTS (recommended)
- 8+ CPU cores (for optimal hash rate)
- 4GB+ RAM
- SSH key access to root (must be already configured)
make init-<host> # Install mining software on VPSmake start-<host> # Start mining
make stop-<host> # Stop mining
make status-<host> # Show status and save report
make backup-<host> # Backup wallets and dataConfig files are in config/<host>.conf:
HOSTNAME=123.234.33.53 # VPS IP address
DATA_DIR=./data/v01 # Local backup directoryNotes:
- SSH key access to root must be configured before using these tools
- Miner runs as root in
/root/midnight-minerfor simplified deployment - All
config/*.conffiles (except.example) are gitignored for security
Expected hash rate (8-core VPS): ~8-9 KH/s
Solution rate: Variable, depends on:
- Challenge difficulty
- Number of active challenges
- Hash rate consistency
Wallet format: BIP39 15-word mnemonic (compatible with NuFi/Eternl wallets)
- All sensitive files are gitignored (configs, wallets, data)
- SSH key-based authentication only
- Wallets use standard BIP39 mnemonics for recovery
- No private keys or credentials in repository
Always backup your wallets immediately after generation!
midnight-miner/
├── config/ # VPS configurations (gitignored)
│ └── v01.conf.example # Example config
├── data/ # Local backups (gitignored)
├── scripts/ # Deployment helper scripts
│ ├── init-user.sh # VPS user initialization
│ ├── install-service.sh # Systemd service setup
│ └── get-status.sh # Status report generator
├── libs/ # Native Rust libraries
│ └── linux-x64/
│ └── ashmaize_py.so # AshMaize PoW implementation
├── miner.py # Main Python orchestrator
├── requirements.txt # Python dependencies
├── Makefile # Automation commands
├── README.md # This file
└── QUICKSTART.md # Quick start guide
Manage multiple mining servers by creating separate config files:
config/v01.conf # First VPS
config/v02.conf # Second VPS
config/v03.conf # Third VPSThen run commands with different host names:
make status-v01
make status-v02
make backup-v03SSH Connection Issues:
ssh root@vps.ip.addressEnsure SSH key access to root is configured in your VPS provider's console.
Mining Not Starting:
ssh root@vps "journalctl -u midnight-miner -n 100"Check Systemd Status:
ssh root@vps "systemctl status midnight-miner"Apache-2.0 OR MIT
This software is provided as-is without warranty. Use at your own risk. Always backup your wallet files and mnemonic phrases securely.
For detailed setup instructions, see QUICKSTART.md