rickstaa / livepeer-payout-bot

Home Page:payout-bot-git-main.soffer.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Livepeer Payout Bot

Sends an alert to Discord and Twitter anytime an orchestrator gets paid.

Setup

Prerequisites

Local Development

  1. Ensure MongoDB is running:

    sudo systemctl start mongod
  2. To send alerts to a specific Discord channel, create a Discord webhook for that channel.

  3. Install dependencies with yarn install.

  4. Rename the .env.example file to .env and fill in the required environment variables:

    DISCORD_WEBHOOK_URL=                    # Discord webhook url
    API_TOKEN=                              # Bearer Token for API
    INFURA_KEY=                             # Infura API Key
    NODE_ENV=development                    # Environment (development, production)

    The NODE_ENV variable should be set to development if you are using a local MongoDB database.

  5. Run the bot with vercel dev.

Deployment

  1. Create an Vercel account.

  2. Create a Infura or Alchemy account and get an API key.

  3. Create a Atlas account and create a new cluster.

  4. Create a new database user with read and write access to the cluster.

  5. To send alerts to a specific Discord channel, create a Discord webhook for that channel.

  6. Add the environment variables found in the .env.example file to all environments (i.e. Production, Preview, Development) in the Vercel project with the vercel env add command or through the Vercel dashboard.

  7. Deploy the bot with vercel.

  8. Setup a Vercel cron job to run the bot every 10 minutes.

    {
      "crons": [
        {
          "path": "/api/update",
          "schedule": "*/10 * * * *"
        }
      ]
    }
  9. Disable Vercel's Deployment Protection if you want to be able to call the /api/update endpoint remotely.

About

payout-bot-git-main.soffer.vercel.app


Languages

Language:TypeScript 100.0%