High-performance automated miner for the NIGHT Token Scavenger Mine program, optimized for Ubuntu Linux.
⚡ Features: Multi-threading • Native Linux • Automatic backups • Systemd integration • Free & Open Source
# Clone and setup
git clone https://github.com/CL-LLC/night-miner-linux.git
cd night-miner-linux
chmod +x install.sh
./install.sh
# Start mining!
./run_miner.sh# Install system dependencies
sudo apt-get update
sudo apt-get install -y python3 python3-venv libsodium-dev libssl-dev libgmp-dev
# Download Cardano CLI tools
wget -q https://github.com/IntersectMBO/cardano-node/releases/download/10.3.1/cardano-node-10.3.1-linux.tar.gz
tar -xzf cardano-node-10.3.1-linux.tar.gz && cp bin/cardano-cli bin/bech32 . && rm -rf bin/ share/ *.tar.gz
# Install Python dependencies
python3 -m venv venv && source venv/bin/activate && pip install requests
# Start mining
python3 night_miner.py --threads 8| Requirement | Minimum | Recommended |
|---|---|---|
| OS | Ubuntu 20.04 LTS | Ubuntu 22.04+ LTS |
| CPU | 2 cores | 4+ cores |
| RAM | 2 GB | 4+ GB |
| Storage | 2 GB | 4+ GB |
| Python | 3.10+ | 3.13+ |
| Network | Stable internet | Stable fiber |
# Use all available cores
./run_miner.sh
# Use specific number of threads
./run_miner.sh --threads 8
# Show help
./run_miner.sh --help# Run with lower system priority
nice -n 19 ./run_miner.sh --threads 6
# Run in background
nohup ./run_miner.sh --threads 8 > mining.log 2>&1 &
# Monitor mining logs
tail -f mining.log| Option | Description | Default |
|---|---|---|
--threads |
Number of mining threads | CPU count |
| No other options required |
- Terms Agreement: Read and accept NIGHT Token terms and developer agreement
- Developer Address: Automatic assignment from developer pool
- Wallet Creation: Addresses generated as needed during mining
- Backup: Wait 2-4 hours, then backup your wallet
📡 Fetch Challenge → 🔍 Multi-threaded Mining → ✅ Find Solution → 📤 Submit → 🔄 Next Challenge
🌙 Starting NIGHT Token Miner with 8 threads
📁 Wallet directory: /path/to/night-miner-ubuntu/auto-mine-wallet
⚠️ CRITICAL: Back up your auto-mine-wallet/ folder regularly!
🔥 Mining with address 0: addr_test1vrku2c0f2qqdcccq4ua03dfl523p5pkkucrhfwhlx68cc6g2q4h90
⛏️ Mining...
✅ Thread 3 found nonce: 8f4a2c1b
✅ Solution submitted successfully! Nonce: 8f4a2c1b | Time: 12.34s
⏳ Waiting 3600 seconds for next challenge...
Your auto-mine-wallet/ folder contains the keys to claim your rewards. Losing it means losing all mined NIGHT tokens permanently.
auto-mine-wallet/
├── wallet.json # Complete address registry
├── addr-0.skey # Private key #1 (CRITICAL)
├── addr-1.skey # Private key #2 (CRITICAL)
├── addr-*.skey # More private keys
├── addr-*.vkey # Verification keys
├── addr-*.addr # Address files
├── .priority # Assigned developer address
└── .agreement # Terms acceptance record
# Quick backup
cp -r auto-mine-wallet/ "backup-$(date +%Y-%m-%d-%H%M)"
# Automated backup (recommended)
./backup_wallet.sh
# Verify backup
ls -la backup-*/- Wait 2-4 hours: Let the miner generate addresses first
- Initial backup: Your first backup should be substantial
- Regular backups: Every 6-12 hours during active mining
- Multiple locations: Store backups externally (cloud + USB)
- Test restoration: Verify you can restore from backup
The installer handles:
- ✅ Python environment setup (venv for newer Ubuntu)
- ✅ System dependency checking
- ✅ Cardano CLI binary download & setup
- ✅ Permissions configuration
- ✅ Service file preparation
-
System Dependencies
sudo apt-get update sudo apt-get install -y python3 python3-venv libsodium-dev libssl-dev libgmp-dev
-
Cardano CLI Tools
wget -q https://github.com/IntersectMBO/cardano-node/releases/download/10.3.1/cardano-node-10.3.1-linux.tar.gz tar -xzf cardano-node-10.3.1-linux.tar.gz cp bin/cardano-cli bin/bech32 ./ rm -rf bin/ share/ *.tar.gz chmod +x cardano-cli bech32 -
Python Dependencies
python3 -m venv venv source venv/bin/activate pip install requests
# Test Cardano CLI
./cardano-cli --version
./bech32 --version
# Test Miner
./run_miner.sh --help# Install as systemd service
./systemd_setup.sh
# Start/stop service
sudo systemctl start night-miner
sudo systemctl stop night-miner
# View logs
sudo journalctl -f -u night-miner# CPU performance mode
echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
# Disable swap temporarily
sudo swapoff -a
# Process priority adjustment
nice -n 19 ./run_miner.sh --threads 6night-miner-ubuntu/
├── src/
│ ├── night_miner.py # Main miner script
│ └── requirements.txt # Python dependencies
├── bin/
│ ├── cardano-cli # Cardano CLI binary
│ └── bech32 # Bech32 tool
├── venv/ # Python virtual environment
├── auto-mine-wallet/ # Mining wallet (created during mining)
├── install.sh # Installation script
├── run_miner.sh # Miner launcher
├── backup_wallet.sh # Backup utility
├── systemd_setup.sh # Service setup
├── README.md # This file
└── miner.log # Mining logs
# The install.sh script handles this automatically
# If you see this error manually:
python3 -m venv venv
source venv/bin/activate
pip install -r src/requirements.txt# Make scripts executable
chmod +x *.sh src/night_miner.py bin/cardano-cli bin/bech32# Install required packages
sudo apt-get install -y libsodium-dev libssl-dev libgmp-dev# Test binaries directly
./cardano-cli --version
./bech32 --version
# Re-download if broken
rm -f cardano-cli bech32
# Re-run installation script or manual steps# Test API connectivity
curl -I https://scavenger-api.midnight.network
# Check firewall
sudo ufw status
# If blocked: sudo ufw allow out 443# Run with verbose logging
python3 src/night_miner.py --threads 2
# Check system resources
htop # CPU usage
free -h # Memory usage
df -h # Disk space| Symptom | Solution |
|---|---|
| High CPU usage | Normal - mining is CPU-intensive |
| Low success rate | Check network, try more threads |
| System sluggish | Use nice priority, reduce threads |
| Frequent timeouts | Check internet stability |
| CPU Cores | Recommended Threads | Reasoning |
|---|---|---|
| 2 cores | 2-3 threads | Physical cores + 1 hyperthread |
| 4 cores | 6 threads | All physical + 2 hyperthreads |
| 8 cores | 12 threads | Physical + half hyperthreads |
| 16+ cores | CPU cores × 0.75 | Leave some cores for system |
- Nonce Finding: 1-5 solutions per hour (varies by difficulty)
- Address Generation: 1 new address per successful submission
- Network Latency: <500ms response time optimal
-
Private Key Protection
- Never share
.skeyfiles - Store backups in encrypted locations
- Consider hardware wallet integration
- Never share
-
Access Control
# Restrict wallet directory permissions chmod 700 auto-mine-wallet/ chmod 600 auto-mine-wallet/*.skey
-
Network Security
- Use VPN if in restrictive regions
- Monitor API connections
- Verify binary checksums
-
System Hardening
# Create dedicated mining user (optional) sudo useradd -r -s /bin/false nightminer sudo chown -R nightminer:nightminer night-miner-ubuntu/
⚠️ NEVER share yourauto-mine-wallet/folder⚠️ NEVER commit wallet files to version control⚠️ ALWAYS verify binary authenticity⚠️ BACKUP EARLY AND OFTEN
- GitHub Issues: Create bug report
- Discussions: GitHub Discussions
- Wiki: Extended documentation
- Discord: Midnight Network community
- Telegram: NIGHT token discussions
- Reddit: r/Cardano and r/CryptoCurrency
# Simplified nonce finding logic
for nonce in range(start_range, end_range):
hash_input = f"{address}{nonce}{challenge_id}".encode()
hash_result = sha256(hash_input).hexdigest()
if hash_result.startswith("0" * difficulty):
return nonce # Solution found!| Endpoint | Method | Purpose |
|---|---|---|
/api/v1/challenge |
GET | Get current challenge |
/api/v1/submit |
POST | Submit solution |
/api/v1/register |
POST | Register address |
/api/v1/status |
GET | Check system status |
# Cardano CLI command used
cardano-cli address key-gen \
--verification-key-file payment.vkey \
--signing-key-file payment.skey
cardano-cli address build \
--payment-verification-key-file payment.vkey \
--testnet-magic 1 \
--out-file payment.addrMIT License - Free for personal and commercial use
- This software is provided "as is" without warranty
- Mining results are not guaranteed and vary by:
- Network difficulty and competition
- Internet connection stability
- Hardware performance and luck
- Use at your own risk - you accept full responsibility
By using this miner, you agree to:
- Mine 1 solution per challenge for the developer
- Keep remaining solutions for your generated addresses
- Accept terms displayed during initial setup
- GPU Acceleration - CUDA/OpenCL support
- Advanced Monitoring - Web dashboard interface
- Package Distribution - APT repository support
- Multi-distro Support - Fedora, Arch, Debian packages
- ARM Compatibility - Raspberry Pi, ARM servers
- v1.0.0 - Initial Ubuntu release with full Windows feature parity
- Full changelog available on GitHub Releases
- System Requirements Met: Ubuntu 20.04+, Python 3.10+
- Dependencies Installed:
./install.shcompleted successfully - Binaries Working:
cardano-cli --versionreturns output - Mining Started:
./run_miner.shshows active mining - Terms Accepted: You typed "agree" during setup
- Backup Plan: Automated backup script ready to run
- Monitoring: Mining output showing solution attempts
Happy Mining! 🌙
Your participation helps strengthen the Midnight Network. Remember to secure your wallet keys and join our community for updates and support!
Last updated: November 2024
Made with ❤️ for the Midnight Network community