stack-orchestrator/stack_orchestrator/data/compose/docker-compose-fixturenet-optimism.yml

152 lines
5.0 KiB
YAML
Raw Normal View History

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:
restart: on-failure
image: cerc/optimism-contracts:local
2023-11-10 20:05:22 +00:00
hostname: fixturenet-optimism-contracts
env_file:
- ../config/fixturenet-optimism/l1-params.env
environment:
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
CERC_L1_CHAIN_ID: ${CERC_L1_CHAIN_ID}
CERC_L1_RPC: ${CERC_L1_RPC}
CERC_L1_ACCOUNTS_CSV_URL: ${CERC_L1_ACCOUNTS_CSV_URL}
CERC_L1_ADDRESS: ${CERC_L1_ADDRESS}
CERC_L1_PRIV_KEY: ${CERC_L1_PRIV_KEY}
volumes:
- ../config/network/wait-for-it.sh:/app/packages/contracts-bedrock/wait-for-it.sh
2023-11-10 20:05:22 +00:00
- ../config/fixturenet-optimism/optimism-contracts/deploy-contracts.sh:/app/packages/contracts-bedrock/deploy-contracts.sh
- l2_accounts:/l2-accounts
2023-11-10 20:05:22 +00:00
- l1_deployment:/l1-deployment
- l2_config:/l2-config
# Waits for L1 endpoint to be up before running the contract deploy script
command: |
"./wait-for-it.sh -h ${CERC_L1_HOST:-$${DEFAULT_CERC_L1_HOST}} -p ${CERC_L1_PORT:-$${DEFAULT_CERC_L1_PORT}} -s -t 60 -- ./deploy-contracts.sh"
# Initializes and runs the L2 execution client (outputs to volume l2_geth_data)
op-geth:
restart: always
image: cerc/optimism-l2geth:local
2023-11-10 20:05:22 +00:00
hostname: op-geth
depends_on:
2023-11-10 20:05:22 +00:00
op-node:
condition: service_started
volumes:
- ../config/fixturenet-optimism/run-op-geth.sh:/run-op-geth.sh
2023-11-10 20:05:22 +00:00
- l2_config:/l2-config:ro
- l2_accounts:/l2-accounts:ro
- l2_geth_data:/datadir
entrypoint: "sh"
command: "/run-op-geth.sh"
ports:
2023-11-10 20:05:22 +00:00
- "8545"
- "8546"
healthcheck:
test: ["CMD", "nc", "-vz", "localhost:8545"]
interval: 30s
timeout: 10s
2023-11-10 20:05:22 +00:00
retries: 100
start_period: 10s
2023-11-10 20:05:22 +00:00
extra_hosts:
- "host.docker.internal:host-gateway"
# Runs the L2 consensus client (Sequencer node)
2023-11-10 20:05:22 +00:00
# Generates the L2 config files if not already present (outputs to volume l2_config)
op-node:
restart: always
image: cerc/optimism-op-node:local
2023-11-10 20:05:22 +00:00
hostname: op-node
depends_on:
2023-11-10 20:05:22 +00:00
fixturenet-optimism-contracts:
condition: service_completed_successfully
env_file:
- ../config/fixturenet-optimism/l1-params.env
environment:
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
CERC_L1_RPC: ${CERC_L1_RPC}
volumes:
2023-11-10 20:05:22 +00:00
- ../config/fixturenet-optimism/run-op-node.sh:/run-op-node.sh
- l1_deployment:/l1-deployment:ro
- l2_config:/l2-config
- l2_accounts:/l2-accounts:ro
2023-11-10 20:05:22 +00:00
entrypoint: "sh"
command: "/run-op-node.sh"
ports:
2023-11-10 20:05:22 +00:00
- "8547"
healthcheck:
test: ["CMD", "nc", "-vz", "localhost:8547"]
interval: 30s
timeout: 10s
2023-11-10 20:05:22 +00:00
retries: 100
start_period: 10s
extra_hosts:
- "host.docker.internal:host-gateway"
# Runs the batcher (takes transactions from the Sequencer and publishes them to L1)
op-batcher:
restart: always
image: cerc/optimism-op-batcher:local
2023-11-10 20:05:22 +00:00
hostname: op-batcher
depends_on:
op-node:
condition: service_healthy
op-geth:
condition: service_healthy
env_file:
- ../config/fixturenet-optimism/l1-params.env
environment:
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
CERC_L1_RPC: ${CERC_L1_RPC}
volumes:
- ../config/network/wait-for-it.sh:/wait-for-it.sh
- ../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 ${CERC_L1_HOST:-$${DEFAULT_CERC_L1_HOST}} -p ${CERC_L1_PORT:-$${DEFAULT_CERC_L1_PORT}} -s -t 60 -- /run-op-batcher.sh"
ports:
2023-11-10 20:05:22 +00:00
- "8548"
extra_hosts:
- "host.docker.internal:host-gateway"
# Runs the proposer (periodically submits new state roots to L1)
op-proposer:
restart: always
image: cerc/optimism-op-proposer:local
2023-11-10 20:05:22 +00:00
hostname: op-proposer
depends_on:
op-node:
condition: service_healthy
2023-11-10 20:05:22 +00:00
op-geth:
condition: service_healthy
env_file:
- ../config/fixturenet-optimism/l1-params.env
environment:
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
CERC_L1_RPC: ${CERC_L1_RPC}
2023-11-10 20:05:22 +00:00
CERC_L1_CHAIN_ID: ${CERC_L1_CHAIN_ID}
volumes:
- ../config/network/wait-for-it.sh:/wait-for-it.sh
- ../config/fixturenet-optimism/run-op-proposer.sh:/run-op-proposer.sh
2023-11-10 20:05:22 +00:00
- l1_deployment:/l1-deployment:ro
- l2_accounts:/l2-accounts:ro
entrypoint: ["sh", "-c"]
# Waits for L1 endpoint to be up before running the proposer
command: |
"/wait-for-it.sh -h ${CERC_L1_HOST:-$${DEFAULT_CERC_L1_HOST}} -p ${CERC_L1_PORT:-$${DEFAULT_CERC_L1_PORT}} -s -t 60 -- /run-op-proposer.sh"
ports:
2023-11-10 20:05:22 +00:00
- "8560"
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
l1_deployment:
l2_accounts:
l2_config:
l2_geth_data: