code moved to mines

This commit is contained in:
Dobromir Popov
2025-09-30 00:07:07 +03:00
parent 720c74db12
commit 6f13d87f6c
15 changed files with 2714 additions and 2713 deletions

View File

@@ -19,7 +19,7 @@ cd /mnt/shared/DEV/repos/d-popov.com/scripts
/mnt/shared/DEV/repos/d-popov.com/mines/rin/miner/cpuminer-opt-rin/cpuminer -a rinhash -o stratum+tcp://eu.rplant.xyz:17148 -u bc1qjn4m6rmrveuxhk02a5qhe4r6kdcsvvt3vhdn9j -p c=BTC,mc=RIN,m=solo /mnt/shared/DEV/repos/d-popov.com/mines/rin/miner/cpuminer-opt-rin/cpuminer -a rinhash -o stratum+tcp://eu.rplant.xyz:17148 -u bc1qjn4m6rmrveuxhk02a5qhe4r6kdcsvvt3vhdn9j -p c=BTC,mc=RIN,m=solo
/mnt/shared/DEV/repos/d-popov.com/mines/rin/miner/cpuminer-opt-rin/cpuminer -a rinhash -o stratum+tcp://eu.rplant.xyz:17148 -u rin1qahvvv9d5f3443wtckeqavwp9950wacxfmwv20q -p m=solo /mnt/shared/DEV/repos/d-popov.com/mines/rin/miner/cpuminer-opt-rin/cpuminer -a rinhash -o stratum+tcp://eu.rplant.xyz:17148 -u rin1qahvvv9d5f3443wtckeqavwp9950wacxfmwv20q -p m=solo
cpuminer-sse2 -a rinhash -o stratum+tcps://eu.rplant.xyz:17148 -u wallet -p m=solo cpuminer-sse2 -a rinhash -o stratum+tcps://eu.rplant.xyz:17148 -u wallet -p m=solo
??? rin1qvj0yyt9phvled9kxflju3p687a4s7kareglpk5 ???
``` ```
**Result**: 100% of block rewards go to your wallet **Result**: 100% of block rewards go to your wallet

View File

@@ -1,40 +1,40 @@
#!/bin/bash # #!/bin/bash
# Kill RinCoin Stratum Proxy processes # # Kill RinCoin Stratum Proxy processes
echo "=== Killing RinCoin Stratum Proxy ===" # echo "=== Killing RinCoin Stratum Proxy ==="
echo "" # echo ""
# Find and kill Python processes running stratum_proxy.py # # Find and kill Python processes running stratum_proxy.py
PIDS=$(ps aux | grep "stratum_proxy.py" | grep -v grep | awk '{print $2}') # PIDS=$(ps aux | grep "stratum_proxy.py" | grep -v grep | awk '{print $2}')
if [ -n "$PIDS" ]; then # if [ -n "$PIDS" ]; then
echo "Found Stratum Proxy processes: $PIDS" # echo "Found Stratum Proxy processes: $PIDS"
echo "Killing processes..." # echo "Killing processes..."
for pid in $PIDS; do # for pid in $PIDS; do
kill -9 "$pid" 2>/dev/null && echo "Killed PID: $pid" || echo "Failed to kill PID: $pid" # kill -9 "$pid" 2>/dev/null && echo "Killed PID: $pid" || echo "Failed to kill PID: $pid"
done # done
else # else
echo "No Stratum Proxy processes found" # echo "No Stratum Proxy processes found"
fi # fi
# Also kill any process using port 3333 # # Also kill any process using port 3333
echo "" # echo ""
echo "Checking port 3333..." # echo "Checking port 3333..."
PORT_PIDS=$(sudo lsof -ti:3333 2>/dev/null) # PORT_PIDS=$(sudo lsof -ti:3333 2>/dev/null)
if [ -n "$PORT_PIDS" ]; then # if [ -n "$PORT_PIDS" ]; then
echo "Found processes using port 3333: $PORT_PIDS" # echo "Found processes using port 3333: $PORT_PIDS"
echo "Killing processes..." # echo "Killing processes..."
for pid in $PORT_PIDS; do # for pid in $PORT_PIDS; do
sudo kill -9 "$pid" 2>/dev/null && echo "Killed PID: $pid" || echo "Failed to kill PID: $pid" # sudo kill -9 "$pid" 2>/dev/null && echo "Killed PID: $pid" || echo "Failed to kill PID: $pid"
done # done
else # else
echo "No processes using port 3333" # echo "No processes using port 3333"
fi # fi
echo "" # echo ""
echo "✅ Cleanup complete!" # echo "✅ Cleanup complete!"
echo "" # echo ""
echo "Port 3333 status:" # echo "Port 3333 status:"
netstat -tln | grep ":3333 " || echo "Port 3333 is free" # netstat -tln | grep ":3333 " || echo "Port 3333 is free"

View File

@@ -1 +1,2 @@
[2025-09-29 20:11:03] 💰 Wallet Balance: 0.00000000 RIN [2025-09-29 20:11:03] 💰 Wallet Balance: 0.00000000 RIN
[2025-09-29 22:31:04] 💰 Wallet Balance: 0.00000000 RIN

File diff suppressed because it is too large Load Diff

View File

