Files
scripts/MINE/rin/start_mining_pool.sh
Dobromir Popov 1e9a56356e wehb dash!
2025-09-02 12:19:49 +03:00

84 lines
2.6 KiB
Bash

#!/bin/bash
# RinCoin Mining Pool Server Startup Script
# Distributes block rewards among multiple miners
echo "=== RinCoin Mining Pool Server ==="
echo ""
# Check if RinCoin node is running
echo "Checking RinCoin node status..."
if ! curl -s -u rinrpc:745ce784d5d537fc06105a1b935b7657903cfc71a5fb3b90 \
-H 'content-type: text/plain' \
--data '{"jsonrpc":"1.0","id":"curl","method":"getblockchaininfo","params":[]}' \
http://127.0.0.1:9556/ > /dev/null; then
echo "❌ RinCoin node is not running!"
echo "Start it first with: docker start rincoin-node"
exit 1
fi
echo "✅ RinCoin node is running"
# Check Python dependencies
echo "Checking Python dependencies..."
python3 -c "import requests, sqlite3" 2>/dev/null || {
echo "Installing python3-requests..."
sudo apt-get update && sudo apt-get install -y python3-requests
}
echo "✅ Python dependencies ready"
# Check if port 3333 is already in use
if netstat -tln | grep -q ":3333 "; then
echo ""
echo "⚠️ Port 3333 is already in use!"
echo ""
echo "🔍 Process using port 3333:"
sudo netstat -tlnp | grep ":3333 " || echo "Could not determine process"
echo ""
echo "🛑 To kill existing process:"
echo "sudo lsof -ti:3333 | xargs sudo kill -9"
echo ""
read -p "Kill existing process and continue? (y/N): " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Killing processes using port 3333..."
sudo lsof -ti:3333 | xargs sudo kill -9 2>/dev/null || echo "No processes to kill"
sleep 2
else
echo "Exiting..."
exit 1
fi
fi
echo ""
echo "🚀 Starting Mining Pool Server..."
echo "This will distribute block rewards among multiple miners"
echo ""
echo "Pool Features:"
echo "- Multiple miner support"
echo "- Share-based reward distribution"
echo "- Pool fee: 1%"
echo "- Real-time statistics"
echo "- Web dashboard on port 8083"
echo ""
echo "After it starts, miners can connect with:"
echo ""
echo "Option 1: Address as username"
echo "./cpuminer -a rinhash -o stratum+tcp://YOUR_IP:3333 -u rin1qahvvv9d5f3443wtckeqavwp9950wacxfmwv20q -p x"
echo ""
echo "Option 2: Address.workername format"
echo "./cpuminer -a rinhash -o stratum+tcp://YOUR_IP:3333 -u rin1qahvvv9d5f3443wtckeqavwp9950wacxfmwv20q.worker1 -p x"
echo ""
echo "Option 3: Traditional username (rewards to pool address)"
echo "./cpuminer -a rinhash -o stratum+tcp://YOUR_IP:3333 -u username.workername -p x"
echo ""
echo "🌐 Web Dashboard: http://YOUR_IP:8083"
echo "📊 View real-time pool statistics, miners, and blocks"
echo ""
echo "Press Ctrl+C to stop the pool"
# Start the mining pool
python3 MINE/rin/stratum_pool.py