54 lines
984 B
Markdown
54 lines
984 B
Markdown
|
|
# 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
|
||
|
|
```
|