@@ -1,47 +1,47 @@
#!/bin/bash # #!/bin/bash
# Solo Mining Script for RinCoin # # Solo Mining Script for RinCoin
# Uses local RinCoin node for solo mining # # Uses local RinCoin node for solo mining
echo "=== RinCoin Solo Mining Setup ===" # echo "=== RinCoin Solo Mining Setup ==="
echo "" # echo ""
# Check if rincoin-node container is running # # Check if rincoin-node container is running
if ! sudo docker ps | grep -q "rincoin-node"; then # if ! sudo docker ps | grep -q "rincoin-node"; then
echo "Error: rincoin-node container is not running!" # echo "Error: rincoin-node container is not running!"
echo "Please start it first:" # echo "Please start it first:"
echo "sudo docker start rincoin-node" # echo "sudo docker start rincoin-node"
exit 1 # exit 1
fi # fi
# Get wallet address # # Get wallet address
RIN_ADDRESS=$(sudo docker exec rincoin-node rincoin-cli -datadir=/data -conf=/data/rincoin.conf -rpcwallet=main getnewaddress 2>/dev/null) # RIN_ADDRESS=$(sudo docker exec rincoin-node rincoin-cli -datadir=/data -conf=/data/rincoin.conf -rpcwallet=main getnewaddress 2>/dev/null)
if [ -z "$RIN_ADDRESS" ]; then # if [ -z "$RIN_ADDRESS" ]; then
echo "Error: Could not get RinCoin address!" # echo "Error: Could not get RinCoin address!"
echo "Make sure the wallet is created and the node is synced." # echo "Make sure the wallet is created and the node is synced."
exit 1 # exit 1
fi # fi
echo "RinCoin Address: $RIN_ADDRESS" # echo "RinCoin Address: $RIN_ADDRESS"
echo "" # echo ""
# Check node sync status # # Check node sync status
SYNC_STATUS=$(sudo docker exec rincoin-node rincoin-cli -datadir=/data -conf=/data/rincoin.conf getblockchaininfo | grep -o '"initialblockdownload": [^,]*' | cut -d' ' -f2) # SYNC_STATUS=$(sudo docker exec rincoin-node rincoin-cli -datadir=/data -conf=/data/rincoin.conf getblockchaininfo | grep -o '"initialblockdownload": [^,]*' | cut -d' ' -f2)
if [ "$SYNC_STATUS" = "true" ]; then # if [ "$SYNC_STATUS" = "true" ]; then
echo "⚠️ WARNING: Node is still syncing (initialblockdownload: true)" # echo "⚠️ WARNING: Node is still syncing (initialblockdownload: true)"
echo "Solo mining may not work properly until sync is complete." # echo "Solo mining may not work properly until sync is complete."
echo "" # echo ""
fi # fi
echo "Starting solo mining with cpuminer-opt-rin..." # echo "Starting solo mining with cpuminer-opt-rin..."
echo "Algorithm: rinhash" # echo "Algorithm: rinhash"
echo "Target: Local RinCoin node (127.0.0.1:9555)" # echo "Target: Local RinCoin node (127.0.0.1:9555)"
echo "Wallet: $RIN_ADDRESS" # echo "Wallet: $RIN_ADDRESS"
echo "" # echo ""
echo "Press Ctrl+C to stop mining" # echo "Press Ctrl+C to stop mining"
echo "" # echo ""
# Start solo mining # # Start solo mining
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:9555 -u $RIN_ADDRESS -p x -t 32" # 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:9555 -u $RIN_ADDRESS -p x -t 32"

View File

