OPinit Bots
This page will provide how to set OPinit bots for your minitia
Initia Optimistic Rollup Bots.
Batch Submitter: Submit batch to L1 node
Output Submitter: Submit output to L1 node
Challenger: Challenge invalid output
Bridge Executor: Execute bridge transaction
Installation
git clone https://github.com/initia-labs/OPinit.git
cd OPinit/bots
npm install
How to use
Create Bridge
Before running rollup bots, you should create bridge between L1 and L2. If you use initia.js
, you can create bridge using MsgCreateBridge
message as follows.
import { MsgCreateBridge, BridgeConfig, Duration } from '@initia/initia.js';
const bridgeConfig = new BridgeConfig(
challenger.key.accAddress,
outputSubmitter.key.accAddress,
Duration.fromString(submissionInterval.toString()),
Duration.fromString(finalizedTime.toString()),
new Date(),
this.metadata
);
const msg = new MsgCreateBridge(executor.key.accAddress, bridgeConfig);
Configuration
L1_LCD_URI
L1 node LCD URI
http://127.0.0.1:1317
L1_RPC_URI
L1 node RPC URI
http://127.0.0.1:26657
L2_LCD_URI
L2 node LCD URI
http://127.0.0.1:1317
L2_RPC_URI
L2 node RPC URI
http://127.0.0.1:26657
BRIDGE_ID
Bridge ID
""
EXECUTOR_PORT
Executor port
3000
BATCH_PORT
Batch submitter port
3001
EXECUTOR_MNEMONIC
Mnemonic seed for executor
""
BATCH_SUBMITTER_MNEMONIC
Mnemonic seed for submitter
""
OUTPUT_SUBMITTER_MNEMONIC
Mnemonic seed for output submitter
""
CHALLENGER_MNEMONIC
Mnemonic seed for challenger
""
L2_DENOM
L2 fee denom
umin
SLACK_WEB_HOOK
Slack web hook url for notification
""
DELETE_OUTPUT_PROPOSAL
Whether to allow challenger to automatically delete output proposals
false
In OPinit bots, we use dotenv for managing environment variable for development.
Bridge Executor
Bridge executor is a bot that monitor L1, L2 node and execute bridge transaction. It will execute following steps.
Set bridge executor mnemonic on
.env.executor
.export EXECUTOR_MNEMONIC="..."
Run executor bot
npm run executor
Batch Submitter
Batch submitter is a background process that submits transaction batches to the BatchInbox module of L1.
Set batch submitter mnemonic on
.env.batch
.export BATCH_SUBMITTER_MNEMONIC="..."
Run batch submitter bot
npm run batch
Output Submitter
Output submitter is the component to store the L2 output root for block finalization. Output submitter will get the L2 output results from executor and submit it to L1.
Set output submitter mnemonic on
.env.output
.export OUTPUT_SUBMITTER_MNEMONIC="..."
Run output submitter bot
npm run output
Challenger
Challenger is an entity capable of deleting invalid output proposals from the output oracle.
Set challenger mnemonic on
.env.challenger
.export CHALLENGER_MNEMONIC="..."
Run challenger bot
npm run challenger
Last updated