How to run a validator

JarJar Scheduler Validator Setup Guide

This guide will walk you through the process of setting up and running a validator for the JarJar Scheduler project, including environment configuration, hosting on Render.com, and database setup on DigitalOcean.

1. Environment Configuration

First, you need to create an environment file (.env) with the necessary configuration. Use the following template and adjust the values according to your setup:

ENV="prod"

# DATABASE
DB_LOG="false"
DB_HOST="your_database_host"
DB_PORT="your_database_port"
DB_USER="your_database_user"
DB_NAME="jarjar_scheduler_mainnet"
DB_PASSWORD="your_database_password"

# PORT
SUI_RPC_PULL_INTERVAL="5000"
PORT="3000"

# SUI
MNEMONIC="your_mnemonic_phrase"
SUI_NETWORK="mainnet"

EVENT_PACKAGE_ID="0x0"
EVENT_MODULE_NAME="jarjar_scheduler"

BINKS_COIN_TYPE="0x0::binks::BINKS"
SUI_TO_BINKS_RATIO="0.001145"

Make sure to replace the placeholders with your actual values, especially for the database connection and SUI mnemonic.

2. Hosting on Render.com

To host your JarJar Scheduler validator on Render.com, follow these steps:

  1. Sign up for a Render account at https://render.com if you haven't already.

  2. Click on "New +" and select "Web Service" from the dropdown menu.

  3. Connect your GitHub repository containing the JarJar Scheduler validator code.

  4. Configure your web service:

    • Name: Choose a name for your service (e.g., "jarjar-scheduler-validator")

    • Environment: Select the appropriate environment (Node.js)

    • Build Command: npm install (or your specific build command)

    • Start Command: npm start (or your specific start command)

  5. Under the "Environment" section, add all the environment variables from your .env file.

  6. Click "Create Web Service" to deploy your validator.

3. Setting up a Database on DigitalOcean

To set up a database for your JarJar Scheduler validator on DigitalOcean, follow these steps:

  1. Sign up for a DigitalOcean account at https://www.digitalocean.com if you haven't already.

  2. From the DigitalOcean dashboard, click on "Create" and select "Databases" from the dropdown menu.

  3. Choose your preferred database engine (e.g., PostgreSQL).

  4. Select a plan that fits your needs and budget.

  5. Choose a datacenter region close to your Render.com deployment for lower latency.

  6. Set a database cluster name (e.g., "jarjar-scheduler-db").

  7. Click "Create Database Cluster" to provision your database.

  8. Once created, you'll receive connection details. Use these to update your .env file and Render.com environment variables:

    • DB_HOST: The provided hostname

    • DB_PORT: The provided port (usually 25060 for DigitalOcean managed databases)

    • DB_USER: The default username provided

    • DB_NAME: The default database name (you can create a new one if needed)

    • DB_PASSWORD: The provided password

  9. On the DigitalOcean database page, go to the "Connection" tab and add your Render.com IP address to the "Trusted Sources" to allow the connection.

4. Final Steps

  1. Ensure your Render.com deployment is using the correct environment variables.

  2. Test the connection between your Render.com service and the DigitalOcean database.

  3. Monitor your validator's performance and logs through the Render.com dashboard.

  4. Regularly update your validator software and dependencies to ensure optimal performance and security.

By following these steps, you should have a JarJar Scheduler validator up and running, hosted on Render.com, and connected to a DigitalOcean database. Remember to keep your mnemonic phrase and other sensitive information secure.

Last updated