@@ -1,171 +1,171 @@
#!/bin/bash # #!/bin/bash
# RinCoin Solo Mining using Built-in Core Mining # # RinCoin Solo Mining using Built-in Core Mining
# Uses RinCoin Core's generatetoaddress command # # Uses RinCoin Core's generatetoaddress command
# Default address (can be overridden with command line parameter) # # Default address (can be overridden with command line parameter)
DEFAULT_ADDRESS="rin1qahvvv9d5f3443wtckeqavwp9950wacxfmwv20q" # DEFAULT_ADDRESS="rin1qahvvv9d5f3443wtckeqavwp9950wacxfmwv20q"
# Get total CPU cores for default thread count # # Get total CPU cores for default thread count
TOTAL_CORES=$(nproc) # TOTAL_CORES=$(nproc)
DEFAULT_THREADS=$TOTAL_CORES # DEFAULT_THREADS=$TOTAL_CORES
# Parse command line arguments # # Parse command line arguments
RIN_ADDRESS="" # RIN_ADDRESS=""
THREAD_COUNT="" # THREAD_COUNT=""
# Parse arguments # # Parse arguments
while [[ $# -gt 0 ]]; do # while [[ $# -gt 0 ]]; do
case $1 in # case $1 in
-a|--address) # -a|--address)
RIN_ADDRESS="$2" # RIN_ADDRESS="$2"
shift 2 # shift 2
;; # ;;
-t|--threads) # -t|--threads)
THREAD_COUNT="$2" # THREAD_COUNT="$2"
shift 2 # shift 2
;; # ;;
-h|--help) # -h|--help)
echo "Usage: $0 [OPTIONS]" # echo "Usage: $0 [OPTIONS]"
echo "" # echo ""
echo "Options:" # echo "Options:"
echo " -a, --address ADDRESS RinCoin address to mine to (default: $DEFAULT_ADDRESS)" # echo " -a, --address ADDRESS RinCoin address to mine to (default: $DEFAULT_ADDRESS)"
echo " -t, --threads COUNT Number of threads to use (default: $DEFAULT_THREADS)" # echo " -t, --threads COUNT Number of threads to use (default: $DEFAULT_THREADS)"
echo " -h, --help Show this help message" # echo " -h, --help Show this help message"
echo "" # echo ""
echo "Examples:" # echo "Examples:"
echo " $0 # Use defaults (all cores, default address)" # echo " $0 # Use defaults (all cores, default address)"
echo " $0 -a rin1q... -t 16 # Custom address and 16 threads" # echo " $0 -a rin1q... -t 16 # Custom address and 16 threads"
echo " $0 --address rin1q... --threads 8 # Custom address and 8 threads" # echo " $0 --address rin1q... --threads 8 # Custom address and 8 threads"
exit 0 # exit 0
;; # ;;
*) # *)
echo "Unknown option: $1" # echo "Unknown option: $1"
echo "Use -h or --help for usage information" # echo "Use -h or --help for usage information"
exit 1 # exit 1
;; # ;;
esac # esac
done # done
# Set defaults if not provided # # Set defaults if not provided
if [ -z "$RIN_ADDRESS" ]; then # if [ -z "$RIN_ADDRESS" ]; then
RIN_ADDRESS="$DEFAULT_ADDRESS" # RIN_ADDRESS="$DEFAULT_ADDRESS"
echo "No address provided, using default: $RIN_ADDRESS" # echo "No address provided, using default: $RIN_ADDRESS"
fi # fi
if [ -z "$THREAD_COUNT" ]; then # if [ -z "$THREAD_COUNT" ]; then
THREAD_COUNT="$DEFAULT_THREADS" # THREAD_COUNT="$DEFAULT_THREADS"
echo "No thread count provided, using all cores: $THREAD_COUNT" # echo "No thread count provided, using all cores: $THREAD_COUNT"
fi # fi
# Validate thread count # # Validate thread count
if ! [[ "$THREAD_COUNT" =~ ^[0-9]+$ ]] || [ "$THREAD_COUNT" -lt 1 ] || [ "$THREAD_COUNT" -gt "$TOTAL_CORES" ]; then # if ! [[ "$THREAD_COUNT" =~ ^[0-9]+$ ]] || [ "$THREAD_COUNT" -lt 1 ] || [ "$THREAD_COUNT" -gt "$TOTAL_CORES" ]; then
echo "❌ Error: Invalid thread count: $THREAD_COUNT" # echo "❌ Error: Invalid thread count: $THREAD_COUNT"
echo "Thread count must be between 1 and $TOTAL_CORES" # echo "Thread count must be between 1 and $TOTAL_CORES"
exit 1 # exit 1
fi # fi
echo "=== RinCoin Solo Mining (Built-in Core Mining) ===" # echo "=== RinCoin Solo Mining (Built-in Core Mining) ==="
echo "CPU Cores Available: $TOTAL_CORES" # echo "CPU Cores Available: $TOTAL_CORES"
echo "Threads to Use: $THREAD_COUNT" # echo "Threads to Use: $THREAD_COUNT"
echo "Target Address: $RIN_ADDRESS" # echo "Target Address: $RIN_ADDRESS"
echo "" # echo ""
echo "" # echo ""
# Configuration # # Configuration
RPC_HOST="127.0.0.1" # RPC_HOST="127.0.0.1"
RPC_PORT="9556" # RPC_PORT="9556"
RPC_USER="rinrpc" # RPC_USER="rinrpc"
RPC_PASS="745ce784d5d537fc06105a1b935b7657903cfc71a5fb3b90" # RPC_PASS="745ce784d5d537fc06105a1b935b7657903cfc71a5fb3b90"
# Function to call RPC # # Function to call RPC
call_rpc() { # call_rpc() {
local method="$1" # local method="$1"
local params="$2" # local params="$2"
curl -s --user "$RPC_USER:$RPC_PASS" \ # curl -s --user "$RPC_USER:$RPC_PASS" \
-H 'content-type: text/plain' \ # -H 'content-type: text/plain' \
--data "{\"jsonrpc\":\"1.0\",\"id\":\"curl\",\"method\":\"$method\",\"params\":$params}" \ # --data "{\"jsonrpc\":\"1.0\",\"id\":\"curl\",\"method\":\"$method\",\"params\":$params}" \
"http://$RPC_HOST:$RPC_PORT/" # "http://$RPC_HOST:$RPC_PORT/"
} # }
# Wait for node to be ready # # Wait for node to be ready
echo "Waiting for RinCoin node to be ready..." # echo "Waiting for RinCoin node to be ready..."
while true; do # while true; do
response=$(call_rpc "getblockchaininfo" "[]") # response=$(call_rpc "getblockchaininfo" "[]")
if [[ $response != *"Loading block index"* ]]; then # if [[ $response != *"Loading block index"* ]]; then
break # break
fi # fi
echo "Node still loading... waiting 10 seconds" # echo "Node still loading... waiting 10 seconds"
sleep 10 # sleep 10
done # done
echo "✅ Node is ready!" # echo "✅ Node is ready!"
echo "" # echo ""
# Load wallet if not already loaded # # Load wallet if not already loaded
echo "Loading wallet..." # echo "Loading wallet..."
wallet_response=$(call_rpc "loadwallet" "[\"main\"]") # wallet_response=$(call_rpc "loadwallet" "[\"main\"]")
if [[ $wallet_response == *"error"* ]] && [[ $wallet_response == *"already loaded"* ]]; then # if [[ $wallet_response == *"error"* ]] && [[ $wallet_response == *"already loaded"* ]]; then
echo "✅ Wallet already loaded" # echo "✅ Wallet already loaded"
else # else
echo "✅ Wallet loaded successfully" # echo "✅ Wallet loaded successfully"
fi # fi
echo "" # echo ""
# Validate the provided address (basic check) # # Validate the provided address (basic check)
if [[ ! "$RIN_ADDRESS" =~ ^rin1[a-zA-Z0-9]{25,}$ ]]; then # if [[ ! "$RIN_ADDRESS" =~ ^rin1[a-zA-Z0-9]{25,}$ ]]; then
echo "❌ Error: Invalid RinCoin address format: $RIN_ADDRESS" # echo "❌ Error: Invalid RinCoin address format: $RIN_ADDRESS"
echo "RinCoin addresses should start with 'rin1' and be ~30 characters long" # echo "RinCoin addresses should start with 'rin1' and be ~30 characters long"
exit 1 # exit 1
fi # fi
echo "✅ Using RinCoin Address: $RIN_ADDRESS" # echo "✅ Using RinCoin Address: $RIN_ADDRESS"
echo "" # echo ""
# Get blockchain info # # Get blockchain info
echo "Blockchain Status:" # echo "Blockchain Status:"
blockchain_info=$(call_rpc "getblockchaininfo" "[]") # blockchain_info=$(call_rpc "getblockchaininfo" "[]")
blocks=$(echo "$blockchain_info" | grep -o '"blocks":[^,]*' | cut -d':' -f2) # blocks=$(echo "$blockchain_info" | grep -o '"blocks":[^,]*' | cut -d':' -f2)
headers=$(echo "$blockchain_info" | grep -o '"headers":[^,]*' | cut -d':' -f2) # headers=$(echo "$blockchain_info" | grep -o '"headers":[^,]*' | cut -d':' -f2)
difficulty=$(echo "$blockchain_info" | grep -o '"difficulty":[^,]*' | cut -d':' -f2) # difficulty=$(echo "$blockchain_info" | grep -o '"difficulty":[^,]*' | cut -d':' -f2)
echo "Blocks: $blocks" # echo "Blocks: $blocks"
echo "Headers: $headers" # echo "Headers: $headers"
echo "Difficulty: $difficulty" # echo "Difficulty: $difficulty"
echo "" # echo ""
echo "⚠️ IMPORTANT: Built-in Core Mining Limitations:" # echo "⚠️ IMPORTANT: Built-in Core Mining Limitations:"
echo "1. Uses CPU only (not GPU)" # echo "1. Uses CPU only (not GPU)"
echo "2. Very low hashpower compared to specialized miners" # echo "2. Very low hashpower compared to specialized miners"
echo "3. Extremely low chance of finding blocks solo" # echo "3. Extremely low chance of finding blocks solo"
echo "4. Best for testing, not profitable mining" # echo "4. Best for testing, not profitable mining"
echo "5. Thread count affects mining attempts per cycle" # echo "5. Thread count affects mining attempts per cycle"
echo "" # echo ""
echo "🚀 Starting Built-in Solo Mining..." # echo "🚀 Starting Built-in Solo Mining..."
echo "Target Address: $RIN_ADDRESS" # echo "Target Address: $RIN_ADDRESS"
echo "Threads: $THREAD_COUNT" # echo "Threads: $THREAD_COUNT"
echo "Press Ctrl+C to stop mining" # echo "Press Ctrl+C to stop mining"
echo "" # echo ""
# Start built-in mining with specified thread count # # Start built-in mining with specified thread count
# Note: RinCoin Core's generatetoaddress doesn't directly support thread count # # Note: RinCoin Core's generatetoaddress doesn't directly support thread count
# but we can run multiple instances or adjust the maxtries parameter # # but we can run multiple instances or adjust the maxtries parameter
while true; do # while true; do
echo "Attempting to mine 1 block with $THREAD_COUNT threads..." # echo "Attempting to mine 1 block with $THREAD_COUNT threads..."
# Adjust maxtries based on thread count for better distribution # # Adjust maxtries based on thread count for better distribution
adjusted_tries=$((1000000 * THREAD_COUNT / TOTAL_CORES)) # adjusted_tries=$((1000000 * THREAD_COUNT / TOTAL_CORES))
mining_result=$(call_rpc "generatetoaddress" "[1, \"$RIN_ADDRESS\", $adjusted_tries]") # mining_result=$(call_rpc "generatetoaddress" "[1, \"$RIN_ADDRESS\", $adjusted_tries]")
if [[ $mining_result == *"result"* ]] && [[ $mining_result != *"[]"* ]]; then # if [[ $mining_result == *"result"* ]] && [[ $mining_result != *"[]"* ]]; then
echo "🎉 BLOCK FOUND!" # echo "🎉 BLOCK FOUND!"
echo "Result: $mining_result" # echo "Result: $mining_result"
break # break
else # else
echo "No block found in this attempt (tries: $adjusted_tries). Retrying..." # echo "No block found in this attempt (tries: $adjusted_tries). Retrying..."
sleep 5 # sleep 5
fi # fi
done # done

