Skip to content

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

Notifications You must be signed in to change notification settings

adamsoffer/payout-bot

Repository files navigation

Livepeer Payout Bot

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

Setup

Prerequisites

Important

The hosted Livepeer subgraph has been deprecated. This bot now utilizes the Livepeer subgraph on The Graph for data retrieval from the Livepeer network. To access this service, you will need an API key and an account with sufficient GRT tokens for queries.

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
    GRAPH_API_KEY=                          # The Graph 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

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published