Skip to content

Commit e666194

Browse files
authored
Update SoloMiner.py
Fix cannot connect to pool
1 parent 08673a1 commit e666194

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

SoloMiner.py

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,18 @@
1717
from tabulate import tabulate
1818
from tqdm import tqdm
1919

20+
#Setting
21+
# Mining Address **Change Me**
22+
address = 'bc1qwp44lvxgrhh42de507kezjspcyh8cvw6tvuykp'
23+
# Mining Pool
24+
pool = "solo.ckpool.org"
25+
port = 3333
26+
2027
sock = None
2128
best_difficulty = 0
2229
best_hash = None
2330
# Initialize difficulty outside the loop
24-
difficulty = 0
31+
difficulty = 16
2532

2633
# Initialize best share difficulty and hash
2734
best_share_difficulty = float('inf')
@@ -92,9 +99,8 @@ def block_found_splash(ascii_art):
9299
def timer():
93100
return datetime.now().time()
94101

95-
## Mining Address **Change Me**
96-
address = 'bc1qwp44lvxgrhh42de507kezjspcyh8cvw6tvuykp'
97-
print(Back.BLUE, Fore.WHITE, 'SOLO ADDRESS:', Fore.GREEN, str(address), Style.RESET_ALL)
102+
print(Back.BLUE, Fore.WHITE, 'BTC ADDRESS:', Fore.GREEN, str(address), Style.RESET_ALL)
103+
print(Back.BLUE, Fore.WHITE, 'Donate BTC to HCMLXOX?:', Fore.GREEN, "bc1qnk0ftxa4ep296phhnxl5lv9c2s5f8xakpcxmth", Style.RESET_ALL)
98104

99105
def handler(signal_received, frame):
100106
ctx.fShutdown = True
@@ -178,7 +184,7 @@ def try_exit(self):
178184
## it will set the miner thread to be running, call the mining method on the miner thread, and set the miner thread to be not running.
179185
## If an exception occurs, it is logged and the traceback is printed, and the loop breaks.
180186
# Initialize best difficulty outside the loop
181-
best_difficulty = 0 # Add this line to initialize best_difficulty
187+
best_difficulty = 16 # Add this line to initialize best_difficulty
182188

183189
def bitcoin_miner(t, restarted=False):
184190
global best_share_difficulty, best_share_hash
@@ -193,7 +199,7 @@ def bitcoin_miner(t, restarted=False):
193199
share_difficulty = 0
194200

195201
# Initialize difficulty outside the loop
196-
difficulty = 0
202+
difficulty = 16
197203

198204
# Initialize best difficulty
199205
best_difficulty = 0 # Add this line to initialize best_difficulty
@@ -434,7 +440,7 @@ def log_metrics(start_time, nonce, hashes_computed, best_difficulty, best_hash):
434440
def block_listener(t) :
435441
# init a connection to ckpool
436442
sock = socket.socket(socket.AF_INET , socket.SOCK_STREAM)
437-
sock.connect(('solo.ckpool.org' , 3333))
443+
sock.connect((pool , port))
438444
# send a handle subscribe message
439445
sock.sendall(b'{"id": 1, "method": "mining.subscribe", "params": []}\n')
440446
lines = sock.recv(1024).decode().split('\n')
@@ -561,17 +567,16 @@ def thread_new_block(self , arg) :
561567
def StartMining() :
562568
subscribe_t = NewSubscribeThread(None)
563569
subscribe_t.start()
570+
logg("[*]£££ Bitcoin Solo Miner Started £££")
571+
print(Fore.BLUE , '--------------~~( ' , Fore.GREEN , 'SOLO MINER STARTED' , Fore.BLUE , ' )~~--------------')
572+
print(Fore.BLUE , '--------------~~( ' , Fore.YELLOW , 'IN SATOSHI WE TRUST' , Fore.BLUE , ' )~~--------------')
573+
print(Fore.BLUE , '--------------~~( ' , Fore.GREEN , 'DO NOT TRUST VERIFY' , Fore.BLUE , ' )~~--------------')
574+
time.sleep(2)
564575
logg("[*] Subscribe thread started.")
565576
print(Fore.MAGENTA , "[" , timer() , "]" , Fore.GREEN , "[*] Subscribe thread started.")
566-
567-
time.sleep(1)
568-
569577
miner_t = CoinMinerThread(None)
570578
miner_t.start()
571-
logg("[*]£££ Bitcoin Solo Miner Started £££")
572-
print(Fore.MAGENTA , "[" , timer() , '(', Fore.GREEN , 'SOLO MINER STARTED' , Fore.BLUE , ' )~~--------------')
573-
print(Fore.BLUE , '--------------~~( ' , Fore.YELLOW , 'IN SATOSHI WE TRUST' , Fore.BLUE , ' )~~--------------')
574-
print(Fore.BLUE , '--------------~~( ' , Fore.GREEN , 'DO NOT TRUST VERIFY' , Fore.BLUE , ' )~~--------------')
579+
time.sleep(1)
575580

576581

577582
if __name__ == '__main__':

0 commit comments

Comments
 (0)