From 48daffe844c8e4fb937ee90a6a2c6e9c8c27b1c4 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Wed, 4 Sep 2024 11:02:25 +0530 Subject: [PATCH 1/2] Add extra_hosts for l2-config-generation service --- compose/docker-compose-fixturenet-optimism.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compose/docker-compose-fixturenet-optimism.yml b/compose/docker-compose-fixturenet-optimism.yml index 0115341..b2f59ab 100644 --- a/compose/docker-compose-fixturenet-optimism.yml +++ b/compose/docker-compose-fixturenet-optimism.yml @@ -49,6 +49,8 @@ services: - l2_config:/l2-config entrypoint: "bash" command: "/generate-l2-config.sh" + extra_hosts: + - "host.docker.internal:host-gateway" # Initializes and runs the L2 execution client (outputs to volume l2_geth_data) op-geth: -- 2.45.2 From 9ddee26c8ba2aa58a0e2b6ff859e561f8805f030 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 4 Sep 2024 19:29:33 +0530 Subject: [PATCH 2/2] Generate JWT token while generating L2 config --- config/fixturenet-optimism/generate-l2-config.sh | 7 +++++++ .../optimism-contracts/deploy-contracts.sh | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config/fixturenet-optimism/generate-l2-config.sh b/config/fixturenet-optimism/generate-l2-config.sh index 4274dd7..68aa95e 100644 --- a/config/fixturenet-optimism/generate-l2-config.sh +++ b/config/fixturenet-optimism/generate-l2-config.sh @@ -14,6 +14,13 @@ l1_deployment_file="/l1-deployment/$DEPLOYMENT_CONTEXT-deploy.json" l2_allocs_file="/l2-config/allocs-l2.json" genesis_outfile="/l2-config/genesis.json" rollup_outfile="/l2-config/rollup.json" +jwt_file="/l2-config/l2-jwt.txt" + +# Create a JWT secret at shared path if not found +if [ ! -f "$jwt_file" ]; then + openssl rand -hex 32 > $jwt_file + echo "Generated JWT secret at $jwt_file" +fi # Check if genesis.json and rollup.json already exist if [ -f "$genesis_outfile" ] && [ -f "$rollup_outfile" ]; then diff --git a/config/fixturenet-optimism/optimism-contracts/deploy-contracts.sh b/config/fixturenet-optimism/optimism-contracts/deploy-contracts.sh index 6e48070..d834607 100755 --- a/config/fixturenet-optimism/optimism-contracts/deploy-contracts.sh +++ b/config/fixturenet-optimism/optimism-contracts/deploy-contracts.sh @@ -177,6 +177,5 @@ echo "Copying deployment artifacts volume l1_deployment and deploy-config to vol cp /app/packages/contracts-bedrock/deployments/$DEPLOYMENT_CONTEXT-deploy.json /l1-deployment cp /app/packages/contracts-bedrock/deploy-config/$DEPLOYMENT_CONTEXT.json /l2-config cp allocs-l2.json /l2-config -openssl rand -hex 32 > /l2-config/l2-jwt.txt echo "Deployment successful. Exiting" -- 2.45.2