From 2b7fa5396a5d5d128f777da41e2f6cf72ba0a591 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 24 Aug 2026 11:39:33 +0200 Subject: [PATCH] Initial Release: Custom Bitcoin Solo Pool Stack --- Dockerfile | 12 ++++ README.md | 41 ++++++++++++++ docker-compose.yaml | 60 ++++++++++++++++++++ html/index.php | 132 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 245 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 docker-compose.yaml create mode 100644 html/index.php diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..001b3bc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM php:8.3-apache + +# Kopiere das Dashboard in den Webroot +COPY html/ /var/www/html/ + +# Erstelle den Ordner für die History und setze Rechte +RUN mkdir -p /var/www/html/posts && \ + chown -R www-data:www-data /var/www/html/posts && \ + chmod -R 775 /var/www/html/posts + +# Definiere das Volume für persistente History-Daten +VOLUME /var/www/html/posts \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..f490748 --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# ⛏️ Bitcoin Solo-Pool & Custom Dashboard Stack + +Ein autarkes, ressourcenschonendes Bitcoin Solo-Mining-Setup via Docker. +Beinhaltet eine eigene **Bitcoin Full Node (bitcoind)**, das **public-pool Backend (NestJS)** für Stratum-Verbindungen und ein **maßgeschneidertes, performantes PHP/JS-Dashboard** als Frontend[cite: 2]. + +## 🚀 Warum dieser Stack? +Das Standard-Frontend (`public-pool-ui`) belegt oft unnötig Arbeitsspeicher und verursacht bei externen Abfragen CORS-Probleme[cite: 2]. Dieses Setup ersetzt das Frontend durch ein schlankes PHP-Dashboard. Es fungiert als API-Proxy, loggt die Hashrate-Historie in eine lokale JSON und bietet 24/7 Graphen (Chart.js)[cite: 2]. + +## ⚙️ Installation + +1. Repository klonen: +```bash +git clone [https://github.com/tessmania90/bitcoin-solo-pool.git](https://github.com/tessmania90/bitcoin-solo-pool.git) +cd bitcoin-solo-pool +``` + +2. Stack starten: +```bash +docker compose up -d +``` + +### ⚠️ Wichtige Hinweise zum Sync +* **Initial Block Download (IBD):** Die Bitcoin-Node muss beim ersten Start synchronisieren (kann >24h dauern)[cite: 2]. +* Solange der Sync nicht zu 100% fertig ist, verweigert die Node Block-Templates. Das `public-pool` Backend wirft in dieser Zeit Verbindungsfehler[cite: 2]. **Bitte warten, bis der Sync fertig ist!** +* **Speicherplatz:** Die Node startet mit `-prune=5000` und verbraucht so nur ca. 17 GB statt >650 GB[cite: 2]. + +## 📊 Dashboard & Graphen-Aufzeichnung +Das Dashboard ist unter `http://:8080` erreichbar. + +Damit die Hashrate-Historie lückenlos alle 5 Minuten aufgezeichnet wird, richte einen Cronjob auf dem Docker-Host ein (oder nutze Uptime Kuma)[cite: 2]: +```bash +*/5 * * * * curl -s "[http://127.0.0.1:8080/?api_action=pool](http://127.0.0.1:8080/?api_action=pool)" > /dev/null +``` + +## 🔌 Miner verbinden (z.B. Bitaxe, NerdMiner) +* **Stratum URL:** `stratum+tcp://:21496`[cite: 2] +* **User/Worker:** `.`[cite: 2] +* **Passwort:** `x`[cite: 2] + +--- +*Ein Projekt von [tessmann.dev](https://tessmann.dev)* \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..038acdb --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,60 @@ +services: + # 1. BITCOIN FULL NODE (bitcoind) + bitcoind: + image: lncm/bitcoind:v27.0 + container_name: bitcoind-node + restart: unless-stopped + volumes: + - ./bitcoin-data:/root/.bitcoin + ports: + - "8333:8333" # P2P Netzwerk + command: + - -server=1 + - -txindex=0 + - -prune=5000 # Beschränkt den Speicher auf ca. 17 GB + - -rpcbind=0.0.0.0 + - -rpcallowip=0.0.0.0/0 + - -rpcuser=pooluser + - -rpcpassword=StrengGeheimesPasswort123! + - -zmqpubrawblock=tcp://0.0.0.0:28332 + networks: + - mining-net + + # 2. PUBLIC-POOL STRATUM & API BACKEND + public-pool: + image: benedikteth/public-pool:latest + container_name: public-pool-backend + restart: unless-stopped + depends_on: + - bitcoind + environment: + - BITCOIN_RPC_URL=http://bitcoind:8332 + - BITCOIN_RPC_USER=pooluser + - BITCOIN_RPC_PASSWORD=StrengGeheimesPasswort123! + - BITCOIN_RPC_TIMEOUT=10000 + - BITCOIN_ZMQ_HOST=tcp://bitcoind:28332 + - API_PORT=3334 + - STRATUM_PORT=21496 + - NETWORK=mainnet + ports: + - "21496:21496" # Stratum V1 Port für Miner + networks: + - mining-net + + # 3. CUSTOM PHP-DASHBOARD (by Tessmann) + dashboard-web: + image: tessmann/bitcoin-solo-pool:latest + container_name: mining-dashboard + restart: unless-stopped + ports: + - "8080:80" + volumes: + - ./dashboard-data:/var/www/html/posts + environment: + - TZ=Europe/Berlin + networks: + - mining-net + +networks: + mining-net: + driver: bridge \ No newline at end of file diff --git a/html/index.php b/html/index.php new file mode 100644 index 0000000..af88075 --- /dev/null +++ b/html/index.php @@ -0,0 +1,132 @@ + ['timeout' => 3]]); + $data = @file_get_contents($api_base . $endpoint, false, $ctx); + + if ($action === 'pool' && $data) { + $json = json_decode($data, true); + $hr = $json['totalHashRate'] ?? 0; + $file = __DIR__ . '/posts/hashrate_history.json'; + $history = file_exists($file) ? json_decode(file_get_contents($file), true) : []; + + $last_time = end($history)['timestamp'] ?? 0; + $now = time(); + + if ($now - $last_time >= 300) { + $history[] = [ + 'timestamp' => $now, + 'label' => date('d.m. H:i'), + 'hashrate' => $hr + ]; + if (count($history) > 432) array_shift($history); + file_put_contents($file, json_encode($history), LOCK_EX); + } + } + + echo $data ?: '{}'; + exit; +} +?> + + + + + Bitcoin Solo Pool Dashboard + + + + +

⛏️ Bitcoin Solo Mining Dashboard

+ +
+

📊 Live Pool Hashrate (36 Stunden Verlauf)

+
+
+ +
+

🔍 Eigene Worker prüfen

+ + + + + + + + + + +
WorkerSessionsHashrateBest Difficulty
Bitte Wallet-Adresse suchen.
+
+ + + + \ No newline at end of file