Nathan Woodburn ed3f5a7f62
All checks were successful
Build Docker / BuildImage (push) Successful in 55s
Check Code Quality / RuffCheck (push) Successful in 1m24s
fix: TX counting display
2026-04-09 13:53:35 +10:00
2026-04-04 18:18:09 +11:00
2026-04-04 18:18:09 +11:00
2026-04-08 15:34:26 +10:00
2026-04-04 18:18:09 +11:00
2026-04-04 18:18:09 +11:00
2026-04-08 15:34:26 +10:00
2026-04-08 15:34:26 +10:00
2026-04-04 18:18:09 +11:00
2026-04-04 18:18:09 +11:00
2026-04-04 18:18:09 +11:00
2026-04-09 13:42:46 +10:00
2026-04-04 19:22:20 +11:00
2026-04-09 13:53:35 +10:00
2026-04-04 19:22:20 +11:00

Python Flask Webserver Template

Python3 website template including git actions

Requirements

  • UV

Development

  1. Install project requirements
uv sync
  1. Run the dev server
uv run python3 server.py
  1. Alternatively use the virtual environment
source .venv/bin/activate

You can exit the environment with deactivate

For best development setup, you should install the git hook for pre-commit

uv run pre-commit install

Production

Run using the main.py file

python3 main.py

When running in Docker, a cron job is configured to call the pool overview endpoint every 5 minutes so stats snapshots continue collecting even without external traffic.

  • Default cron target: http://127.0.0.1:5000/api/v1/pool/overview
  • Override with: STATS_CRON_URL

Pool Tracking

The server now records pool stats over time and stores them in SQLite.

  • pool hashrate snapshots
  • active worker count snapshots
  • top mining addresses per snapshot interval

Environment variables:

  • STATS_DB_PATH (default: data/pool_stats.db)
  • STATS_SAMPLE_INTERVAL_SECONDS (default: 60, minimum: 10)

Tracking data is collected when pool API routes are called and is bucketed by sample interval.

Discord Alerts

The pool overview route can send Discord webhook alerts for key events:

  • new block found
  • block matured
  • payouts sent

Alerts are sent as Discord embeds with clickable explorer links for blocks and transactions when identifiers are available.

Environment variable:

  • DISCORD_WEBHOOK_URL (default: disabled)
  • EXPLORER_BASE_URL (default: https://explorer.fistbump.org)

Notes:

  • Alerts are deduplicated using persistent state in the same SQLite database.
  • On first run with a webhook configured, existing chain/payout state is bootstrapped and no historical alert burst is sent.

History endpoint:

GET /api/v1/pool/history?hours=24&limit=1000

Query parameters:

  • hours: lookback window in hours (1 to 720)
  • limit: max number of snapshots returned (10 to 5000)

Response includes:

  • hashrate_series: pool hashrate over time
  • worker_series: worker count over time
  • latest_top_addresses: top addresses in latest snapshot
  • top_addresses_over_period: aggregated top addresses over window
Description
Mining pool for Fistbump
https://pool.woodburn.au
Readme AGPL-3.0 362 KiB
Languages
HTML 47%
Python 35.1%
CSS 16.8%
Dockerfile 0.8%
Shell 0.3%