Skip to content

ELPilotPR/mining-pool-stats

Repository files navigation

Mining Pool Stats

Mining Pool Stats is an open-source Node.js and PostgreSQL web application for tracking proof-of-work coins, mining pools, exchange listings, hashrate, workers, market pairs, volume, exchange reputation, scam flags, and domain-age trust signals.

The project was originally built as a live community dashboard. It is now published so other developers can continue it, audit it, improve the data pipeline, or run their own instance.

What It Does

  • Tracks approved coins, pools, exchanges, and public API endpoints.
  • Polls mining pool APIs for live hashrate, workers, blocks, and status.
  • Polls exchange APIs and aggregator APIs for prices, pairs, and volume.
  • Computes consensus price and 24h volume from exchange market data where possible.
  • Tracks exchange reputation votes and admin scam flags.
  • Enriches exchanges with domain age, registrar, and WHOIS/RDAP metadata.
  • Provides public pages for coins, pools, exchanges, and a public REST API.
  • Provides a user dashboard for submissions and an admin dashboard for moderation.
  • Lets admins approve/reject listings, transfer ownership, reset user passwords, remove spam reputation votes, and mark exchanges as scam.

Tech Stack

  • Node.js 22+
  • Express 5
  • EJS templates
  • PostgreSQL
  • Sequelize ORM
  • PM2 for production process management
  • Nginx recommended as reverse proxy

Repository Layout

src/app.js                         Express app setup, middleware, route mounting
src/server.js                      Web process entrypoint
src/worker.js                      Background worker entrypoint
src/bootstrap.js                   Idempotent production schema/data repairs
src/config/                        App, auth, and database config
src/controllers/                   API controllers
src/database/models/               Sequelize models and associations
src/database/seeders/              Optional Sequelize seeders
src/routes/                        Web routes and API routes
src/services/                      Main business logic
src/utils/                         Shared helpers
src/workers/                       Pollers, enrichers, cleanup, scheduler
views/                             EJS pages
public/                            Static assets and uploads placeholder
scripts/                           One-off maintenance and audit scripts
nginx/                             Example Nginx config
ecosystem.config.cjs              Production PM2 process definitions

Quick Start

cp .env.example .env
npm install
createdb miningpoolstats
npm run db:init
npm run dev

Then open http://localhost:3000.

npm run db:init connects to PostgreSQL, syncs the Sequelize schema, runs the idempotent bootstrap repairs, and creates or updates an admin user when ADMIN_EMAIL and ADMIN_PASSWORD are set in .env.

Required Environment Variables

Copy .env.example and change every placeholder before production use.

Minimum local variables:

NODE_ENV=development
PORT=3000
BASE_URL=http://localhost:3000
DB_HOST=localhost
DB_PORT=5432
DB_NAME=miningpoolstats
DB_USER=miningpool
DB_PASSWORD=change_me
JWT_SECRET=change_this_to_a_long_random_secret
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=change_this_admin_password

Optional integrations:

  • LCW_API_KEY for LiveCoinWatch lookups.
  • RECAPTCHA_SITE_KEY and RECAPTCHA_SECRET_KEY for public forms.
  • TELEGRAM_BOT_TOKEN, TELEGRAM_CHANNEL, and DISCORD_WEBHOOKS for notifications.

Processes

Development usually runs the combined server and scheduler:

npm run dev

Production should split web and workers:

WEB_ONLY=true DISABLE_WORKERS=true npm start
WORKER_ONLY=true npm run worker

The included ecosystem.config.cjs defines both PM2 processes.

Data Quality Notes

This project depends on external pool and exchange APIs. Data quality varies a lot across small mining projects and exchanges. The worker system is built to reduce bad data through:

  • endpoint health checks,
  • stale cleanup,
  • price consensus and outlier filtering,
  • exchange link synchronization,
  • domain age enrichment,
  • duplicate pool cleanup,
  • data consistency checks,
  • manual admin overrides for bad actors.

When auditing an instance, start with:

node scripts/health-check.js
node scripts/audit-data-quality.js
node scripts/check-all-exchanges.js

Some scripts were originally written for live maintenance. Read each script before running it against production data.

Public API

Public API docs are served by the app at:

/api/public/docs

Common endpoints:

GET /api/public/overview
GET /api/public/coins
GET /api/public/coins/:symbol
GET /api/public/coins/:symbol/pools
GET /api/public/coins/:symbol/hashrate
GET /api/public/pools
GET /api/public/exchanges

Security

  • Never commit .env, database dumps, backups, private keys, or token files.
  • Set a long random JWT_SECRET in production.
  • Do not use demo admin passwords.
  • Keep NODE_ENV=production behind HTTPS.
  • Run web and worker as an unprivileged system user when possible.
  • Treat exchange and pool APIs as untrusted input.

See SECURITY.md for reporting guidance.

License

MIT. See LICENSE.

About

Open-source mining pool and exchange statistics dashboard

Resources

License

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors