Skip to content

0rbit-co/dice-random-function

Repository files navigation

Random Number Generator using 0rbit

This project implements a random number generator using the 0rbit platform and AO processes. It includes both backend processes and a frontend application.

Prerequisites

Installing Prerequisites

  1. LuaRocks: Follow the installation instructions on the LuaRocks website.
  2. Node.js and npm: Download and install from the official Node.js website.

Project Structure

  • Backend Processes: Located in the ./ao/random_function directory
  • Frontend Application: Located in the ./apps/frontend directory

Setting Up and Running the AO Process

  1. Set the wallet environment variable:

    export WALLET_JSON="$(cat ~/.aos.json)"
  2. Build the process:

    cd ao/random_function && ./scripts/build.sh
    npm run random_function:build
  3. Deploy the process:

    npm run random_function:deploy
  4. Inject the process in frontend:

    npm run random_function:inject

Setting Up and Running the Frontend

  1. Navigate to the frontend directory:

    cd apps/frontend
  2. Install dependencies:

    npm i
  3. Start the development server:

    npm run dev

Important Note

Make sure to fund your AO Process using 0rbit points on which the process is deployed.

Support

For any issues or questions, please:

  • Open an issue on the GitHub repository
  • Ping us on Discord

You can also read the blog here.