View File

@@ -1,81 +1,81 @@
#!/bin/bash # #!/bin/bash
# Remote Solo Mining Script for RinCoin # # Remote Solo Mining Script for RinCoin
# Connects to RinCoin node over network/RPC # # Connects to RinCoin node over network/RPC
# Configuration # # Configuration
RPC_HOST="127.0.0.1" # Change to your server IP for remote access # RPC_HOST="127.0.0.1" # Change to your server IP for remote access
RPC_PORT="9556" # RPC_PORT="9556"
RPC_USER="rinrpc" # RPC_USER="rinrpc"
RPC_PASS="745ce784d5d537fc06105a1b935b7657903cfc71a5fb3b90" # RPC_PASS="745ce784d5d537fc06105a1b935b7657903cfc71a5fb3b90"
echo "=== Remote RinCoin Solo Mining Setup ===" # echo "=== Remote RinCoin Solo Mining Setup ==="
echo "RPC Host: $RPC_HOST:$RPC_PORT" # echo "RPC Host: $RPC_HOST:$RPC_PORT"
echo "" # echo ""
# Test RPC connection # # Test RPC connection
echo "Testing RPC connection..." # echo "Testing RPC connection..."
RPC_RESPONSE=$(curl -s --user "$RPC_USER:$RPC_PASS" \ # RPC_RESPONSE=$(curl -s --user "$RPC_USER:$RPC_PASS" \
-H 'content-type: text/plain' \ # -H 'content-type: text/plain' \
--data '{"jsonrpc":"1.0","id":"curl","method":"getblockchaininfo","params":[]}' \ # --data '{"jsonrpc":"1.0","id":"curl","method":"getblockchaininfo","params":[]}' \
"http://$RPC_HOST:$RPC_PORT/") # "http://$RPC_HOST:$RPC_PORT/")
if [[ $RPC_RESPONSE == *"error"* ]]; then # if [[ $RPC_RESPONSE == *"error"* ]]; then
echo "❌ Error: Could not connect to RinCoin RPC!" # echo "❌ Error: Could not connect to RinCoin RPC!"
echo "Response: $RPC_RESPONSE" # echo "Response: $RPC_RESPONSE"
echo "" # echo ""
echo "Check:" # echo "Check:"
echo "1. RinCoin node is running" # echo "1. RinCoin node is running"
echo "2. RPC port $RPC_PORT is accessible" # echo "2. RPC port $RPC_PORT is accessible"
echo "3. Firewall allows connections to port $RPC_PORT" # echo "3. Firewall allows connections to port $RPC_PORT"
exit 1 # exit 1
fi # fi
echo "✅ RPC connection successful!" # echo "✅ RPC connection successful!"
echo "" # echo ""
# Get wallet address via RPC # # Get wallet address via RPC
echo "Getting wallet address..." # echo "Getting wallet address..."
WALLET_RESPONSE=$(curl -s --user "$RPC_USER:$RPC_PASS" \ # WALLET_RESPONSE=$(curl -s --user "$RPC_USER:$RPC_PASS" \
-H 'content-type: text/plain' \ # -H 'content-type: text/plain' \
--data '{"jsonrpc":"1.0","id":"curl","method":"getnewaddress","params":[]}' \ # --data '{"jsonrpc":"1.0","id":"curl","method":"getnewaddress","params":[]}' \
"http://$RPC_HOST:$RPC_PORT/") # "http://$RPC_HOST:$RPC_PORT/")
RIN_ADDRESS=$(echo "$WALLET_RESPONSE" | grep -o '"result":"[^"]*"' | cut -d'"' -f4) # RIN_ADDRESS=$(echo "$WALLET_RESPONSE" | grep -o '"result":"[^"]*"' | cut -d'"' -f4)
if [ -z "$RIN_ADDRESS" ]; then # if [ -z "$RIN_ADDRESS" ]; then
echo "❌ Error: Could not get RinCoin address!" # echo "❌ Error: Could not get RinCoin address!"
echo "Response: $WALLET_RESPONSE" # echo "Response: $WALLET_RESPONSE"
echo "" # echo ""
echo "Make sure wallet 'main' exists:" # echo "Make sure wallet 'main' exists:"
echo "curl --user $RPC_USER:$RPC_PASS -H 'content-type: text/plain' --data '{\"jsonrpc\":\"1.0\",\"id\":\"curl\",\"method\":\"createwallet\",\"params\":[\"main\"]}' http://$RPC_HOST:$RPC_PORT/" # echo "curl --user $RPC_USER:$RPC_PASS -H 'content-type: text/plain' --data '{\"jsonrpc\":\"1.0\",\"id\":\"curl\",\"method\":\"createwallet\",\"params\":[\"main\"]}' http://$RPC_HOST:$RPC_PORT/"
exit 1 # exit 1
fi # fi
echo "✅ RinCoin Address: $RIN_ADDRESS" # echo "✅ RinCoin Address: $RIN_ADDRESS"
echo "" # echo ""
# Check node sync status # # Check node sync status
SYNC_RESPONSE=$(curl -s --user "$RPC_USER:$RPC_PASS" \ # SYNC_RESPONSE=$(curl -s --user "$RPC_USER:$RPC_PASS" \
-H 'content-type: text/plain' \ # -H 'content-type: text/plain' \
--data '{"jsonrpc":"1.0","id":"curl","method":"getblockchaininfo","params":[]}' \ # --data '{"jsonrpc":"1.0","id":"curl","method":"getblockchaininfo","params":[]}' \
"http://$RPC_HOST:$RPC_PORT/") # "http://$RPC_HOST:$RPC_PORT/")
SYNC_STATUS=$(echo "$SYNC_RESPONSE" | grep -o '"initialblockdownload":[^,]*' | cut -d':' -f2 | tr -d ' ') # SYNC_STATUS=$(echo "$SYNC_RESPONSE" | grep -o '"initialblockdownload":[^,]*' | cut -d':' -f2 | tr -d ' ')
if [ "$SYNC_STATUS" = "true" ]; then # if [ "$SYNC_STATUS" = "true" ]; then
echo "⚠️ WARNING: Node is still syncing (initialblockdownload: true)" # echo "⚠️ WARNING: Node is still syncing (initialblockdownload: true)"
echo "Solo mining may not work properly until sync is complete." # echo "Solo mining may not work properly until sync is complete."
echo "" # echo ""
fi # fi
echo "Starting remote solo mining with cpuminer-opt-rin..." # echo "Starting remote solo mining with cpuminer-opt-rin..."
echo "Algorithm: rinhash" # echo "Algorithm: rinhash"
echo "Target: RinCoin node at $RPC_HOST:9555" # echo "Target: RinCoin node at $RPC_HOST:9555"
echo "Wallet: $RIN_ADDRESS" # echo "Wallet: $RIN_ADDRESS"
echo "" # echo ""
echo "Press Ctrl+C to stop mining" # echo "Press Ctrl+C to stop mining"
echo "" # echo ""
# Start solo mining (connect to P2P port, not RPC) # # Start solo mining (connect to P2P port, not RPC)
sudo docker exec -it amd-strix-halo-llama-rocm bash -c "/mnt/dl/rinhash/cpuminer-opt-rin/cpuminer -a rinhash -o stratum+tcp://$RPC_HOST:9555 -u $RIN_ADDRESS -p x -t 32" # sudo docker exec -it amd-strix-halo-llama-rocm bash -c "/mnt/dl/rinhash/cpuminer-opt-rin/cpuminer -a rinhash -o stratum+tcp://$RPC_HOST:9555 -u $RIN_ADDRESS -p x -t 32"

View File

@@ -1,76 +1,76 @@
#!/bin/bash # #!/bin/bash
# RinCoin Solo Mining via RPC # # RinCoin Solo Mining via RPC
# This script uses RinCoin's RPC interface for solo mining # # This script uses RinCoin's RPC interface for solo mining
echo "=== RinCoin Solo Mining via RPC ===" # echo "=== RinCoin Solo Mining via RPC ==="
echo "" # echo ""
# Configuration # # Configuration
RPC_HOST="127.0.0.1" # RPC_HOST="127.0.0.1"
RPC_PORT="9556" # RPC_PORT="9556"
RPC_USER="rinrpc" # RPC_USER="rinrpc"
RPC_PASS="745ce784d5d537fc06105a1b935b7657903cfc71a5fb3b90" # RPC_PASS="745ce784d5d537fc06105a1b935b7657903cfc71a5fb3b90"
# Function to call RPC # # Function to call RPC
call_rpc() { # call_rpc() {
local method="$1" # local method="$1"
local params="$2" # local params="$2"
curl -s --user "$RPC_USER:$RPC_PASS" \ # curl -s --user "$RPC_USER:$RPC_PASS" \
-H 'content-type: text/plain' \ # -H 'content-type: text/plain' \
--data "{\"jsonrpc\":\"1.0\",\"id\":\"curl\",\"method\":\"$method\",\"params\":$params}" \ # --data "{\"jsonrpc\":\"1.0\",\"id\":\"curl\",\"method\":\"$method\",\"params\":$params}" \
"http://$RPC_HOST:$RPC_PORT/" # "http://$RPC_HOST:$RPC_PORT/"
} # }
# Wait for node to be ready # # Wait for node to be ready
echo "Waiting for RinCoin node to be ready..." # echo "Waiting for RinCoin node to be ready..."
while true; do # while true; do
response=$(call_rpc "getblockchaininfo" "[]") # response=$(call_rpc "getblockchaininfo" "[]")
if [[ $response != *"Loading block index"* ]]; then # if [[ $response != *"Loading block index"* ]]; then
break # break
fi # fi
echo "Node still loading... waiting 10 seconds" # echo "Node still loading... waiting 10 seconds"
sleep 10 # sleep 10
done # done
echo "✅ Node is ready!" # echo "✅ Node is ready!"
echo "" # echo ""
# Get wallet address # # Get wallet address
echo "Getting wallet address..." # echo "Getting wallet address..."
wallet_response=$(call_rpc "getnewaddress" "[]") # wallet_response=$(call_rpc "getnewaddress" "[]")
rin_address=$(echo "$wallet_response" | grep -o '"result":"[^"]*"' | cut -d'"' -f4) # rin_address=$(echo "$wallet_response" | grep -o '"result":"[^"]*"' | cut -d'"' -f4)
if [ -z "$rin_address" ]; then # if [ -z "$rin_address" ]; then
echo "❌ Error: Could not get RinCoin address!" # echo "❌ Error: Could not get RinCoin address!"
echo "Response: $wallet_response" # echo "Response: $wallet_response"
exit 1 # exit 1
fi # fi
echo "✅ RinCoin Address: $rin_address" # echo "✅ RinCoin Address: $rin_address"
echo "" # echo ""
# Get blockchain info # # Get blockchain info
echo "Blockchain Status:" # echo "Blockchain Status:"
blockchain_info=$(call_rpc "getblockchaininfo" "[]") # blockchain_info=$(call_rpc "getblockchaininfo" "[]")
blocks=$(echo "$blockchain_info" | grep -o '"blocks":[^,]*' | cut -d':' -f2) # blocks=$(echo "$blockchain_info" | grep -o '"blocks":[^,]*' | cut -d':' -f2)
headers=$(echo "$blockchain_info" | grep -o '"headers":[^,]*' | cut -d':' -f2) # headers=$(echo "$blockchain_info" | grep -o '"headers":[^,]*' | cut -d':' -f2)
difficulty=$(echo "$blockchain_info" | grep -o '"difficulty":[^,]*' | cut -d':' -f2) # difficulty=$(echo "$blockchain_info" | grep -o '"difficulty":[^,]*' | cut -d':' -f2)
echo "Blocks: $blocks" # echo "Blocks: $blocks"
echo "Headers: $headers" # echo "Headers: $headers"
echo "Difficulty: $difficulty" # echo "Difficulty: $difficulty"
echo "" # echo ""
echo "⚠️ IMPORTANT: RinCoin solo mining requires:" # echo "⚠️ IMPORTANT: RinCoin solo mining requires:"
echo "1. A fully synced node (currently at block $blocks of $headers)" # echo "1. A fully synced node (currently at block $blocks of $headers)"
echo "2. Mining software that supports RinCoin's RPC mining protocol" # echo "2. Mining software that supports RinCoin's RPC mining protocol"
echo "3. Very high hashpower to find blocks solo" # echo "3. Very high hashpower to find blocks solo"
echo "" # echo ""
echo "For now, we recommend pool mining for consistent rewards:" # echo "For now, we recommend pool mining for consistent rewards:"
echo "" # echo ""
echo "Pool Mining Command:" # echo "Pool Mining Command:"
echo "sudo docker exec -it amd-strix-halo-llama-rocm bash -c \"/mnt/dl/rinhash/cpuminer-opt-rin/cpuminer -a rinhash -o stratum+tcp://rinhash.mine.zergpool.com:7148 -u bc1qjn4m6rmrveuxhk02a5qhe4r6kdcsvvt3vhdn9j -p c=BTC,mc=RIN,ID=StrixHalo -t 32\"" # echo "sudo docker exec -it amd-strix-halo-llama-rocm bash -c \"/mnt/dl/rinhash/cpuminer-opt-rin/cpuminer -a rinhash -o stratum+tcp://rinhash.mine.zergpool.com:7148 -u bc1qjn4m6rmrveuxhk02a5qhe4r6kdcsvvt3vhdn9j -p c=BTC,mc=RIN,ID=StrixHalo -t 32\""
echo "" # echo ""
echo "Your RinCoin address for solo mining: $rin_address" # echo "Your RinCoin address for solo mining: $rin_address"

