From ee1a296d67befd0de09f7023b66fa735ddfc9fa2 Mon Sep 17 00:00:00 2001 From: prathamesh0 Date: Tue, 4 Apr 2023 12:04:29 +0530 Subject: [PATCH] Add descriptions for services --- app/data/compose/docker-compose-fixturenet-optimism.yml | 9 +++++++++ .../config/fixturenet-optimism/optimism-contracts/run.sh | 1 + app/data/stacks/fixturenet-optimism/README.md | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/data/compose/docker-compose-fixturenet-optimism.yml b/app/data/compose/docker-compose-fixturenet-optimism.yml index 904d8552..732f1172 100644 --- a/app/data/compose/docker-compose-fixturenet-optimism.yml +++ b/app/data/compose/docker-compose-fixturenet-optimism.yml @@ -1,11 +1,15 @@ version: '3.7' services: + # Generates and funds the accounts required when setting up the L2 chain (outputs to volume l2_accounts) + # Creates / updates the configuration for L1 contracts deployment + # Deploys the L1 smart contracts (outputs to volume l1_deployment) fixturenet-optimism-contracts: hostname: fixturenet-optimism-contracts image: cerc/optimism-contracts:local env_file: - ../config/fixturenet-optimism/.env + # Waits for L1 endpoint to be up before running the script command: | "./wait-for-it.sh -h $${L1_HOST} -p $${L1_PORT} -s -t 60 -- ./run.sh" volumes: @@ -20,6 +24,7 @@ services: extra_hosts: - "host.docker.internal:host-gateway" + # Generates the config files required for L2 (outputs to volume op_node_data) op-node-l2-config-gen: image: cerc/optimism-op-node:local depends_on: @@ -35,6 +40,7 @@ services: extra_hosts: - "host.docker.internal:host-gateway" + # Initializes and runs the L2 execution client op-geth: image: cerc/optimism-l2geth:local depends_on: @@ -55,6 +61,7 @@ services: retries: 10 start_period: 10s + # Runs the L2 consensus client (Sequencer node) op-node: env_file: - ../config/fixturenet-optimism/.env @@ -78,6 +85,7 @@ services: extra_hosts: - "host.docker.internal:host-gateway" + # Runs the batcher (takes transactions from the Sequencer and publishes them to L1) op-batcher: env_file: - ../config/fixturenet-optimism/.env @@ -92,6 +100,7 @@ services: - ../config/fixturenet-optimism/run-op-batcher.sh:/run-op-batcher.sh - l2_accounts:/l2-accounts:ro entrypoint: ["sh", "-c"] + # Waits for L1 endpoint to be up before running the batcher command: | "/wait-for-it.sh -h $${L1_HOST} -p $${L1_PORT} -s -t 60 -- /run-op-batcher.sh" extra_hosts: diff --git a/app/data/config/fixturenet-optimism/optimism-contracts/run.sh b/app/data/config/fixturenet-optimism/optimism-contracts/run.sh index e8775121..41910e27 100755 --- a/app/data/config/fixturenet-optimism/optimism-contracts/run.sh +++ b/app/data/config/fixturenet-optimism/optimism-contracts/run.sh @@ -12,6 +12,7 @@ fi # fi export L1_RPC="http://${L1_HOST}:${L1_PORT}" +echo "Using L1 RPC endpoint ${L1_RPC}" # Append tasks/index.ts file echo "import './rekey-json'" >> tasks/index.ts diff --git a/app/data/stacks/fixturenet-optimism/README.md b/app/data/stacks/fixturenet-optimism/README.md index f432fbc5..f3187465 100644 --- a/app/data/stacks/fixturenet-optimism/README.md +++ b/app/data/stacks/fixturenet-optimism/README.md @@ -43,7 +43,8 @@ This should create the required docker images in the local image registry: ## Deploy -(Optional) Update the [.env](../../config/fixturenet-optimism/.env) file with L1 endpoint and other params if running L1 separately (use `host.docker.internal` as `L1_HOST` to access a host port) +(Optional) Update the [.env](../../config/fixturenet-optimism/.env) file with L1 endpoint (`L1_HOST` and `L1_PORT`) and other params if running L1 separately + * NOTE: If L1 is running on the host machine, use `host.docker.internal` as `L1_HOST` to access the host port Deploy the stack: