From c7ca93417c947c69135f9885fc1023db04f0060d Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Sat, 31 Aug 2024 18:34:25 +0800 Subject: [PATCH] Configure rpc kind from env --- compose/docker-compose-fixturenet-optimism.yml | 1 + config/fixturenet-optimism/l1-params.env | 5 ++++- config/fixturenet-optimism/run-op-node.sh | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/compose/docker-compose-fixturenet-optimism.yml b/compose/docker-compose-fixturenet-optimism.yml index 2354419..970c92a 100644 --- a/compose/docker-compose-fixturenet-optimism.yml +++ b/compose/docker-compose-fixturenet-optimism.yml @@ -91,6 +91,7 @@ services: environment: - CERC_SCRIPT_DEBUG - CERC_L1_RPC + - CERC_L1_RPC_KIND - CERC_L1_BLOCK_TIME volumes: - ../config/fixturenet-optimism/run-op-node.sh:/run-op-node.sh diff --git a/config/fixturenet-optimism/l1-params.env b/config/fixturenet-optimism/l1-params.env index b7c993f..0d3b206 100644 --- a/config/fixturenet-optimism/l1-params.env +++ b/config/fixturenet-optimism/l1-params.env @@ -6,8 +6,11 @@ DEFAULT_CERC_L1_RPC="http://fixturenet-eth-geth-1:8545" DEFAULT_CERC_L1_HOST="fixturenet-eth-geth-1" DEFAULT_CERC_L1_PORT=8545 -# Default block time to match L1 fixturenet config +# Default block time matches L1 fixturenet config. DEFAULT_CERC_L1_BLOCK_TIME=3 +# This can optionally be set to a preset for common node providers like Infura, Alchemy, etc. +# Or, set to "any" to try all available methods. +DEFAULT_CERC_L1_RPC_KIND=standard # URL to get CSV with credentials for accounts on L1 # that are used to send balance to Optimism Proxy contract diff --git a/config/fixturenet-optimism/run-op-node.sh b/config/fixturenet-optimism/run-op-node.sh index 0b1e5e2..3413897 100755 --- a/config/fixturenet-optimism/run-op-node.sh +++ b/config/fixturenet-optimism/run-op-node.sh @@ -5,6 +5,7 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then fi CERC_L1_RPC="${CERC_L1_RPC:-${DEFAULT_CERC_L1_RPC}}" +CERC_L1_RPC_KIND="${CERC_L1_RPC_KIND:-${DEFAULT_CERC_L1_RPC_KIND}}" CERC_L1_BLOCK_TIME="${CERC_L1_BLOCK_TIME:-$DEFAULT_CERC_L1_BLOCK_TIME}" # Start op-node @@ -12,7 +13,6 @@ rollup_config=/l2-config/rollup.json seq_key=$(cat /l2-accounts/accounts.json | jq -r .SeqKey) jwt_file=/l2-config/l2-jwt.txt l2_auth="http://op-geth:8551" -rpc_kind=any # this can optionally be set to a preset for common node providers like Infura, Alchemy, etc. exec op-node \ --l2=$l2_auth \ @@ -27,7 +27,7 @@ exec op-node \ --rpc.enable-admin \ --p2p.sequencer.key="${SEQ_KEY#0x}" \ --l1=$CERC_L1_RPC \ - --l1.rpckind=$rpc_kind \ + --l1.rpckind=$CERC_L1_RPC_KIND \ --l1.beacon=http://fixturenet-eth-lighthouse-1:8001 \ --l1.http-poll-interval="${CERC_L1_BLOCK_TIME}s" \ --l1.epoch-poll-interval="$((CERC_L1_BLOCK_TIME * 32))s"