View File

@@ -1,76 +1,76 @@
#!/bin/bash # #!/bin/bash
# RinCoin Solo Mining via RPC # # RinCoin Solo Mining via RPC
# This script uses RinCoin's RPC interface for solo mining # # This script uses RinCoin's RPC interface for solo mining
echo "=== RinCoin Solo Mining via RPC ===" # echo "=== RinCoin Solo Mining via RPC ==="
echo "" # echo ""
# Configuration # # Configuration
RPC_HOST="127.0.0.1" # RPC_HOST="127.0.0.1"
RPC_PORT="9556" # RPC_PORT="9556"
RPC_USER="rinrpc" # RPC_USER="rinrpc"
RPC_PASS="745ce784d5d537fc06105a1b935b7657903cfc71a5fb3b90" # RPC_PASS="745ce784d5d537fc06105a1b935b7657903cfc71a5fb3b90"
# Function to call RPC # # Function to call RPC
call_rpc() { # call_rpc() {
local method="$1" # local method="$1"
local params="$2" # local params="$2"
curl -s --user "$RPC_USER:$RPC_PASS" \ # curl -s --user "$RPC_USER:$RPC_PASS" \
-H 'content-type: text/plain' \ # -H 'content-type: text/plain' \
--data "{\"jsonrpc\":\"1.0\",\"id\":\"curl\",\"method\":\"$method\",\"params\":$params}" \ # --data "{\"jsonrpc\":\"1.0\",\"id\":\"curl\",\"method\":\"$method\",\"params\":$params}" \
"http://$RPC_HOST:$RPC_PORT/" # "http://$RPC_HOST:$RPC_PORT/"
} # }
# Wait for node to be ready # # Wait for node to be ready
echo "Waiting for RinCoin node to be ready..." # echo "Waiting for RinCoin node to be ready..."
while true; do # while true; do
response=$(call_rpc "getblockchaininfo" "[]") # response=$(call_rpc "getblockchaininfo" "[]")
if [[ $response != *"Loading block index"* ]]; then # if [[ $response != *"Loading block index"* ]]; then
break # break
fi # fi
echo "Node still loading... waiting 10 seconds" # echo "Node still loading... waiting 10 seconds"
sleep 10 # sleep 10
done # done
echo "✅ Node is ready!" # echo "✅ Node is ready!"
echo "" # echo ""
# Get wallet address # # Get wallet address
echo "Getting wallet address..." # echo "Getting wallet address..."
wallet_response=$(call_rpc "getnewaddress" "[]") # wallet_response=$(call_rpc "getnewaddress" "[]")
rin_address=$(echo "$wallet_response" | grep -o '"result":"[^"]*"' | cut -d'"' -f4) # rin_address=$(echo "$wallet_response" | grep -o '"result":"[^"]*"' | cut -d'"' -f4)
if [ -z "$rin_address" ]; then # if [ -z "$rin_address" ]; then
echo "❌ Error: Could not get RinCoin address!" # echo "❌ Error: Could not get RinCoin address!"
echo "Response: $wallet_response" # echo "Response: $wallet_response"
exit 1 # exit 1
fi # fi
echo "✅ RinCoin Address: $rin_address" # echo "✅ RinCoin Address: $rin_address"
echo "" # echo ""
# Get blockchain info # # Get blockchain info
echo "Blockchain Status:" # echo "Blockchain Status:"
blockchain_info=$(call_rpc "getblockchaininfo" "[]") # blockchain_info=$(call_rpc "getblockchaininfo" "[]")
blocks=$(echo "$blockchain_info" | grep -o '"blocks":[^,]*' | cut -d':' -f2) # blocks=$(echo "$blockchain_info" | grep -o '"blocks":[^,]*' | cut -d':' -f2)
headers=$(echo "$blockchain_info" | grep -o '"headers":[^,]*' | cut -d':' -f2) # headers=$(echo "$blockchain_info" | grep -o '"headers":[^,]*' | cut -d':' -f2)
difficulty=$(echo "$blockchain_info" | grep -o '"difficulty":[^,]*' | cut -d':' -f2) # difficulty=$(echo "$blockchain_info" | grep -o '"difficulty":[^,]*' | cut -d':' -f2)
echo "Blocks: $blocks" # echo "Blocks: $blocks"
echo "Headers: $headers" # echo "Headers: $headers"
echo "Difficulty: $difficulty" # echo "Difficulty: $difficulty"
echo "" # echo ""
echo "⚠️ IMPORTANT: RinCoin solo mining requires:" # echo "⚠️ IMPORTANT: RinCoin solo mining requires:"
echo "1. A fully synced node (currently at block $blocks of $headers)" # echo "1. A fully synced node (currently at block $blocks of $headers)"
echo "2. Mining software that supports RinCoin's RPC mining protocol" # echo "2. Mining software that supports RinCoin's RPC mining protocol"
echo "3. Very high hashpower to find blocks solo" # echo "3. Very high hashpower to find blocks solo"
echo "" # echo ""
echo "For now, we recommend pool mining for consistent rewards:" # echo "For now, we recommend pool mining for consistent rewards:"
echo "" # echo ""
echo "Pool Mining Command:" # echo "Pool Mining Command:"
echo "sudo docker exec -it amd-strix-halo-llama-rocm bash -c \"/mnt/dl/rinhash/cpuminer-opt-rin/cpuminer -a rinhash -o stratum+tcp://rinhash.mine.zergpool.com:7148 -u bc1qjn4m6rmrveuxhk02a5qhe4r6kdcsvvt3vhdn9j -p c=BTC,mc=RIN,ID=StrixHalo -t 32\"" # echo "sudo docker exec -it amd-strix-halo-llama-rocm bash -c \"/mnt/dl/rinhash/cpuminer-opt-rin/cpuminer -a rinhash -o stratum+tcp://rinhash.mine.zergpool.com:7148 -u bc1qjn4m6rmrveuxhk02a5qhe4r6kdcsvvt3vhdn9j -p c=BTC,mc=RIN,ID=StrixHalo -t 32\""
echo "" # echo ""
echo "Your RinCoin address for solo mining: $rin_address" # echo "Your RinCoin address for solo mining: $rin_address"

