Setting Up OPinit Bots

Overview

This guide provides comprehensive instructions for setting up OPinit bots within your Initia ecosystem, essential for managing various operations in Optimistic Rollup environments. These bots include:

For convenience, OPinit bots can be hosted on the same machine as your minitia service for testing purposes.

However, for production and mainnet instances, we recommend hosting your OPinit bots on separate machines, distinct from the machine hosting your minitia service.

Install Dependencies

Install NodeJS (v20+)

The reference OPInit bots are written in JavaScript and requires NodeJS (v20+).

To install Node, follow the instructions on the NodeJS website.

To verifiy that NodeJS is successfully installed, run the following command in your terminal:

node --version
Install PostgreSQL

The OPInit bot utilizes a PostgreSQL database to store and retrieve different operational information.

To install PostgreSQL, follow the instructions on the PostgreSQL website.

To verify that PostgreSQL is successfully installed, run the following command in your terminal:

psql --version

Setting Up Database

Once PostgreSQL is installed, we proceed to creating the database that will be used by our OPInit Bots.

sudo -u postgres psql
CREATE DATABASE minitia

Installation

Next, you can download the OPInit bot's source code or Docker image, depending on your preference.

git clone https://github.com/initia-labs/OPinit-bots.git
cd OPinit-bots
npm install
npm run build

Setting Environment Files

Each OPInit bot relies on a separate .env file to configure its parameters. These files will be named in the format .env.{BOT_NAME}. The directory in which to place these files may vary depending on how you're running the bots.

Inside the OPInit-bots directory, run the following commands to create the environment variable files

touch .env.executor
touch .env.batch
touch .env.challenger
touch .env.output

Last updated

Logo

© 2024 Initia Foundation, All rights reserved.