Skip to content

Commit

Permalink
feat: use default target (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
ALPAC-4 authored Mar 25, 2024
1 parent 778ba83 commit 66a2781
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
26 changes: 13 additions & 13 deletions bots/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ You should set `.env` file for each bot in `bots/worker`. To transfer assets bet
- `.env.executor`

| Name | Description | Default |
| ------------------------- | ------------------------------------------------------ | -------------------------------- |
| 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 | 5000 |
| EXECUTOR_MNEMONIC | Mnemonic seed for executor | '' |
| SLACK_WEB_HOOK | Slack web hook for notification (optional) | '' |
| EXECUTOR_L1_MONITOR_HEIGHT| L1 monitor start height (optional) | 0 |
| EXECUTOR_L2_MONITOR_HEIGHT| L2 monitor start height (optional) | 0 |
| Name | Description | Default |
| -------------------------- | ------------------------------------------ | ------------------------ |
| 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 | 5000 |
| EXECUTOR_MNEMONIC | Mnemonic seed for executor | '' |
| SLACK_WEB_HOOK | Slack web hook for notification (optional) | '' |
| EXECUTOR_L1_MONITOR_HEIGHT | L1 monitor start height (optional) | 0 |
| EXECUTOR_L2_MONITOR_HEIGHT | L2 monitor start height (optional) | 0 |

> Note that if `EXECUTOR_L1_MONITOR_HEIGHT` and `EXECUTOR_L2_MONITOR_HEIGHT` are not set, `executor` will start monitoring from height stored on `state` table. If you want to start monitoring from specific height, you should set them in `.env.executor` file.
Expand Down Expand Up @@ -85,7 +85,7 @@ You should set `.env` file for each bot in `bots/worker`. To transfer assets bet
| CELESTIA_TOKEN_AUTH | Celestia light node admin token | '' |
| CELESTIA_NAMESPACE_ID | Celestia namespace id | '' |
| CELESTIA_GAS_PRICE | Celestia utia gas price | 0.01 |
| PUBLISH_BATCH_TARGET | Target chain to publish batch (supports: ['l1', 'celestia']) | '' |
| PUBLISH_BATCH_TARGET | Target chain to publish batch (supports: ['l1', 'celestia']) | 'l1' |

- `.env.challenger`

Expand Down
4 changes: 4 additions & 0 deletions bots/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ export const config = {
CELESTIA_NAMESPACE_ID: CELESTIA_NAMESPACE_ID || '',
CELESTIA_GAS_PRICE: Number(CELESTIA_GAS_PRICE) || 0.01,
PUBLISH_BATCH_TARGET: (() => {
if (PUBLISH_BATCH_TARGET === undefined) {
return 'l1';
}

const target = supportedPublishBatchTargets.find(
(target) => target === PUBLISH_BATCH_TARGET?.toLocaleLowerCase()
);
Expand Down

0 comments on commit 66a2781

Please sign in to comment.