From 353b8120c871d6ffe09b61f8bf134f737d96f6df Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Tue, 23 Sep 2025 20:37:12 +0300 Subject: [PATCH] net hashrate log --- MINE/rin/start_stratum_proxy.sh | 2 +- MINE/rin/stratum_proxy.py | 37 ++++++++++++++++++++++++++------- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/MINE/rin/start_stratum_proxy.sh b/MINE/rin/start_stratum_proxy.sh index 4bf852c..0d9c82f 100644 --- a/MINE/rin/start_stratum_proxy.sh +++ b/MINE/rin/start_stratum_proxy.sh @@ -65,4 +65,4 @@ echo "" # Start the proxy cd "$(dirname "$0")" -python3 stratum_proxy.py +python3 stratum_proxy.py --submit-all-blocks diff --git a/MINE/rin/stratum_proxy.py b/MINE/rin/stratum_proxy.py index c47fb9e..ca9cc3e 100644 --- a/MINE/rin/stratum_proxy.py +++ b/MINE/rin/stratum_proxy.py @@ -608,10 +608,27 @@ class RinCoinStratumProxy: else: progress_icon = "๐Ÿ“Š" # Low progress + # Calculate network and pool hashrates + block_time = 60 # RinCoin 1-minute blocks + network_hashrate = (network_difficulty * (2**32)) / block_time + network_mhs = network_hashrate / 1e6 + + # Calculate pool hashrate (sum of all connected miners) + pool_hashrate = 0 + for client_addr, client_data in self.clients.items(): + pool_hashrate += client_data.get('estimated_hashrate', 0) + pool_mhs = pool_hashrate / 1e6 + + # Calculate percentages + pool_network_percentage = (pool_mhs / network_mhs) * 100 if network_mhs > 0 else 0 + miner_pool_percentage = (0.87 / pool_mhs) * 100 if pool_mhs > 0 else 0 # Assuming 870kH/s miner + print(f"[{timestamp}] {progress_icon} SHARE: job={job['job_id']} | nonce={nonce} | hash={block_hash_hex[:16]}...") print(f" ๐ŸŽฏ Share Diff: {share_difficulty:.2e} | Stratum Diff: {client_stratum_diff:.6f} | Network Diff: {network_difficulty:.6f}") print(f" ๐Ÿ“ˆ Progress: {network_percentage:.4f}% of network, {stratum_percentage:.1f}% of stratum") print(f" ๐Ÿ“Š Share Rate: {self.stats['current_share_rate']:.2f}/s | Total: {len(self.stats['shares_last_minute'])}/min") + print(f" ๐ŸŒ Network: {network_mhs:.1f} MH/s | Pool: {pool_mhs:.1f} MH/s ({pool_network_percentage:.2f}% of network)") + print(f" โ›๏ธ Miner: 0.87 MH/s ({miner_pool_percentage:.1f}% of pool) | Expected solo: {network_mhs/0.87:.0f}h") print(f" ๐Ÿ“ Target: {job['target'][:16]}... | Height: {job['height']}") print(f" โฐ Time: {ntime} | Extranonce: {extranonce1}:{extranonce2}") print(f" ๐Ÿ” Difficulty Check: Share {share_difficulty:.2e} vs Stratum {client_stratum_diff:.6f} = {'โœ…' if meets_stratum_difficulty else 'โŒ'}") @@ -693,18 +710,22 @@ class RinCoinStratumProxy: if should_submit: if submit_network_difficulty: print(f" ๐ŸŽ‰ VALID BLOCK FOUND! Hash: {block_hash_hex}") + print(f" ๐Ÿ’ฐ Reward: {job['coinbasevalue']/100000000:.2f} RIN -> {address}") + print(f" ๐Ÿ“Š Block height: {job['height']}") + print(f" ๐Ÿ” Difficulty: {share_difficulty:.6f} (target: {network_difficulty:.6f})") + print(f" ๐Ÿ“‹ Submit reason: {submit_reason}") + + # Log the found hash - ONLY for actual network-valid blocks + reward_rin = job['coinbasevalue'] / 100000000 + self.log_hash_found(block_hash_hex, share_difficulty, job['height'], reward_rin, nonce, ntime) elif submit_debug_threshold: print(f" ๐Ÿงช DEBUG SUBMISSION! Hash: {block_hash_hex} ({submit_reason})") + print(f" ๐Ÿ“Š Block height: {job['height']} | Difficulty: {share_difficulty:.6f}") + print(f" ๐Ÿ’ก This is a test submission - not a real block") else: print(f" ๐Ÿงช TEST BLOCK SUBMISSION! Hash: {block_hash_hex} (submit_all_blocks=True)") - print(f" ๐Ÿ’ฐ Reward: {job['coinbasevalue']/100000000:.2f} RIN -> {address}") - print(f" ๐Ÿ“Š Block height: {job['height']}") - print(f" ๐Ÿ” Difficulty: {share_difficulty:.6f} (target: {network_difficulty:.6f})") - print(f" ๐Ÿ“‹ Submit reason: {submit_reason}") - - # Log the found hash - reward_rin = job['coinbasevalue'] / 100000000 - self.log_hash_found(block_hash_hex, share_difficulty, job['height'], reward_rin, nonce, ntime) + print(f" ๐Ÿ“Š Block height: {job['height']} | Difficulty: {share_difficulty:.6f}") + print(f" ๐Ÿ’ก This is a test submission - not a real block") # Build complete block block = header