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.
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
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.
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. |
- 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
- Install project dependencies
npm install
- For local development, start a development server.
npm run dev
- Open a browser and navigate to
localhost:3000/wordle
to get a JSON response from the server.
Run below command to start the oracle server as a background service.
npm start
To stop the server, run below command.
npm stop