Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

3Speak Encoder Network — Weekly Report Generator

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).


Features

  • 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

Stack

  • Backend: Node.js + Express + node-cron
  • Database: MongoDB (threespeak database)
    • embed-jobs collection — encoding jobs with status, worker, timestamps
    • embed-encoders collection — 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

Setup

# 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 dev

Open http://localhost:<PORT> in your browser.


Environment Variables

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.


How It Works

  1. Query — fetches embed-jobs where createdAt falls within the selected date range
  2. Resolve — joins with embed-encoders via assignedWorkername to get the Hive account
  3. Filter — only community encoders (access: "community") and the Butter encoder (mapped to @joseamenac) are included; all other managed encoders are excluded
  4. Aggregate — groups by Hive account, counts completed and failed jobs, computes success rates and reward percentages
  5. Generate — fills the standardized post template
  6. Publish — either hive_keychain.requestPost (browser) or dhive.broadcast.commentWithOptions (server), both with beneficiaries baked in

Automated Posting

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.


Related

About

Simple App for Automating Community Encoder Reports

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages