Skip to content

Latest commit

 

History

History

oracle

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

mina-wordle-game-oracle

An oracle server that returns the New York Times Wordle of the day with a Mina compatible signature scheme.

This is the oracle server backend for the Mina Wordle Game. It returns the New York Times Wordle of the day with a Mina compatible signature scheme. It uses koa HTTP middleware framework and pm2 process manager for nodejs.

The oracle server runs on port 3000 by default.

Demo

The following endpoints are available.

  • /wordle: returns the secret wordle of the day signed with the oracle server account.
  • /wordle/<date>: provides wordle for a specific date. For example, /wordle/2022-12-15

Setup the configurations

The configuration file is .env. It should be placed in the root folder. A sample .env.sample is provided as a reference.

Rename .env.sample to .env and add parameters for your setup.

Configurable parameters

Parameter Required Remark
PRIVATE_KEY Yes Private key to sign response payload. Do not share your private key with anyone.
PORT No The server will listen on this port. 3000 will be used if not set.

How to build

  1. Clone this git repository and change to the oracle directory
git clone https://github.com/t4top/mina-wordle-game.git
cd mina-wordle-game/oracle
  1. Install project dependencies
npm install
  1. For local development, start a development server.
npm run dev
  1. Open a browser and navigate to localhost:3000/wordle to get a JSON response from the server.

Launch the server for production

Run below command to start the oracle server as a background service.

npm start

To stop the server, run below command.

npm stop