Add a live P2Pool mining section to the homepage

A new #mining section invites visitors to mine on p2pool.eom.dev and shows
live node/sidechain/network hashrate, connected miners and shares from the
same-origin /p2pool/stats.json summary published by ansible-role-monero.
The stats load progressively: static placeholders and join instructions
remain when the endpoint is unavailable (including in the local preview
and on the onion mirror).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018STDcc5BaYxPMNA9S8Wycs
This commit is contained in:
2026-11-08 03:13:40 +00:00
co-authored by Claude Opus 5.5
parent 849a020cbc
commit 2e81ddf822
5 changed files with 451 additions and 0 deletions
+14
View File
@@ -58,6 +58,20 @@ email addresses and other author metadata are not displayed. Gitea requests are
anonymous, HTTPS-only, size-limited to 2 MiB, and time out after 10 seconds.
The cards refresh every 15 minutes while visible, retain clearly labeled
fallback/previous content on failure, and link to the full public activity page.
### Live mining stats
The **Mine Monero with us** section (`#mining`) uses
[htdocs/static/p2pool-stats.mjs](htdocs/static/p2pool-stats.mjs) to read
`/p2pool/stats.json`. That same-origin path is not part of this repository: the
[ansible-role-monero](https://gitea.eom.dev/DevOps/ansible-role-monero) stats
sidecar publishes it through an Ingress on the website host. The summary carries
only aggregate numbers (node, sidechain and network hashrate, connected miners,
shares) and never miner IPs or wallets. The module accepts only those numeric
fields, writes plain text into fixed `[data-stat]` cells, limits responses to
64 KiB with a 10-second timeout, and refreshes every minute while the page is
visible. When the endpoint is missing (local preview, onion mirror, P2Pool
restarting) the `—` placeholders and join instructions stay in place.
No Creator Launch project or service offer is involved.
[htdocs/static/peertube-feeds.mjs](htdocs/static/peertube-feeds.mjs) loads public