New #mining section placed between Gaming and the PeerTube library:
Live stat tiles: hashrate on this node (15m average, falling back to 1h then 24h), connected miners, shares found, sidechain hashrate, and Monero network hashrate.
"Join the pool" card: links to /xmrig.json and the setup notes on Discourse.
"Is it worth it?" card: says plainly that most CPUs currently lose money on electricity, and links to the profitability analysis and the role repo.
htdocs/static/p2pool-stats.mjs follows the same pattern as gitea-projects.mjs:
It fetches only the fixed same-origin /p2pool/stats.json, with no credentials and no redirects, a 64 KiB cap and a 10s timeout.
It accepts only known numeric fields and writes textContent only.
It refreshes every 60s while the page is visible and pauses when the tab is hidden.
The "Other ways to support" panel now links to #mining, and the README documents the widget.
The section is progressive enhancement. When the endpoint is missing (local preview, onion mirror, P2Pool restarting, or before the role PR is deployed), the — placeholders and join instructions stay visible and the status line says the stats are unavailable.
Depends on
DevOps/ansible-role-monero#1, which publishes /p2pool/stats.json on www.eom.dev. Merging this PR first is harmless: the section just shows placeholders until that endpoint exists.
Tests
node --test tests/p2pool-stats.test.mjs: 9 tests pass locally. They cover normalization of hostile input, formatting, the fetch bounds and error paths, DOM updates, fallback and keeping the previous figures, and pausing on visibility changes.
I could not run tests/site.test.mjs from this environment, because the repo isn't cloneable from here. I checked the new markup against its rules by hand:
unique IDs and valid #mining fragment
HTTPS and relative links only, all with labels
section order (films, music, projects, gaming, library) and still exactly 4 path-cards
## What
- New `#mining` section placed between Gaming and the PeerTube library:
- Live stat tiles: hashrate on this node (15m average, falling back to 1h then 24h), connected miners, shares found, sidechain hashrate, and Monero network hashrate.
- "Join the pool" card: links to `/xmrig.json` and the setup notes on Discourse.
- "Is it worth it?" card: says plainly that most CPUs currently lose money on electricity, and links to the [profitability analysis](https://discourse.eom.dev/t/cryptocurrency/686/2) and the role repo.
- `htdocs/static/p2pool-stats.mjs` follows the same pattern as `gitea-projects.mjs`:
- It fetches only the fixed same-origin `/p2pool/stats.json`, with no credentials and no redirects, a 64 KiB cap and a 10s timeout.
- It accepts only known numeric fields and writes `textContent` only.
- It refreshes every 60s while the page is visible and pauses when the tab is hidden.
- The "Other ways to support" panel now links to `#mining`, and the README documents the widget.
- The section is progressive enhancement. When the endpoint is missing (local preview, onion mirror, P2Pool restarting, or before the role PR is deployed), the `—` placeholders and join instructions stay visible and the status line says the stats are unavailable.
## Depends on
DevOps/ansible-role-monero#1, which publishes `/p2pool/stats.json` on www.eom.dev. Merging this PR first is harmless: the section just shows placeholders until that endpoint exists.
## Tests
- `node --test tests/p2pool-stats.test.mjs`: 9 tests pass locally. They cover normalization of hostile input, formatting, the fetch bounds and error paths, DOM updates, fallback and keeping the previous figures, and pausing on visibility changes.
- I could **not** run `tests/site.test.mjs` from this environment, because the repo isn't cloneable from here. I checked the new markup against its rules by hand:
- unique IDs and valid `#mining` fragment
- HTTPS and relative links only, all with labels
- section order (films, music, projects, gaming, library) and still exactly 4 `path-card`s
- no new `data-feed-*` regions
Please run `node --test` before merging.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_018STDcc5BaYxPMNA9S8Wycs
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
eric
merged commit 10c06be90d into main2026-11-08 17:35:15 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What
#miningsection placed between Gaming and the PeerTube library:/xmrig.jsonand the setup notes on Discourse.htdocs/static/p2pool-stats.mjsfollows the same pattern asgitea-projects.mjs:/p2pool/stats.json, with no credentials and no redirects, a 64 KiB cap and a 10s timeout.textContentonly.#mining, and the README documents the widget.—placeholders and join instructions stay visible and the status line says the stats are unavailable.Depends on
DevOps/ansible-role-monero#1, which publishes
/p2pool/stats.jsonon www.eom.dev. Merging this PR first is harmless: the section just shows placeholders until that endpoint exists.Tests
node --test tests/p2pool-stats.test.mjs: 9 tests pass locally. They cover normalization of hostile input, formatting, the fetch bounds and error paths, DOM updates, fallback and keeping the previous figures, and pausing on visibility changes.I could not run
tests/site.test.mjsfrom this environment, because the repo isn't cloneable from here. I checked the new markup against its rules by hand:#miningfragmentpath-cardsdata-feed-*regionsPlease run
node --testbefore merging.🤖 Generated with Claude Code
https://claude.ai/code/session_018STDcc5BaYxPMNA9S8Wycs