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 rin1qahvvv9d5f3443wtckeqavwp9950wacxfmwv20q -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

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 ""
# echo "=== Killing RinCoin Stratum Proxy ==="
# echo ""
# Find and kill Python processes running stratum_proxy.py
PIDS=$(ps aux | grep "stratum_proxy.py" | grep -v grep | awk '{print $2}')
# # Find and kill Python processes running stratum_proxy.py
# PIDS=$(ps aux | grep "stratum_proxy.py" | grep -v grep | awk '{print $2}')
if [ -n "$PIDS" ]; then
echo "Found Stratum Proxy processes: $PIDS"
echo "Killing processes..."
for pid in $PIDS; do
kill -9 "$pid" 2>/dev/null && echo "Killed PID: $pid" || echo "Failed to kill PID: $pid"
done
else
echo "No Stratum Proxy processes found"
fi
# if [ -n "$PIDS" ]; then
# echo "Found Stratum Proxy processes: $PIDS"
# echo "Killing processes..."
# for pid in $PIDS; do
# kill -9 "$pid" 2>/dev/null && echo "Killed PID: $pid" || echo "Failed to kill PID: $pid"
# done
# else
# echo "No Stratum Proxy processes found"
# fi
# Also kill any process using port 3333
echo ""
echo "Checking port 3333..."
PORT_PIDS=$(sudo lsof -ti:3333 2>/dev/null)
# # Also kill any process using port 3333
# echo ""
# echo "Checking port 3333..."
# PORT_PIDS=$(sudo lsof -ti:3333 2>/dev/null)
if [ -n "$PORT_PIDS" ]; then
echo "Found processes using port 3333: $PORT_PIDS"
echo "Killing processes..."
for pid in $PORT_PIDS; do
sudo kill -9 "$pid" 2>/dev/null && echo "Killed PID: $pid" || echo "Failed to kill PID: $pid"
done
else
echo "No processes using port 3333"
fi
# if [ -n "$PORT_PIDS" ]; then
# echo "Found processes using port 3333: $PORT_PIDS"
# echo "Killing processes..."
# for pid in $PORT_PIDS; do
# sudo kill -9 "$pid" 2>/dev/null && echo "Killed PID: $pid" || echo "Failed to kill PID: $pid"
# done
# else
# echo "No processes using port 3333"
# fi
echo ""
echo "✅ Cleanup complete!"
echo ""
echo "Port 3333 status:"
netstat -tln | grep ":3333 " || echo "Port 3333 is free"
# echo ""
# echo "✅ Cleanup complete!"
# echo ""
# echo "Port 3333 status:"
# 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 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
# Uses local RinCoin node for solo mining
# # Solo Mining Script for RinCoin
# # Uses local RinCoin node for solo mining
echo "=== RinCoin Solo Mining Setup ==="
echo ""
# echo "=== RinCoin Solo Mining Setup ==="
# echo ""
# Check if rincoin-node container 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
# # Check if rincoin-node container 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
# Get wallet address
RIN_ADDRESS=$(sudo docker exec rincoin-node rincoin-cli -datadir=/data -conf=/data/rincoin.conf -rpcwallet=main getnewaddress 2>/dev/null)
# # Get wallet address
# 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
echo "Error: Could not get RinCoin address!"
echo "Make sure the wallet is created and the node is synced."
exit 1
fi
# if [ -z "$RIN_ADDRESS" ]; then
# echo "Error: Could not get RinCoin address!"
# echo "Make sure the wallet is created and the node is synced."
# exit 1
# fi
echo "RinCoin Address: $RIN_ADDRESS"
echo ""
# echo "RinCoin Address: $RIN_ADDRESS"
# echo ""
# 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)
# # 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)
if [ "$SYNC_STATUS" = "true" ]; then
echo "⚠️ WARNING: Node is still syncing (initialblockdownload: true)"
echo "Solo mining may not work properly until sync is complete."
echo ""
fi
# if [ "$SYNC_STATUS" = "true" ]; then
# echo "⚠️ WARNING: Node is still syncing (initialblockdownload: true)"
# echo "Solo mining may not work properly until sync is complete."
# echo ""
# fi
echo "Starting solo mining with cpuminer-opt-rin..."
echo "Algorithm: rinhash"
echo "Target: Local RinCoin node (127.0.0.1:9555)"
echo "Wallet: $RIN_ADDRESS"
echo ""
echo "Press Ctrl+C to stop mining"
echo ""
# echo "Starting solo mining with cpuminer-opt-rin..."
# echo "Algorithm: rinhash"
# echo "Target: Local RinCoin node (127.0.0.1:9555)"
# echo "Wallet: $RIN_ADDRESS"
# echo ""
# echo "Press Ctrl+C to stop mining"
# echo ""
# 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"
# # 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"

