From 8608273959a802293b5d51bb5b98ccb2d84a377a Mon Sep 17 00:00:00 2001 From: Geoff Lee Date: Thu, 4 Apr 2024 11:30:02 +0900 Subject: [PATCH] fix config / readme (#41) --- bots/README.md | 33 +++++++++++++++++---------------- bots/src/config.ts | 3 +++ 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/bots/README.md b/bots/README.md index 37708647..0c5d650c 100644 --- a/bots/README.md +++ b/bots/README.md @@ -70,22 +70,23 @@ You should set `.env` file for each bot in `bots/worker`. To transfer assets bet - `.env.batch` -| Name | Description | Default | -| --------------------------- | ------------------------------------------------------------ | ------------------------ | -| L1_LCD_URI | L1 node LCD URI | | -| L1_RPC_URI | L1 node RPC URI | | -| L2_LCD_URI | L2 node LCD URI | | -| L2_RPC_URI | L2 node RPC URI | | -| BRIDGE_ID | Bridge ID | '' | -| BATCH_PORT | Batch submitter port | 5001 | -| BATCH_SUBMITTER_MNEMONIC | Mnemonic seed for submitter | '' | -| SLACK_WEB_HOOK | Slack web hook for notification (optional) | '' | -| CELESTIA_RPC_URI | Celestia node RPC URI | | -| CELESTIA_LIGHT_NODE_RPC_URI | Celestia light node RPC URI | | -| 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']) | 'l1' | +| Name | Description | Default | +| --------------------------- | ------------------------------------------------------------ | -------------------------- | +| L1_LCD_URI | L1 node LCD URI | | +| L1_RPC_URI | L1 node RPC URI | | +| L2_LCD_URI | L2 node LCD URI | | +| L2_RPC_URI | L2 node RPC URI | | +| BRIDGE_ID | Bridge ID | '' | +| BATCH_PORT | Batch submitter port | 5001 | +| BATCH_SUBMITTER_MNEMONIC | Mnemonic seed for submitter | '' | +| SLACK_WEB_HOOK | Slack web hook for notification (optional) | '' | +| BATCH_CHAIN_ID | DA chain's chain-id | | +| BATCH_CHAIN_RPC_URI | DA chain node RPC URI | L1_RPC_URI if target is l1 | +| BATCH_LCD_URI | DA chain node LCD URI | | +| BATCH_GAS_PRICES | Gas prices for DA chain | | +| BATCH_DENOM | Fee denom for DA chain | | +| CELESTIA_NAMESPACE_ID | Celestia namespace id (optional) | '' | +| PUBLISH_BATCH_TARGET | Target chain to publish batch (supports: ['l1', 'celestia']) | 'l1' | - `.env.challenger` diff --git a/bots/src/config.ts b/bots/src/config.ts index d9217ba6..71afddf7 100644 --- a/bots/src/config.ts +++ b/bots/src/config.ts @@ -57,6 +57,9 @@ export const config = { L2_RPC_URI: L2_RPC_URI ? L2_RPC_URI.split(',') : ['http://localhost:26657'], BATCH_LCD_URI: BATCH_LCD_URI ? BATCH_LCD_URI.split(',') : ['http://localhost:1317'], BATCH_CHAIN_RPC_URI: (() => { + if (process.env.WORKER_NAME !== 'batch') { + return undefined; + } if(PUBLISH_BATCH_TARGET == 'l1') { return L1_RPC_URI; } else if(BATCH_CHAIN_RPC_URI == undefined || BATCH_CHAIN_RPC_URI.length == 0) {