chore(prototype): move legacy python miner into prototype folder with usage docs

This commit is contained in:
2026-03-30 01:10:31 +02:00
parent 1f0b00c679
commit 41bfecd0d8
9 changed files with 53 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
"""Complete miner configuration example.
This file documents all options supported by the program.
"""
import multiprocessing as mp
# ---------------------------------------------------------------------------
# RPC (Bitcoin Core)
# ---------------------------------------------------------------------------
RPC_USER = "user"
RPC_PASSWORD = "password"
RPC_HOST = "127.0.0.1"
RPC_PORT = 18443
# ---------------------------------------------------------------------------
# Wallet
# ---------------------------------------------------------------------------
# Address that receives the coinbase reward.
# It must be valid for the node you are connected to.
WALLET_ADDRESS = ""
# ---------------------------------------------------------------------------
# Mining
# ---------------------------------------------------------------------------
# Network behavior:
# - regtest: 0 -> use network target; >0 -> max_target / factor; <0 -> forced to 0.1
# - non-regtest: ignored and always set to 1.0
DIFFICULTY_FACTOR = 1.0
# Supported values:
# - "incremental": initial nonce is 0, then increments
# - "random": initial nonce is random, then increments by batch
# - "mixed": initial nonce is random, then increments
NONCE_MODE = "incremental"
# Interval (seconds) to update the header timestamp.
# 0 disables periodic timestamp updates.
TIMESTAMP_UPDATE_INTERVAL = 30
# Number of nonces computed per batch (int > 0 recommended).
BATCH = 10_000
# Custom message inserted into coinbase scriptSig.
COINBASE_MESSAGE = "/py-miner/"
# Extranonce values used in coinbase scriptSig.
# Must be hexadecimal strings (only 0-9a-fA-F) with even length.
EXTRANONCE1 = "1234567890abcdef"
EXTRANONCE2 = "12341234"
# Practical note: total coinbase scriptSig must remain <= 100 bytes.
# ---------------------------------------------------------------------------
# Worker
# ---------------------------------------------------------------------------
# Same semantics as config.py:
# - >0: use that exact number of processes
# - <=0: use all available CPU cores
_NUM_PROCESSORS = 0
NUM_PROCESSORS = _NUM_PROCESSORS if _NUM_PROCESSORS > 0 else mp.cpu_count()
# ---------------------------------------------------------------------------
# Watchdog
# ---------------------------------------------------------------------------
# Best-block polling interval (seconds).
CHECK_INTERVAL = 20