View File

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

View File

@@ -1,68 +1,68 @@
#!/bin/bash # #!/bin/bash
# Start RinCoin Stratum Proxy Server # # Start RinCoin Stratum Proxy Server
# Bridges cpuminer-opt-rin to RinCoin node # # Bridges cpuminer-opt-rin to RinCoin node
echo "=== RinCoin Stratum Proxy Server ===" # echo "=== RinCoin Stratum Proxy Server ==="
echo "" # echo ""
# Check if RinCoin node is running # # Check if RinCoin node is running
if ! sudo docker ps | grep -q "rincoin-node"; then # if ! sudo docker ps | grep -q "rincoin-node"; then
echo "❌ Error: rincoin-node container is not running!" # echo "❌ Error: rincoin-node container is not running!"
echo "Please start it first:" # echo "Please start it first:"
echo "sudo docker start rincoin-node" # echo "sudo docker start rincoin-node"
exit 1 # exit 1
fi # fi
echo "✅ RinCoin node is running" # echo "✅ RinCoin node is running"
# Check if Python3 and requests are available # # Check if Python3 and requests are available
if ! command -v python3 &> /dev/null; then # if ! command -v python3 &> /dev/null; then
echo "❌ Error: python3 is not installed!" # echo "❌ Error: python3 is not installed!"
echo "Please install it: sudo apt-get install python3" # echo "Please install it: sudo apt-get install python3"
exit 1 # exit 1
fi # fi
# Install requests if not available # # Install requests if not available
python3 -c "import requests" 2>/dev/null || { # python3 -c "import requests" 2>/dev/null || {
echo "Installing python3-requests..." # echo "Installing python3-requests..."
sudo apt-get update && sudo apt-get install -y python3-requests # sudo apt-get update && sudo apt-get install -y python3-requests
} # }
echo "✅ Python dependencies ready" # echo "✅ Python dependencies ready"
# Check if port 3334 is already in use # # Check if port 3334 is already in use
if netstat -tln | grep -q ":3334 "; then # if netstat -tln | grep -q ":3334 "; then
echo "" # echo ""
echo "⚠️ Port 3334 is already in use!" # echo "⚠️ Port 3334 is already in use!"
echo "" # echo ""
echo "🔍 Process using port 3334:" # echo "🔍 Process using port 3334:"
sudo netstat -tlnp | grep ":3334 " || echo "Could not determine process" # sudo netstat -tlnp | grep ":3334 " || echo "Could not determine process"
echo "" # echo ""
echo "🛑 To kill existing process:" # echo "🛑 To kill existing process:"
echo "sudo lsof -ti:3334 | xargs sudo kill -9" # echo "sudo lsof -ti:3334 | xargs sudo kill -9"
echo "" # echo ""
read -p "Kill existing process and continue? (y/N): " -n 1 -r # read -p "Kill existing process and continue? (y/N): " -n 1 -r
echo # echo
if [[ $REPLY =~ ^[Yy]$ ]]; then # if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Killing processes using port 3334..." # echo "Killing processes using port 3334..."
sudo lsof -ti:3334 | xargs sudo kill -9 2>/dev/null || echo "No processes to kill" # sudo lsof -ti:3334 | xargs sudo kill -9 2>/dev/null || echo "No processes to kill"
sleep 2 # sleep 2
else # else
echo "Exiting..." # echo "Exiting..."
exit 1 # exit 1
fi # fi
fi # fi
echo "" # echo ""
echo "🚀 Starting Stratum Proxy Server..." # echo "🚀 Starting Stratum Proxy Server..."
echo "" # echo ""
echo "After it starts, connect your miner with:" # 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 "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 ""
echo "Press Ctrl+C to stop the proxy" # echo "Press Ctrl+C to stop the proxy"
echo "" # echo ""
# Start the proxy # # Start the proxy
cd "$(dirname "$0")" # cd "$(dirname "$0")"
python3 stratum_proxy.py --submit-all-blocks # python3 stratum_proxy.py --submit-all-blocks

View File

