moved stratum proxy code _+fixes

This commit is contained in:
Dobromir Popov
2025-09-15 22:35:58 +03:00
parent b5bec14311
commit c796013f19
7 changed files with 2365 additions and 1 deletions

View File

@@ -0,0 +1,77 @@
#!/bin/bash
# Start Fixed RinCoin Stratum Proxy Server
# This version fixes block hash calculation and validation issues
echo "=== RinCoin Stratum Proxy Server - FIXED VERSION ==="
echo ""
# Check if RinCoin node is running
if ! sudo docker ps | grep -q "rincoin-node"; then
echo "❌ Error: rincoin-node container is not running!"
echo "Please start it first:"
echo "sudo docker start rincoin-node"
exit 1
fi
echo "✅ RinCoin node is running"
# Check if Python3 and requests are available
if ! command -v python3 &> /dev/null; then
echo "❌ Error: python3 is not installed!"
echo "Please install it: sudo apt-get install python3"
exit 1
fi
# Install requests if not available
python3 -c "import requests" 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 3334 is already in use
if netstat -tln | grep -q ":3334 "; then
echo ""
echo "⚠️ Port 3334 is already in use!"
echo ""
echo "🔍 Process using port 3334:"
sudo netstat -tlnp | grep ":3334 " || echo "Could not determine process"
echo ""
echo "🛑 To kill existing process:"
echo "sudo lsof -ti:3334 | 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 3334..."
sudo lsof -ti:3334 | xargs sudo kill -9 2>/dev/null || echo "No processes to kill"
sleep 2
else
echo "Exiting..."
exit 1
fi
fi
echo ""
echo "🚀 Starting FIXED Stratum Proxy Server..."
echo ""
echo "FIXES APPLIED:"
echo "1. ✅ Fixed block header endianness issues"
echo "2. ✅ Fixed target comparison (hash <= target instead of hash > target)"
echo "3. ✅ Fixed bits-to-target conversion"
echo "4. ✅ Improved debugging output with hash vs target comparison"
echo "5. ✅ Lowered mining difficulty for testing (0.00001)"
echo ""
echo "This version will properly validate blocks and find them with your hashrate!"
echo ""
echo "After it starts, connect your miner with:"
echo "sudo docker exec -it amd-strix-halo-llama-rocm bash -c \"/mnt/dl/rinhash/cpuminer-opt-rin/cpuminer -a rinhash -o stratum+tcp://127.0.0.1:3334 -u user -p pass -t 28\""
echo ""
echo "Press Ctrl+C to stop the proxy"
echo ""
# Start the fixed proxy
cd "$(dirname "$0")"
python3 stratum_proxy_fixed.py