Skip to content

PapaLabber/MakeComputingGridAgain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

271 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MakeComputingGridAgain

MakeComputingGridAgain is a distributed computing prototype built around Mersenne prime tasks. A Node.js server hands out work items, a browser extension requests tasks and performs the Lucas-Lehmer calculation client-side, and results are stored in MySQL and surfaced through leaderboard-style pages.

What It Does

  • Serves a small website with landing, signup, rewards, and leaderboard pages
  • Distributes queued computation tasks from a CSV-backed task list
  • Lets users sign up and log in
  • Loads a Chrome extension popup that can request a task and submit the computed result
  • Tracks points and completed results in a MySQL database

Project Structure

.
├── data/                          # CSV task source
├── node/
│   ├── app.js                     # Starts the HTTP server and task broker
│   ├── server.js                  # HTTP server bootstrap
│   ├── router.js                  # Route handling and static file serving
│   ├── TaskBroker.js              # Queue, dequeue, acknowledge, requeue logic
│   ├── DatabaseOperation.js       # MySQL and auth-related operations
│   └── PublicResources/
│       ├── extension/             # Chrome extension popup and LLT logic
│       └── webpages/              # Public HTML, CSS, and browser JS
├── tests/                         # Vitest coverage for queue and frontend logic
├── package.json
└── package-lock.json

Requirements

  • Node.js
  • npm
  • A local MySQL instance

Install

npm install

Environment Variables

Set these variables before starting the app:

export DB_HOST=localhost
export DB_USER=your_database_user
export DB_PASSWORD=your_database_password
export DB_NAME=your_database_name
export JWT_SECRET=replace_with_a_long_random_secret

Run Locally

Start the app with Node:

node node/app.js

The server listens on http://127.0.0.1:3430/.

When the app starts it also loads tasks from data/task_list_with_plain_ids_1_to_5000.csv into the in-memory task queue.

Run Tests

npm test

Tests use vitest and currently cover task broker behavior plus parts of the signup, popup, and leaderboard frontend logic.

Browser Extension

The extension source lives in node/PublicResources/extension/.

To load it in Chrome:

  1. Open chrome://extensions
  2. Enable Developer Mode
  3. Choose Load unpacked
  4. Select node/PublicResources/extension

The popup supports:

  • User login
  • Requesting a computation task
  • Running the Lucas-Lehmer test in the browser
  • Submitting results back to the server
  • Opening the home, rewards, and leaderboard pages

Main Routes

  • GET / - landing page
  • GET /node/requestTask - fetch the next queued task
  • GET /node/fillLeaderBoard - fetch leaderboard/result data
  • GET /node/users-tasks?username=... - fetch a user's points
  • POST /node/register - register a new user
  • POST /node/login - authenticate and receive a JWT
  • POST /node/clientTaskDone - submit a completed task result

Notes

  • The current codebase mixes a local server setup with extension code that references a deployed AAU host. If you want a fully local flow, the extension and webpage baseURL configuration may need to be pointed at your local server.
  • The app now requires database credentials and the JWT secret to be provided through environment variables at startup.

About

Grid computing project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors