stratum working, implement mining pool, support "extranonce"
This commit is contained in:
71
MINE/rin/start_mining_pool.sh
Normal file
71
MINE/rin/start_mining_pool.sh
Normal file
@@ -0,0 +1,71 @@
|
||||
#!/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 ""
|
||||
|
||||
echo "After it starts, miners can connect with:"
|
||||
echo "./cpuminer -a rinhash -o stratum+tcp://YOUR_IP:3333 -u username.workername -p x"
|
||||
echo ""
|
||||
echo "Press Ctrl+C to stop the pool"
|
||||
|
||||
# Start the mining pool
|
||||
python3 MINE/rin/stratum_pool.py
|
Reference in New Issue
Block a user