View File

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

View File

@@ -1,81 +1,81 @@
#!/bin/bash
# #!/bin/bash
# Remote Solo Mining Script for RinCoin
# Connects to RinCoin node over network/RPC
# # Remote Solo Mining Script for RinCoin
# # Connects to RinCoin node over network/RPC
# Configuration
RPC_HOST="127.0.0.1" # Change to your server IP for remote access
RPC_PORT="9556"
RPC_USER="rinrpc"
RPC_PASS="745ce784d5d537fc06105a1b935b7657903cfc71a5fb3b90"
# # Configuration
# RPC_HOST="127.0.0.1" # Change to your server IP for remote access
# RPC_PORT="9556"
# RPC_USER="rinrpc"
# RPC_PASS="745ce784d5d537fc06105a1b935b7657903cfc71a5fb3b90"
echo "=== Remote RinCoin Solo Mining Setup ==="
echo "RPC Host: $RPC_HOST:$RPC_PORT"
echo ""
# echo "=== Remote RinCoin Solo Mining Setup ==="
# echo "RPC Host: $RPC_HOST:$RPC_PORT"
# echo ""
# Test RPC connection
echo "Testing RPC connection..."
RPC_RESPONSE=$(curl -s --user "$RPC_USER:$RPC_PASS" \
-H 'content-type: text/plain' \
--data '{"jsonrpc":"1.0","id":"curl","method":"getblockchaininfo","params":[]}' \
"http://$RPC_HOST:$RPC_PORT/")
# # Test RPC connection
# echo "Testing RPC connection..."
# RPC_RESPONSE=$(curl -s --user "$RPC_USER:$RPC_PASS" \
# -H 'content-type: text/plain' \
# --data '{"jsonrpc":"1.0","id":"curl","method":"getblockchaininfo","params":[]}' \
# "http://$RPC_HOST:$RPC_PORT/")
if [[ $RPC_RESPONSE == *"error"* ]]; then
echo "❌ Error: Could not connect to RinCoin RPC!"
echo "Response: $RPC_RESPONSE"
echo ""
echo "Check:"
echo "1. RinCoin node is running"
echo "2. RPC port $RPC_PORT is accessible"
echo "3. Firewall allows connections to port $RPC_PORT"
exit 1
fi
# if [[ $RPC_RESPONSE == *"error"* ]]; then
# echo "❌ Error: Could not connect to RinCoin RPC!"
# echo "Response: $RPC_RESPONSE"
# echo ""
# echo "Check:"
# echo "1. RinCoin node is running"
# echo "2. RPC port $RPC_PORT is accessible"
# echo "3. Firewall allows connections to port $RPC_PORT"
# exit 1
# fi
echo "✅ RPC connection successful!"
echo ""
# echo "✅ RPC connection successful!"
# echo ""
# Get wallet address via RPC
echo "Getting wallet address..."
WALLET_RESPONSE=$(curl -s --user "$RPC_USER:$RPC_PASS" \
-H 'content-type: text/plain' \
--data '{"jsonrpc":"1.0","id":"curl","method":"getnewaddress","params":[]}' \
"http://$RPC_HOST:$RPC_PORT/")
# # Get wallet address via RPC
# echo "Getting wallet address..."
# WALLET_RESPONSE=$(curl -s --user "$RPC_USER:$RPC_PASS" \
# -H 'content-type: text/plain' \
# --data '{"jsonrpc":"1.0","id":"curl","method":"getnewaddress","params":[]}' \
# "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
echo "❌ Error: Could not get RinCoin address!"
echo "Response: $WALLET_RESPONSE"
echo ""
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/"
exit 1
fi
# if [ -z "$RIN_ADDRESS" ]; then
# echo "❌ Error: Could not get RinCoin address!"
# echo "Response: $WALLET_RESPONSE"
# echo ""
# 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/"
# exit 1
# fi
echo "✅ RinCoin Address: $RIN_ADDRESS"
echo ""
# echo "✅ RinCoin Address: $RIN_ADDRESS"
# echo ""
# Check node sync status
SYNC_RESPONSE=$(curl -s --user "$RPC_USER:$RPC_PASS" \
-H 'content-type: text/plain' \
--data '{"jsonrpc":"1.0","id":"curl","method":"getblockchaininfo","params":[]}' \
"http://$RPC_HOST:$RPC_PORT/")
# # Check node sync status
# SYNC_RESPONSE=$(curl -s --user "$RPC_USER:$RPC_PASS" \
# -H 'content-type: text/plain' \
# --data '{"jsonrpc":"1.0","id":"curl","method":"getblockchaininfo","params":[]}' \
# "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
echo "⚠️ WARNING: Node is still syncing (initialblockdownload: true)"
echo "Solo mining may not work properly until sync is complete."
echo ""
fi
# if [ "$SYNC_STATUS" = "true" ]; then
# echo "⚠️ WARNING: Node is still syncing (initialblockdownload: true)"
# echo "Solo mining may not work properly until sync is complete."
# echo ""
# fi
echo "Starting remote solo mining with cpuminer-opt-rin..."
echo "Algorithm: rinhash"
echo "Target: RinCoin node at $RPC_HOST:9555"
echo "Wallet: $RIN_ADDRESS"
echo ""
echo "Press Ctrl+C to stop mining"
echo ""
# echo "Starting remote solo mining with cpuminer-opt-rin..."
# echo "Algorithm: rinhash"
# echo "Target: RinCoin node at $RPC_HOST:9555"
# echo "Wallet: $RIN_ADDRESS"
# echo ""
# echo "Press Ctrl+C to stop mining"
# echo ""
# 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"
# # 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"

View File

@@ -1,76 +1,76 @@
#!/bin/bash
# #!/bin/bash
# RinCoin Solo Mining via RPC
# This script uses RinCoin's RPC interface for solo mining
# # RinCoin Solo Mining via RPC
# # This script uses RinCoin's RPC interface for solo mining
echo "=== RinCoin Solo Mining via RPC ==="
echo ""
# echo "=== RinCoin Solo Mining via RPC ==="
# echo ""
# Configuration
RPC_HOST="127.0.0.1"
RPC_PORT="9556"
RPC_USER="rinrpc"
RPC_PASS="745ce784d5d537fc06105a1b935b7657903cfc71a5fb3b90"
# # Configuration
# RPC_HOST="127.0.0.1"
# RPC_PORT="9556"
# RPC_USER="rinrpc"
# RPC_PASS="745ce784d5d537fc06105a1b935b7657903cfc71a5fb3b90"
# Function to call RPC
call_rpc() {
local method="$1"
local params="$2"
# # Function to call RPC
# call_rpc() {
# local method="$1"
# local params="$2"
curl -s --user "$RPC_USER:$RPC_PASS" \
-H 'content-type: text/plain' \
--data "{\"jsonrpc\":\"1.0\",\"id\":\"curl\",\"method\":\"$method\",\"params\":$params}" \
"http://$RPC_HOST:$RPC_PORT/"
}
# curl -s --user "$RPC_USER:$RPC_PASS" \
# -H 'content-type: text/plain' \
# --data "{\"jsonrpc\":\"1.0\",\"id\":\"curl\",\"method\":\"$method\",\"params\":$params}" \
# "http://$RPC_HOST:$RPC_PORT/"
# }
# Wait for node to be ready
echo "Waiting for RinCoin node to be ready..."
while true; do
response=$(call_rpc "getblockchaininfo" "[]")
if [[ $response != *"Loading block index"* ]]; then
break
fi
echo "Node still loading... waiting 10 seconds"
sleep 10
done
# # Wait for node to be ready
# echo "Waiting for RinCoin node to be ready..."
# while true; do
# response=$(call_rpc "getblockchaininfo" "[]")
# if [[ $response != *"Loading block index"* ]]; then
# break
# fi
# echo "Node still loading... waiting 10 seconds"
# sleep 10
# done
echo "✅ Node is ready!"
echo ""
# echo "✅ Node is ready!"
# echo ""
# Get wallet address
echo "Getting wallet address..."
wallet_response=$(call_rpc "getnewaddress" "[]")
rin_address=$(echo "$wallet_response" | grep -o '"result":"[^"]*"' | cut -d'"' -f4)
# # Get wallet address
# echo "Getting wallet address..."
# wallet_response=$(call_rpc "getnewaddress" "[]")
# rin_address=$(echo "$wallet_response" | grep -o '"result":"[^"]*"' | cut -d'"' -f4)
if [ -z "$rin_address" ]; then
echo "❌ Error: Could not get RinCoin address!"
echo "Response: $wallet_response"
exit 1
fi
# if [ -z "$rin_address" ]; then
# echo "❌ Error: Could not get RinCoin address!"
# echo "Response: $wallet_response"
# exit 1
# fi
echo "✅ RinCoin Address: $rin_address"
echo ""
# echo "✅ RinCoin Address: $rin_address"
# echo ""
# Get blockchain info
echo "Blockchain Status:"
blockchain_info=$(call_rpc "getblockchaininfo" "[]")
blocks=$(echo "$blockchain_info" | grep -o '"blocks":[^,]*' | cut -d':' -f2)
headers=$(echo "$blockchain_info" | grep -o '"headers":[^,]*' | cut -d':' -f2)
difficulty=$(echo "$blockchain_info" | grep -o '"difficulty":[^,]*' | cut -d':' -f2)
# # Get blockchain info
# echo "Blockchain Status:"
# blockchain_info=$(call_rpc "getblockchaininfo" "[]")
# blocks=$(echo "$blockchain_info" | grep -o '"blocks":[^,]*' | cut -d':' -f2)
# headers=$(echo "$blockchain_info" | grep -o '"headers":[^,]*' | cut -d':' -f2)
# difficulty=$(echo "$blockchain_info" | grep -o '"difficulty":[^,]*' | cut -d':' -f2)
echo "Blocks: $blocks"
echo "Headers: $headers"
echo "Difficulty: $difficulty"
echo ""
# echo "Blocks: $blocks"
# echo "Headers: $headers"
# echo "Difficulty: $difficulty"
# echo ""
echo "⚠️ IMPORTANT: RinCoin solo mining requires:"
echo "1. A fully synced node (currently at block $blocks of $headers)"
echo "2. Mining software that supports RinCoin's RPC mining protocol"
echo "3. Very high hashpower to find blocks solo"
echo ""
echo "For now, we recommend pool mining for consistent rewards:"
echo ""
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 ""
echo "Your RinCoin address for solo mining: $rin_address"
# echo "⚠️ IMPORTANT: RinCoin solo mining requires:"
# echo "1. A fully synced node (currently at block $blocks of $headers)"
# echo "2. Mining software that supports RinCoin's RPC mining protocol"
# echo "3. Very high hashpower to find blocks solo"
# echo ""
# echo "For now, we recommend pool mining for consistent rewards:"
# echo ""
# 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 ""
# echo "Your RinCoin address for solo mining: $rin_address"

