Spaces:
Starting on Zero
Starting on Zero
Commit Β·
0b7adb3
1
Parent(s): d0e2893
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,10 +14,7 @@ from web3 import Web3
|
|
| 14 |
# ============================================================
|
| 15 |
CSV_FILE = "14262022_addresses.csv"
|
| 16 |
|
| 17 |
-
|
| 18 |
-
MY_TEST_PHRASE = "lesson cushion crane affair federal decline limb spend reunion chief cart zebra"
|
| 19 |
-
|
| 20 |
-
NUM_PHRASES = 5000
|
| 21 |
SCAN_MODE = "File"
|
| 22 |
ACC_START = 0
|
| 23 |
ACC_END = 29
|
|
@@ -26,7 +23,7 @@ ADDR_END = 29
|
|
| 26 |
SHOW_ALL = False
|
| 27 |
PASSPHRASE = ""
|
| 28 |
|
| 29 |
-
# β
Your system has 192 logical cores.
|
| 30 |
NUM_WORKERS = 192
|
| 31 |
# ============================================================
|
| 32 |
|
|
@@ -96,7 +93,7 @@ def phrase_to_seed(phrase, passphrase=""):
|
|
| 96 |
return _get_mnemonic().to_seed(phrase, passphrase=passphrase)
|
| 97 |
|
| 98 |
# ============================================================
|
| 99 |
-
# Worker Function (
|
| 100 |
# ============================================================
|
| 101 |
def process_phrase_worker(phrase):
|
| 102 |
global KNOWN_ADDRESSES
|
|
@@ -188,13 +185,8 @@ def main():
|
|
| 188 |
|
| 189 |
mnemo = _get_mnemonic()
|
| 190 |
|
| 191 |
-
# Phrase list generate karein
|
| 192 |
-
phrases_to_check = []
|
| 193 |
-
for i in range(1, NUM_PHRASES + 1):
|
| 194 |
-
if i == 25:
|
| 195 |
-
phrases_to_check.append(MY_TEST_PHRASE)
|
| 196 |
-
else:
|
| 197 |
-
phrases_to_check.append(mnemo.generate(strength=128))
|
| 198 |
|
| 199 |
total_phrases = len(phrases_to_check)
|
| 200 |
phrases_checked = 0
|
|
@@ -209,7 +201,7 @@ def main():
|
|
| 209 |
print(f"π Starting {NUM_WORKERS} workers on your Dual-Socket Xeon...\n")
|
| 210 |
|
| 211 |
try:
|
| 212 |
-
# Linux fork will share the 1.5GB address set across all
|
| 213 |
with multiprocessing.Pool(
|
| 214 |
processes=NUM_WORKERS,
|
| 215 |
initializer=init_worker,
|
|
@@ -241,7 +233,7 @@ def main():
|
|
| 241 |
print("=" * 60)
|
| 242 |
print(f"π Phrases checked in THIS run: {phrases_checked}")
|
| 243 |
print(f"π Private Keys generated in THIS run: {total_paths_checked:,}")
|
| 244 |
-
print(f"π¬ Addresses checked in THIS run: {
|
| 245 |
print(f"π― Matches found in THIS run: {total_matches}")
|
| 246 |
print("-" * 60)
|
| 247 |
print(f"β±οΈ Total time to complete process: {global_elapsed:.2f} seconds")
|
|
|
|
| 14 |
# ============================================================
|
| 15 |
CSV_FILE = "14262022_addresses.csv"
|
| 16 |
|
| 17 |
+
NUM_PHRASES = 5000
|
|
|
|
|
|
|
|
|
|
| 18 |
SCAN_MODE = "File"
|
| 19 |
ACC_START = 0
|
| 20 |
ACC_END = 29
|
|
|
|
| 23 |
SHOW_ALL = False
|
| 24 |
PASSPHRASE = ""
|
| 25 |
|
| 26 |
+
# β
Your system has 192 logical cores. 192 workers is the max.
|
| 27 |
NUM_WORKERS = 192
|
| 28 |
# ============================================================
|
| 29 |
|
|
|
|
| 93 |
return _get_mnemonic().to_seed(phrase, passphrase=passphrase)
|
| 94 |
|
| 95 |
# ============================================================
|
| 96 |
+
# Worker Function (Parallel execution)
|
| 97 |
# ============================================================
|
| 98 |
def process_phrase_worker(phrase):
|
| 99 |
global KNOWN_ADDRESSES
|
|
|
|
| 185 |
|
| 186 |
mnemo = _get_mnemonic()
|
| 187 |
|
| 188 |
+
# Phrase list generate karein (Sirf random phrases)
|
| 189 |
+
phrases_to_check = [mnemo.generate(strength=128) for _ in range(NUM_PHRASES)]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
|
| 191 |
total_phrases = len(phrases_to_check)
|
| 192 |
phrases_checked = 0
|
|
|
|
| 201 |
print(f"π Starting {NUM_WORKERS} workers on your Dual-Socket Xeon...\n")
|
| 202 |
|
| 203 |
try:
|
| 204 |
+
# Linux fork will share the 1.5GB address set across all workers!
|
| 205 |
with multiprocessing.Pool(
|
| 206 |
processes=NUM_WORKERS,
|
| 207 |
initializer=init_worker,
|
|
|
|
| 233 |
print("=" * 60)
|
| 234 |
print(f"π Phrases checked in THIS run: {phrases_checked}")
|
| 235 |
print(f"π Private Keys generated in THIS run: {total_paths_checked:,}")
|
| 236 |
+
print(f"π¬ Addresses checked in THIS run: {total_addresses_checked:,}")
|
| 237 |
print(f"π― Matches found in THIS run: {total_matches}")
|
| 238 |
print("-" * 60)
|
| 239 |
print(f"β±οΈ Total time to complete process: {global_elapsed:.2f} seconds")
|