feat: web dashboard, Docker, bilingual docs (v0.7.0)#8
Merged
devAsmodeus merged 7 commits intomainfrom May 3, 2026
Merged
Conversation
0b8b85a to
660ab26
Compare
1a46f90 to
76e7ec1
Compare
Single-page HTML (vanilla JS, inline-SVG sparkline, no CDN), JSON snapshot at /api/stats (no-store), Server-Sent Events at /api/events covering share_found / share_accepted / share_rejected / job / pool, and /healthz proxied through the same provider as MetricsServer. StatsProvider extended with subscribe(callback) -> unsubscribe and publish_event hook; update_job/record_share/update_pool now publish. sha_backend tracked alongside the snapshot so the UI can show the active backend next to the hashrate. Tests: 17 new (StatsProvider pub/sub, render_html, HTML/JSON/SSE/healthz endpoints, idempotent start/stop, lifecycle). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds --web-port (default 0 = off) and --web-host (default 127.0.0.1). WebUIServer reuses the same _health_provider() callable as the metrics server, so /healthz is consistent across both ports. StatsProvider is constructed with the resolved sha_backend so /api/stats can show it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Dockerfile based on python:3.11-slim, healthcheck via stdlib urllib (no curl install needed), ENTRYPOINT hope-hash. docker-compose.yml brings up miner + Prometheus + Grafana with named volumes for state and a bind-mount for the SQLite share journal. Provisioning: - deploy/prometheus/prometheus.yml — scrapes miner:8000/metrics every 15s. - deploy/grafana/datasource.yml — Prometheus datasource at prometheus:9090. - deploy/grafana/dashboard.yml — auto-loads the existing hope-hash.json. .dockerignore strips git/tests/docs/db artifacts from build context. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Both halves mirror the same sections in the same order: tagline +
badges, what is this, status (v0.7.0), install, run, advanced flags
table, demo, benchmark, architecture, realistic expectations,
contributing pointers. Cross-links to docs/architecture.{en,ru}.md.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three docs x two languages, all parallel: - getting-started — Python install, BTC address, first run, log walkthrough, common pitfalls (firewall, address format, pip on Windows, curses). - deploy — docker compose walkthrough, Grafana login, Telegram setup, healthcheck, reverse-proxy snippet for SSE behind nginx. - architecture — protocol summary, threading table, file map, hot path, observers, ctypes trade-off, solo caveats, BIP references. Russian halves are written natively, not machine-translated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- __version__ = "0.7.0"; re-export WebUIServer + render_html. - CHANGELOG [0.7.0] section listing webui, Docker, docs, tests delta. - ROADMAP: tick web dashboard (stdlib http.server, not FastAPI) and Docker; add a "remaining" section for explicitly punted items (Stratum V2, Rust/PyO3, GPU, FastAPI, Helm, web write endpoints). - docs/handoff/pr-c-summary.md with file map and review checklist. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ix, 4 MEDIUM sec)
76e7ec1 to
847d664
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR C of three. Adds a stdlib web dashboard, a Dockerised stack with
Prometheus + Grafana provisioning, and a bilingual (EN + RU) docs
overhaul. Pure stdlib, no new runtime dependencies.
`GET /` (single-page HTML, vanilla JS, inline-SVG sparkline, no CDN),
`GET /api/stats` (JSON snapshot, `Cache-Control: no-store`),
`GET /api/events` (Server-Sent Events for share / job / pool changes,
keepalive every 15s), `GET /healthz`. New flags `--web-port` and
`--web-host`. `StatsProvider` extended with `subscribe(callback)`.
`urllib`, no `curl` install), `docker-compose.yml` with miner +
Prometheus + Grafana, provisioning files for both, `.dockerignore`.
sections), new `docs/{getting-started,deploy,architecture}.{en,ru}.md`,
`docs/handoff/pr-c-summary.md` with file map and review checklist.
ROADMAP ticked (web, Docker) + new "remaining" list of explicitly
punted items (Stratum V2, Rust/PyO3, GPU, FastAPI, Helm).
Tests: 225 → 242 (+17 in `test_webui.py`). All green on
`py -3.11 -m unittest discover -s tests -v`.
Test plan
live-updating `/api/stats`, and a streaming `/api/events`.
syntactically valid; image runs).
Prometheus + Grafana; Grafana auto-loads the bundled dashboard.
Stack
```
🤖 Generated with Claude Code
```