Challenger
To learn more about what the Challenger does, check out the Challenger page.
Running the Challenger
Initialize Challenger Bot
To initialize the Challenger
bot, use the following command:
Configuration
To configure the Challenger, fill in the values in the ~/.opinit/challenger.json file
.
Field | Description |
---|---|
version | Indicates the version of the OPinit spec (basically 1). |
listen_address | The address where the Challenger bot listens for incoming requests. |
l1_node | Information about the L1 node, including chain ID and RPC address. See the L1 Networks page for more information. |
l2_node | Information about the L2 node, including chain ID and RPC address. These configs are what you set when deploying the rollup |
l2_start_height | Challenger automatically sets the starting height for challenge processing. If the value is already stored in the db, this config is ignored. |
Start Bot
To start the bot, use the following command:
The following options can be set:
Option | Description | Default Value |
---|---|---|
--log-level | Sets the log level | info |
--polling-interval | Sets the polling interval | 100ms |
--config | Sets the config file name | [bot-name].json |
--home | Sets the home directory | ~/.opinit |
Queries
You can query the Challenger bot to get its status or view pending events and challenges:
Status
You can query the Challenger bot to get its status:
Challenges
You can query the Challenger bot to view all challenges. The query response are paginated, with each page containing 100 challenges.
To retrieve a specific page of challenges, use the following command:
Pending Events
Each event or transaction processed in a block is saved as a pending event
. These events are processed atomically, meaning they are either fully processed or rolled back in case of an error. If a pending event
matches a processed event or the event exceeds its timeout, a Challenge
is created and stored in the database for further action.
You can query the Challenger bot to view the pending events on the host (L1) and child chains (L2):
Resetting The Bot Database
If the database becomes corrupted or is moved to a new one, you need to initialize or reset it.
To reset the bot database, use the following command:
Was this page helpful?