@@ -1,14 +1,14 @@
#!/bin/bash # #!/bin/bash
set -euo pipefail # set -euo pipefail
SCRIPT_DIR="/mnt/shared/DEV/repos/d-popov.com/scripts/MINE/rin/web_wallet" # SCRIPT_DIR="/mnt/shared/DEV/repos/d-popov.com/scripts/MINE/rin/web_wallet"
if ! command -v python3 >/dev/null 2>&1; then # if ! command -v python3 >/dev/null 2>&1; then
echo "python3 is required" # echo "python3 is required"
exit 1 # exit 1
fi # fi
python3 "${SCRIPT_DIR}/server.py" # python3 "${SCRIPT_DIR}/server.py"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,75 +1,75 @@
#!/bin/bash # #!/bin/bash
# Test Reward Redistribution Logic # # Test Reward Redistribution Logic
echo "=== Testing Reward Redistribution Logic ===" # echo "=== Testing Reward Redistribution Logic ==="
echo "" # echo ""
# Kill any existing processes # # Kill any existing processes
./MINE/rin/kill_stratum_proxy.sh # ./MINE/rin/kill_stratum_proxy.sh
echo "🧪 Testing reward distribution scenarios:" # echo "🧪 Testing reward distribution scenarios:"
echo "" # echo ""
echo "Scenario 1: All miners have valid addresses" # echo "Scenario 1: All miners have valid addresses"
echo "Expected: Normal distribution" # echo "Expected: Normal distribution"
echo "" # echo ""
echo "Scenario 2: Some miners without addresses" # echo "Scenario 2: Some miners without addresses"
echo "Expected: Redistribution of their rewards to miners with addresses" # echo "Expected: Redistribution of their rewards to miners with addresses"
echo "" # echo ""
echo "Scenario 3: All miners without addresses" # echo "Scenario 3: All miners without addresses"
echo "Expected: All rewards go to pool" # echo "Expected: All rewards go to pool"
echo "" # echo ""
echo "🚀 Starting mining pool..." # echo "🚀 Starting mining pool..."
./MINE/rin/start_mining_pool.sh & # ./MINE/rin/start_mining_pool.sh &
POOL_PID=$! # POOL_PID=$!
echo "" # echo ""
echo "⏳ Waiting for pool to start..." # echo "⏳ Waiting for pool to start..."
sleep 5 # sleep 5
echo "" # echo ""
echo "🧪 Test 1: Miner with valid address" # echo "🧪 Test 1: Miner with valid address"
echo "Expected: Gets full share of rewards" # echo "Expected: Gets full share of rewards"
timeout 5s ./cpuminer -a rinhash -o stratum+tcp://127.0.0.1:3333 -u rin1qahvvv9d5f3443wtckeqavwp9950wacxfmwv20q.worker1 -p x -t 1 # timeout 5s ./cpuminer -a rinhash -o stratum+tcp://127.0.0.1:3333 -u rin1qahvvv9d5f3443wtckeqavwp9950wacxfmwv20q.worker1 -p x -t 1
echo "" # echo ""
echo "🧪 Test 2: Miner without address" # echo "🧪 Test 2: Miner without address"
echo "Expected: Contributes to difficulty but gets no direct rewards" # echo "Expected: Contributes to difficulty but gets no direct rewards"
timeout 5s ./cpuminer -a rinhash -o stratum+tcp://127.0.0.1:3333 -u user.worker2 -p x -t 1 # timeout 5s ./cpuminer -a rinhash -o stratum+tcp://127.0.0.1:3333 -u user.worker2 -p x -t 1
echo "" # echo ""
echo "🧪 Test 3: Another miner with valid address" # echo "🧪 Test 3: Another miner with valid address"
echo "Expected: Gets base reward + redistribution from miner without address" # echo "Expected: Gets base reward + redistribution from miner without address"
timeout 5s ./cpuminer -a rinhash -o stratum+tcp://127.0.0.1:3333 -u rin1qahvvv9d5f3443wtckeqavwp9950wacxfmwv20q.worker3 -p x -t 1 # timeout 5s ./cpuminer -a rinhash -o stratum+tcp://127.0.0.1:3333 -u rin1qahvvv9d5f3443wtckeqavwp9950wacxfmwv20q.worker3 -p x -t 1
echo "" # echo ""
echo "📊 Pool Log Analysis:" # echo "📊 Pool Log Analysis:"
echo "Look for these patterns in the logs above:" # echo "Look for these patterns in the logs above:"
echo "1. '💰 Miner rin1q...: X.XX RIN (difficulty)' - Base rewards" # echo "1. '💰 Miner rin1q...: X.XX RIN (difficulty)' - Base rewards"
echo "2. '⚠️ Miner without address: X difficulty -> X.XX RIN to pool' - Undistributed" # echo "2. '⚠️ Miner without address: X difficulty -> X.XX RIN to pool' - Undistributed"
echo "3. '💰 Pool keeps X.XX RIN from miners without addresses' - Pool keeps rewards" # echo "3. '💰 Pool keeps X.XX RIN from miners without addresses' - Pool keeps rewards"
echo "4. '📊 Summary: X miners with addresses, Y without (rewards to pool)' - Final summary" # echo "4. '📊 Summary: X miners with addresses, Y without (rewards to pool)' - Final summary"
echo "" # echo ""
echo "🧹 Cleaning up..." # echo "🧹 Cleaning up..."
kill $POOL_PID 2>/dev/null # kill $POOL_PID 2>/dev/null
./MINE/rin/kill_stratum_proxy.sh # ./MINE/rin/kill_stratum_proxy.sh
echo "" # echo ""
echo "📋 Reward Distribution Logic Summary:" # echo "📋 Reward Distribution Logic Summary:"
echo "" # echo ""
echo "✅ Miners with valid RinCoin addresses:" # echo "✅ Miners with valid RinCoin addresses:"
echo " - Get reward based on their difficulty" # echo " - Get reward based on their difficulty"
echo " - Rewards sent directly to their addresses" # echo " - Rewards sent directly to their addresses"
echo "" # echo ""
echo "⚠️ Miners without addresses:" # echo "⚠️ Miners without addresses:"
echo " - Contribute to total difficulty" # echo " - Contribute to total difficulty"
echo " - Their reward share goes to pool address" # echo " - Their reward share goes to pool address"
echo " - No direct rewards received" # echo " - No direct rewards received"
echo "" # echo ""
echo "💰 Pool fee: Always 1% of total block reward" # echo "💰 Pool fee: Always 1% of total block reward"
echo "💰 Pool bonus: Additional rewards from miners without addresses" # echo "💰 Pool bonus: Additional rewards from miners without addresses"