Commit 5cd1e996 authored by Antonis Kogias's avatar Antonis Kogias

chore: change service generated env variables

parent 3525635a
---
'@eth-optimism/common-ts': patch
'@eth-optimism/message-relayer': patch
'@eth-optimism/replica-healthcheck': patch
---
Have BaseServiceV2 add spaces to environment variable names
......@@ -136,9 +136,9 @@ services:
image: ethereumoptimism/message-relayer:${DOCKER_TAG_MESSAGE_RELAYER:-latest}
entrypoint: ./relayer.sh
environment:
MESSAGE_RELAYER__L1RPCPROVIDER: http://l1_chain:8545
MESSAGE_RELAYER__L2RPCPROVIDER: http://l2geth:8545
MESSAGE_RELAYER__L1WALLET: '0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97'
MESSAGE_RELAYER__L1_RPC_PROVIDER: http://l1_chain:8545
MESSAGE_RELAYER__L2_RPC_PROVIDER: http://l2geth:8545
MESSAGE_RELAYER__L1_WALLET: '0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97'
RETRIES: 60
verifier:
......
......@@ -13,7 +13,7 @@ curl \
--retry-connrefused \
--retry $RETRIES \
--retry-delay 1 \
$MESSAGE_RELAYER__L2RPCPROVIDER
$MESSAGE_RELAYER__L2_RPC_PROVIDER
# go
exec yarn start
......@@ -110,12 +110,16 @@ export abstract class BaseServiceV2<
// Use commander as a way to communicate info about the service. We don't actually *use*
// commander for anything besides the ability to run `ts-node ./service.ts --help`.
const program = new Command()
const reg = /L_1|L_2/g
for (const [optionName, optionSpec] of Object.entries(params.optionsSpec)) {
const repl = optionName.includes('l1') ? 'L1' : 'L2'
program.addOption(
new Option(`--${optionName.toLowerCase()}`, `${optionSpec.desc}`).env(
`${params.name
.replace(/-/g, '_')
.toUpperCase()}__${optionName.toUpperCase()}`
`${snakeCase(
params.name.replace(/-/g, '_')
).toUpperCase()}__${snakeCase(optionName)
.toUpperCase()
.replace(reg, repl)}`
)
)
}
......
# URL pointing to an L1 RPC provider
MESSAGE_RELAYER__L1RPCPROVIDER=
MESSAGE_RELAYER__L1_RPC_PROVIDER=
# URL pointing to an L2 RPC provider
MESSAGE_RELAYER__L2RPCPROVIDER=
MESSAGE_RELAYER__L2_RPC_PROVIDER=
# Private key for a wallet with ETH on L1
MESSAGE_RELAYER__L1WALLET=
MESSAGE_RELAYER__L1_WALLET=
# Optional, L2 block height to start relaying messages from (default is 0)
MESSAGE_RELAYER__FROML2TRANSACTIONINDEX=
MESSAGE_RELAYER__FROM_L2_TRANSACTION_INDEX=
HEALTHCHECK__REFERENCERPCPROVIDER=https://mainnet.optimism.io
HEALTHCHECK__TARGETRPCPROVIDER=http://localhost:9991
HEALTHCHECK__REFERENCE_RPC_PROVIDER=https://mainnet.optimism.io
HEALTHCHECK__TARGET_RPC_PROVIDER=http://localhost:9991
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment