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

@@ -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"