A web tool that generates and auto-publishes the weekly activity report for the 3Speak decentralized encoder network.
It pulls job data from MongoDB, computes reward distribution by Hive account, generates the standardized markdown post, and can publish it to Hive either via a server-side posting key (automated cron) or via the Hive Keychain browser extension (manual).
- Date range picker — select by ISO week number or custom from/to dates
- Live stats tables — encoder nodes, aggregated jobs by account, reward percentages, failure counts
- Auto beneficiaries — weights computed from completed job share, sorted alphabetically (Hive protocol requirement), capped at 8 accounts
- Post preview — full markdown preview before publishing
- Two publish paths — Hive Keychain (browser, manual) or server-side posting key (automated)
- Sunday cron — auto-posts last week's report every Sunday at midnight UTC
- Backend: Node.js + Express + node-cron
- Database: MongoDB (
threespeakdatabase)embed-jobscollection — encoding jobs with status, worker, timestampsembed-encoderscollection — encoder metadata including Hive account and access level
- Frontend: Plain HTML + vanilla JS (no build step)
- Blockchain: @hiveio/dhive for server-side posting; Hive Keychain for browser posting
# 1. Install dependencies
npm install
# 2. Configure environment
cp .env.example .env
# Edit .env — at minimum set MONGODB_URI
# 3. Start the server
npm start
# or for development with auto-reload:
npm run devOpen http://localhost:<PORT> in your browser.
| Variable | Default | Description |
|---|---|---|
MONGODB_URI |
— | MongoDB connection string (required) |
ENCODER_DB_NAME |
threespeak |
Database name |
PORT |
3000 |
Server port |
HIVE_POSTING_KEY |
— | WIF private posting key (required for server-side post + cron) |
HIVE_POST_AUTHOR |
— | Hive account to post as (required for server-side post + cron) |
HIVE_POST_COMMUNITY |
— | Community tag, e.g. hive-181335 (optional) |
HIVE_POST_TAGS |
encoding,threespeak,... |
Comma-separated tags (optional) |
The Keychain publish path works without any HIVE_* env vars. The server-side post and Sunday cron require HIVE_POSTING_KEY + HIVE_POST_AUTHOR.
- Query — fetches
embed-jobswherecreatedAtfalls within the selected date range - Resolve — joins with
embed-encodersviaassignedWorker→nameto get the Hive account - Filter — only community encoders (
access: "community") and the Butter encoder (mapped to@joseamenac) are included; all other managed encoders are excluded - Aggregate — groups by Hive account, counts completed and failed jobs, computes success rates and reward percentages
- Generate — fills the standardized post template
- Publish — either
hive_keychain.requestPost(browser) ordhive.broadcast.commentWithOptions(server), both with beneficiaries baked in
A node-cron job runs every Sunday at midnight UTC and automatically posts the previous week's report. It only runs if HIVE_POSTING_KEY and HIVE_POST_AUTHOR are set in the environment; otherwise it logs a warning and skips.
You can also trigger a server-side post manually from the UI using the "Post via Server Key" button.