View File

@@ -1,76 +1,76 @@
#!/bin/bash
# #!/bin/bash
# RinCoin Solo Mining via RPC
# This script uses RinCoin's RPC interface for solo mining
# # RinCoin Solo Mining via RPC
# # This script uses RinCoin's RPC interface for solo mining
echo "=== RinCoin Solo Mining via RPC ==="
echo ""
# echo "=== RinCoin Solo Mining via RPC ==="
# echo ""
# Configuration
RPC_HOST="127.0.0.1"
RPC_PORT="9556"
RPC_USER="rinrpc"
RPC_PASS="745ce784d5d537fc06105a1b935b7657903cfc71a5fb3b90"
# # Configuration
# RPC_HOST="127.0.0.1"
# RPC_PORT="9556"
# RPC_USER="rinrpc"
# RPC_PASS="745ce784d5d537fc06105a1b935b7657903cfc71a5fb3b90"
# Function to call RPC
call_rpc() {
local method="$1"
local params="$2"
# # Function to call RPC
# call_rpc() {
# local method="$1"
# local params="$2"
curl -s --user "$RPC_USER:$RPC_PASS" \
-H 'content-type: text/plain' \
--data "{\"jsonrpc\":\"1.0\",\"id\":\"curl\",\"method\":\"$method\",\"params\":$params}" \
"http://$RPC_HOST:$RPC_PORT/"
}
# curl -s --user "$RPC_USER:$RPC_PASS" \
# -H 'content-type: text/plain' \
# --data "{\"jsonrpc\":\"1.0\",\"id\":\"curl\",\"method\":\"$method\",\"params\":$params}" \
# "http://$RPC_HOST:$RPC_PORT/"
# }
# Wait for node to be ready
echo "Waiting for RinCoin node to be ready..."
while true; do
response=$(call_rpc "getblockchaininfo" "[]")
if [[ $response != *"Loading block index"* ]]; then
break
fi
echo "Node still loading... waiting 10 seconds"
sleep 10
done
# # Wait for node to be ready
# echo "Waiting for RinCoin node to be ready..."
# while true; do
# response=$(call_rpc "getblockchaininfo" "[]")
# if [[ $response != *"Loading block index"* ]]; then
# break
# fi
# echo "Node still loading... waiting 10 seconds"
# sleep 10
# done
echo "✅ Node is ready!"
echo ""
# echo "✅ Node is ready!"
# echo ""
# Get wallet address
echo "Getting wallet address..."
wallet_response=$(call_rpc "getnewaddress" "[]")
rin_address=$(echo "$wallet_response" | grep -o '"result":"[^"]*"' | cut -d'"' -f4)
# # Get wallet address
# echo "Getting wallet address..."
# wallet_response=$(call_rpc "getnewaddress" "[]")
# rin_address=$(echo "$wallet_response" | grep -o '"result":"[^"]*"' | cut -d'"' -f4)
if [ -z "$rin_address" ]; then
echo "❌ Error: Could not get RinCoin address!"
echo "Response: $wallet_response"
exit 1
fi
# if [ -z "$rin_address" ]; then
# echo "❌ Error: Could not get RinCoin address!"
# echo "Response: $wallet_response"
# exit 1
# fi
echo "✅ RinCoin Address: $rin_address"
echo ""
# echo "✅ RinCoin Address: $rin_address"
# echo ""
# Get blockchain info
echo "Blockchain Status:"
blockchain_info=$(call_rpc "getblockchaininfo" "[]")
blocks=$(echo "$blockchain_info" | grep -o '"blocks":[^,]*' | cut -d':' -f2)
headers=$(echo "$blockchain_info" | grep -o '"headers":[^,]*' | cut -d':' -f2)
difficulty=$(echo "$blockchain_info" | grep -o '"difficulty":[^,]*' | cut -d':' -f2)
# # Get blockchain info
# echo "Blockchain Status:"
# blockchain_info=$(call_rpc "getblockchaininfo" "[]")
# blocks=$(echo "$blockchain_info" | grep -o '"blocks":[^,]*' | cut -d':' -f2)
# headers=$(echo "$blockchain_info" | grep -o '"headers":[^,]*' | cut -d':' -f2)
# difficulty=$(echo "$blockchain_info" | grep -o '"difficulty":[^,]*' | cut -d':' -f2)
echo "Blocks: $blocks"
echo "Headers: $headers"
echo "Difficulty: $difficulty"
echo ""
# echo "Blocks: $blocks"
# echo "Headers: $headers"
# echo "Difficulty: $difficulty"
# echo ""
echo "⚠️ IMPORTANT: RinCoin solo mining requires:"
echo "1. A fully synced node (currently at block $blocks of $headers)"
echo "2. Mining software that supports RinCoin's RPC mining protocol"
echo "3. Very high hashpower to find blocks solo"
echo ""
echo "For now, we recommend pool mining for consistent rewards:"
echo ""
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 ""
echo "Your RinCoin address for solo mining: $rin_address"
# echo "⚠️ IMPORTANT: RinCoin solo mining requires:"
# echo "1. A fully synced node (currently at block $blocks of $headers)"
# echo "2. Mining software that supports RinCoin's RPC mining protocol"
# echo "3. Very high hashpower to find blocks solo"
# echo ""
# echo "For now, we recommend pool mining for consistent rewards:"
# echo ""
# 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 ""
# 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
# Distributes block rewards among multiple miners
# # RinCoin Mining Pool Server Startup Script
# # Distributes block rewards among multiple miners
echo "=== RinCoin Mining Pool Server ==="
echo ""
# 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
# # 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"
# 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
}
# # 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"
# 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
# # 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 ""
# 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"
# 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
# # Start the mining pool
# python3 MINE/rin/stratum_pool.py

