From 41bfecd0d836987606a9476063192a82845a741f Mon Sep 17 00:00:00 2001 From: Davide Grilli Date: Mon, 30 Mar 2026 01:10:31 +0200 Subject: [PATCH] chore(prototype): move legacy python miner into prototype folder with usage docs --- prototype/README.md | 53 +++++++++++++++++++ .../block_builder.py | 0 .../config.py.example | 0 launcher.py => prototype/launcher.py | 0 main.py => prototype/main.py | 0 miner.py => prototype/miner.py | 0 .../requirements.txt | 0 rpc.py => prototype/rpc.py | 0 utils.py => prototype/utils.py | 0 9 files changed, 53 insertions(+) create mode 100644 prototype/README.md rename block_builder.py => prototype/block_builder.py (100%) rename config.py.example => prototype/config.py.example (100%) rename launcher.py => prototype/launcher.py (100%) rename main.py => prototype/main.py (100%) rename miner.py => prototype/miner.py (100%) rename requirements.txt => prototype/requirements.txt (100%) rename rpc.py => prototype/rpc.py (100%) rename utils.py => prototype/utils.py (100%) diff --git a/prototype/README.md b/prototype/README.md new file mode 100644 index 0000000..d878e81 --- /dev/null +++ b/prototype/README.md @@ -0,0 +1,53 @@ +# Prototype Python Miner + +Questa cartella contiene la versione Python originale del miner. + +## Contenuto + +- `launcher.py`: orchestrazione multiprocesso e dashboard hashrate +- `main.py`: ciclo mining single worker +- `miner.py`: loop PoW SHA-256 +- `block_builder.py`: coinbase, merkle root, header, serializzazione blocco +- `rpc.py`: helper RPC verso Bitcoin Core +- `utils.py`: utility comuni (target, hash, watchdog) +- `config.py.example`: template configurazione +- `requirements.txt`: dipendenze Python + +## Setup + +```bash +cd prototype +python -m venv .venv +source .venv/bin/activate +pip install -r requirements.txt +``` + +## Configurazione + +1. Crea `config.py` partendo dal template: + +```bash +cp config.py.example config.py +``` + +2. Modifica `config.py` con i parametri RPC/wallet del tuo nodo. + +## Esecuzione + +Mining parallelo (consigliato): + +```bash +python launcher.py +``` + +Con numero processi esplicito: + +```bash +python launcher.py -n 4 +``` + +Single worker: + +```bash +python main.py +``` diff --git a/block_builder.py b/prototype/block_builder.py similarity index 100% rename from block_builder.py rename to prototype/block_builder.py diff --git a/config.py.example b/prototype/config.py.example similarity index 100% rename from config.py.example rename to prototype/config.py.example diff --git a/launcher.py b/prototype/launcher.py similarity index 100% rename from launcher.py rename to prototype/launcher.py diff --git a/main.py b/prototype/main.py similarity index 100% rename from main.py rename to prototype/main.py diff --git a/miner.py b/prototype/miner.py similarity index 100% rename from miner.py rename to prototype/miner.py diff --git a/requirements.txt b/prototype/requirements.txt similarity index 100% rename from requirements.txt rename to prototype/requirements.txt diff --git a/rpc.py b/prototype/rpc.py similarity index 100% rename from rpc.py rename to prototype/rpc.py diff --git a/utils.py b/prototype/utils.py similarity index 100% rename from utils.py rename to prototype/utils.py