View File

@@ -1,68 +1,68 @@
#!/bin/bash
# #!/bin/bash
# Start RinCoin Stratum Proxy Server
# Bridges cpuminer-opt-rin to RinCoin node
# # Start RinCoin Stratum Proxy Server
# # Bridges cpuminer-opt-rin to RinCoin node
echo "=== RinCoin Stratum Proxy Server ==="
echo ""
# echo "=== RinCoin Stratum Proxy Server ==="
# 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
# # 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"
# 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
# # 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
}
# # 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"
# 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
# # 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 Stratum Proxy Server..."
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 ""
# echo ""
# echo "🚀 Starting Stratum Proxy Server..."
# 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 proxy
cd "$(dirname "$0")"
python3 stratum_proxy.py --submit-all-blocks
# # Start the proxy
# cd "$(dirname "$0")"
# 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
echo "python3 is required"
exit 1
fi
# if ! command -v python3 >/dev/null 2>&1; then
# echo "python3 is required"
# exit 1
# 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 ""
# echo "=== Testing Reward Redistribution Logic ==="
# echo ""
# Kill any existing processes
./MINE/rin/kill_stratum_proxy.sh
# # Kill any existing processes
# ./MINE/rin/kill_stratum_proxy.sh
echo "🧪 Testing reward distribution scenarios:"
echo ""
# echo "🧪 Testing reward distribution scenarios:"
# echo ""
echo "Scenario 1: All miners have valid addresses"
echo "Expected: Normal distribution"
echo ""
# echo "Scenario 1: All miners have valid addresses"
# echo "Expected: Normal distribution"
# echo ""
echo "Scenario 2: Some miners without addresses"
echo "Expected: Redistribution of their rewards to miners with addresses"
echo ""
# echo "Scenario 2: Some miners without addresses"
# echo "Expected: Redistribution of their rewards to miners with addresses"
# echo ""
echo "Scenario 3: All miners without addresses"
echo "Expected: All rewards go to pool"
echo ""
# echo "Scenario 3: All miners without addresses"
# echo "Expected: All rewards go to pool"
# echo ""
echo "🚀 Starting mining pool..."
./MINE/rin/start_mining_pool.sh &
POOL_PID=$!
# echo "🚀 Starting mining pool..."
# ./MINE/rin/start_mining_pool.sh &
# POOL_PID=$!
echo ""
echo "⏳ Waiting for pool to start..."
sleep 5
# echo ""
# echo "⏳ Waiting for pool to start..."
# sleep 5
echo ""
echo "🧪 Test 1: Miner with valid address"
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
# echo ""
# echo "🧪 Test 1: Miner with valid address"
# 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
echo ""
echo "🧪 Test 2: Miner without address"
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
# echo ""
# echo "🧪 Test 2: Miner without address"
# 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
echo ""
echo "🧪 Test 3: Another miner with valid 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
# echo ""
# echo "🧪 Test 3: Another miner with valid 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
echo ""
echo "📊 Pool Log Analysis:"
echo "Look for these patterns in the logs above:"
echo "1. '💰 Miner rin1q...: X.XX RIN (difficulty)' - Base rewards"
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 "4. '📊 Summary: X miners with addresses, Y without (rewards to pool)' - Final summary"
# echo ""
# echo "📊 Pool Log Analysis:"
# echo "Look for these patterns in the logs above:"
# echo "1. '💰 Miner rin1q...: X.XX RIN (difficulty)' - Base rewards"
# 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 "4. '📊 Summary: X miners with addresses, Y without (rewards to pool)' - Final summary"
echo ""
echo "🧹 Cleaning up..."
kill $POOL_PID 2>/dev/null
./MINE/rin/kill_stratum_proxy.sh
# echo ""
# echo "🧹 Cleaning up..."
# kill $POOL_PID 2>/dev/null
# ./MINE/rin/kill_stratum_proxy.sh
echo ""
echo "📋 Reward Distribution Logic Summary:"
echo ""
echo "✅ Miners with valid RinCoin addresses:"
echo " - Get reward based on their difficulty"
echo " - Rewards sent directly to their addresses"
echo ""
echo "⚠️ Miners without addresses:"
echo " - Contribute to total difficulty"
echo " - Their reward share goes to pool address"
echo " - No direct rewards received"
echo ""
echo "💰 Pool fee: Always 1% of total block reward"
echo "💰 Pool bonus: Additional rewards from miners without addresses"
# echo ""
# echo "📋 Reward Distribution Logic Summary:"
# echo ""
# echo "✅ Miners with valid RinCoin addresses:"
# echo " - Get reward based on their difficulty"
# echo " - Rewards sent directly to their addresses"
# echo ""
# echo "⚠️ Miners without addresses:"
# echo " - Contribute to total difficulty"
# echo " - Their reward share goes to pool address"
# echo " - No direct rewards received"
# echo ""
# echo "💰 Pool fee: Always 1% of total block reward"
# echo "💰 Pool bonus: Additional rewards from miners without addresses"