From ac421d7b35bea4297fe9e9e83879bfb611bd5fb1 Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Tue, 28 Jan 2025 17:56:11 +0400 Subject: [PATCH 1/9] (feat): update image --- zk-chains-docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zk-chains-docker-compose.yml b/zk-chains-docker-compose.yml index b47c0ac..8b17d40 100644 --- a/zk-chains-docker-compose.yml +++ b/zk-chains-docker-compose.yml @@ -68,7 +68,7 @@ services: zksync: stdin_open: true tty: true - image: matterlabs/local-node:hyperlocal + image: matterlabs/local-node:latest2.0_gateway healthcheck: test: curl --fail http://localhost:3071/health || exit 1 interval: 10s From 7f0a07f7a40a3a43fdd5ba07febc5e4c6fc49641 Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Wed, 29 Jan 2025 23:55:48 +0400 Subject: [PATCH 2/9] (test): comment out chains other than main --- zk-chains-docker-compose.yml | 313 ++++++++++++++++++----------------- 1 file changed, 157 insertions(+), 156 deletions(-) diff --git a/zk-chains-docker-compose.yml b/zk-chains-docker-compose.yml index 8b17d40..d7a1b1a 100644 --- a/zk-chains-docker-compose.yml +++ b/zk-chains-docker-compose.yml @@ -38,6 +38,7 @@ services: - RUST_LOG=warn ports: - 127.0.0.1:15045:8545 + - 8545:8545 # Make it accessible inside the network postgres: image: "postgres:14" @@ -92,76 +93,76 @@ services: - zksync_custombase: - stdin_open: true - tty: true - image: matterlabs/local-node:hyperlocal - depends_on: - reth: - condition: service_started - postgres: - condition: service_started - zksync: - condition: service_healthy - healthcheck: - test: curl --fail http://localhost:3071/health || exit 1 - interval: 10s - timeout: 5s - retries: 200 - start_period: 30s - volumes: - - shared_config:/etc/master_env - - shared_tokens:/etc/tokens:ro - ports: - - 127.0.0.1:15200:3050 # JSON RPC HTTP port - - 127.0.0.1:15201:3051 # JSON RPC WS port - environment: - - DATABASE_PROVER_URL=postgres://postgres:notsecurepassword@postgres/prover_custombase - - DATABASE_URL=postgres://postgres:notsecurepassword@postgres/zksync_custombase - - ETH_CLIENT_WEB3_URL=http://reth:8545 - - CHAIN_ETH_ZKSYNC_NETWORK_ID=272 - - IN_DOCKER=true - - MASTER_URL=http://zksync:3050 - - MASTER_HEALTH_URL=http://zksync:3071/health - - MASTER_ENV_FILE=/etc/master_env/dev.env - - CUSTOM_BASE_TOKEN=BAT - - zksync_validium: - stdin_open: true - tty: true - image: matterlabs/local-node:hyperlocal - depends_on: - reth: - condition: service_started - postgres: - condition: service_started - zksync: - condition: service_healthy - zksync_custombase: # daisy chain - condition: service_healthy - healthcheck: - test: curl --fail http://localhost:3071/health || exit 1 - interval: 10s - timeout: 5s - retries: 200 - start_period: 30s - volumes: - - shared_config:/etc/master_env - - shared_tokens:/etc/tokens:ro - ports: - - 127.0.0.1:15300:3050 # JSON RPC HTTP port - - 127.0.0.1:15301:3051 # JSON RPC WS port - environment: - - DATABASE_PROVER_URL=postgres://postgres:notsecurepassword@postgres/prover_validium - - DATABASE_URL=postgres://postgres:notsecurepassword@postgres/zksync_validium - - ETH_CLIENT_WEB3_URL=http://reth:8545 - - CHAIN_ETH_ZKSYNC_NETWORK_ID=273 - - IN_DOCKER=true - - MASTER_URL=http://zksync:3050 - - MASTER_HEALTH_URL=http://zksync_custombase:3071/health ## daisy chain - - MASTER_ENV_FILE=/etc/master_env/dev.env - - CHAIN_STATE_KEEPER_L1_BATCH_COMMIT_DATA_GENERATOR_MODE=Validium - - VALIDIUM_MODE=1 + # zksync_custombase: + # stdin_open: true + # tty: true + # image: matterlabs/local-node:hyperlocal + # depends_on: + # reth: + # condition: service_started + # postgres: + # condition: service_started + # zksync: + # condition: service_healthy + # healthcheck: + # test: curl --fail http://localhost:3071/health || exit 1 + # interval: 10s + # timeout: 5s + # retries: 200 + # start_period: 30s + # volumes: + # - shared_config:/etc/master_env + # - shared_tokens:/etc/tokens:ro + # ports: + # - 127.0.0.1:15200:3050 # JSON RPC HTTP port + # - 127.0.0.1:15201:3051 # JSON RPC WS port + # environment: + # - DATABASE_PROVER_URL=postgres://postgres:notsecurepassword@postgres/prover_custombase + # - DATABASE_URL=postgres://postgres:notsecurepassword@postgres/zksync_custombase + # - ETH_CLIENT_WEB3_URL=http://reth:8545 + # - CHAIN_ETH_ZKSYNC_NETWORK_ID=272 + # - IN_DOCKER=true + # - MASTER_URL=http://zksync:3050 + # - MASTER_HEALTH_URL=http://zksync:3071/health + # - MASTER_ENV_FILE=/etc/master_env/dev.env + # - CUSTOM_BASE_TOKEN=BAT + + # zksync_validium: + # stdin_open: true + # tty: true + # image: matterlabs/local-node:hyperlocal + # depends_on: + # reth: + # condition: service_started + # postgres: + # condition: service_started + # zksync: + # condition: service_healthy + # zksync_custombase: # daisy chain + # condition: service_healthy + # healthcheck: + # test: curl --fail http://localhost:3071/health || exit 1 + # interval: 10s + # timeout: 5s + # retries: 200 + # start_period: 30s + # volumes: + # - shared_config:/etc/master_env + # - shared_tokens:/etc/tokens:ro + # ports: + # - 127.0.0.1:15300:3050 # JSON RPC HTTP port + # - 127.0.0.1:15301:3051 # JSON RPC WS port + # environment: + # - DATABASE_PROVER_URL=postgres://postgres:notsecurepassword@postgres/prover_validium + # - DATABASE_URL=postgres://postgres:notsecurepassword@postgres/zksync_validium + # - ETH_CLIENT_WEB3_URL=http://reth:8545 + # - CHAIN_ETH_ZKSYNC_NETWORK_ID=273 + # - IN_DOCKER=true + # - MASTER_URL=http://zksync:3050 + # - MASTER_HEALTH_URL=http://zksync_custombase:3071/health ## daisy chain + # - MASTER_ENV_FILE=/etc/master_env/dev.env + # - CHAIN_STATE_KEEPER_L1_BATCH_COMMIT_DATA_GENERATOR_MODE=Validium + # - VALIDIUM_MODE=1 data-fetcher_main: platform: linux/amd64 @@ -173,25 +174,25 @@ services: - BLOCKCHAIN_RPC_URL=http://zksync:3050 restart: unless-stopped - data-fetcher_custombase: - platform: linux/amd64 - image: "matterlabs/block-explorer-data-fetcher:latest" - environment: - - PORT=3040 - - LOG_LEVEL=verbose - - NODE_ENV=development - - BLOCKCHAIN_RPC_URL=http://zksync_custombase:3050 - restart: unless-stopped + # data-fetcher_custombase: + # platform: linux/amd64 + # image: "matterlabs/block-explorer-data-fetcher:latest" + # environment: + # - PORT=3040 + # - LOG_LEVEL=verbose + # - NODE_ENV=development + # - BLOCKCHAIN_RPC_URL=http://zksync_custombase:3050 + # restart: unless-stopped - data-fetcher_validium: - platform: linux/amd64 - image: "matterlabs/block-explorer-data-fetcher:latest" - environment: - - PORT=3040 - - LOG_LEVEL=verbose - - NODE_ENV=development - - BLOCKCHAIN_RPC_URL=http://zksync_validium:3050 - restart: unless-stopped + # data-fetcher_validium: + # platform: linux/amd64 + # image: "matterlabs/block-explorer-data-fetcher:latest" + # environment: + # - PORT=3040 + # - LOG_LEVEL=verbose + # - NODE_ENV=development + # - BLOCKCHAIN_RPC_URL=http://zksync_validium:3050 + # restart: unless-stopped @@ -211,38 +212,38 @@ services: - BATCHES_PROCESSING_POLLING_INTERVAL=1000 restart: unless-stopped - worker_custombase: - platform: linux/amd64 - image: "matterlabs/block-explorer-worker:latest" - environment: - - PORT=3001 - - LOG_LEVEL=verbose - - NODE_ENV=development - - DATABASE_HOST=postgres - - DATABASE_USER=postgres - - DATABASE_PASSWORD=notsecurepassword - - DATABASE_NAME=block-explorer_custombase - - BLOCKCHAIN_RPC_URL=http://zksync_custombase:3050 - - DATA_FETCHER_URL=http://data-fetcher_custombase:3040 - - BATCHES_PROCESSING_POLLING_INTERVAL=1000 - restart: unless-stopped - - - worker_validium: - platform: linux/amd64 - image: "matterlabs/block-explorer-worker:latest" - environment: - - PORT=3001 - - LOG_LEVEL=verbose - - NODE_ENV=development - - DATABASE_HOST=postgres - - DATABASE_USER=postgres - - DATABASE_PASSWORD=notsecurepassword - - DATABASE_NAME=block-explorer_validium - - BLOCKCHAIN_RPC_URL=http://zksync_validium:3050 - - DATA_FETCHER_URL=http://data-fetcher_validium:3040 - - BATCHES_PROCESSING_POLLING_INTERVAL=1000 - restart: unless-stopped + # worker_custombase: + # platform: linux/amd64 + # image: "matterlabs/block-explorer-worker:latest" + # environment: + # - PORT=3001 + # - LOG_LEVEL=verbose + # - NODE_ENV=development + # - DATABASE_HOST=postgres + # - DATABASE_USER=postgres + # - DATABASE_PASSWORD=notsecurepassword + # - DATABASE_NAME=block-explorer_custombase + # - BLOCKCHAIN_RPC_URL=http://zksync_custombase:3050 + # - DATA_FETCHER_URL=http://data-fetcher_custombase:3040 + # - BATCHES_PROCESSING_POLLING_INTERVAL=1000 + # restart: unless-stopped + + + # worker_validium: + # platform: linux/amd64 + # image: "matterlabs/block-explorer-worker:latest" + # environment: + # - PORT=3001 + # - LOG_LEVEL=verbose + # - NODE_ENV=development + # - DATABASE_HOST=postgres + # - DATABASE_USER=postgres + # - DATABASE_PASSWORD=notsecurepassword + # - DATABASE_NAME=block-explorer_validium + # - BLOCKCHAIN_RPC_URL=http://zksync_validium:3050 + # - DATA_FETCHER_URL=http://data-fetcher_validium:3040 + # - BATCHES_PROCESSING_POLLING_INTERVAL=1000 + # restart: unless-stopped api_main: @@ -261,36 +262,36 @@ services: restart: unless-stopped - api_custombase: - platform: linux/amd64 - image: "matterlabs/block-explorer-api:latest" - environment: - - PORT=3020 - - METRICS_PORT=3005 - - LOG_LEVEL=verbose - - NODE_ENV=development - - DATABASE_URL=postgres://postgres:notsecurepassword@postgres:5432/block-explorer_custombase - ports: - - '127.0.0.1:15202:3020' - depends_on: - - worker_custombase - restart: unless-stopped - - - api_validium: - platform: linux/amd64 - image: "matterlabs/block-explorer-api:latest" - environment: - - PORT=3020 - - METRICS_PORT=3005 - - LOG_LEVEL=verbose - - NODE_ENV=development - - DATABASE_URL=postgres://postgres:notsecurepassword@postgres:5432/block-explorer_validium - ports: - - '127.0.0.1:15302:3020' - depends_on: - - worker_validium - restart: unless-stopped + # api_custombase: + # platform: linux/amd64 + # image: "matterlabs/block-explorer-api:latest" + # environment: + # - PORT=3020 + # - METRICS_PORT=3005 + # - LOG_LEVEL=verbose + # - NODE_ENV=development + # - DATABASE_URL=postgres://postgres:notsecurepassword@postgres:5432/block-explorer_custombase + # ports: + # - '127.0.0.1:15202:3020' + # depends_on: + # - worker_custombase + # restart: unless-stopped + + + # api_validium: + # platform: linux/amd64 + # image: "matterlabs/block-explorer-api:latest" + # environment: + # - PORT=3020 + # - METRICS_PORT=3005 + # - LOG_LEVEL=verbose + # - NODE_ENV=development + # - DATABASE_URL=postgres://postgres:notsecurepassword@postgres:5432/block-explorer_validium + # ports: + # - '127.0.0.1:15302:3020' + # depends_on: + # - worker_validium + # restart: unless-stopped app: platform: linux/amd64 @@ -303,8 +304,8 @@ services: - '127.0.0.1:15005:3010' depends_on: - api_main - - api_custombase - - api_validium + # - api_custombase + # - api_validium restart: unless-stopped @@ -385,10 +386,10 @@ services: depends_on: zksync: condition: service_healthy - zksync_validium: - condition: service_healthy - zksync_custombase: - condition: service_healthy + # zksync_validium: + # condition: service_healthy + # zksync_custombase: + # condition: service_healthy image: ghcr.io/mm-zk/zksync_tools:latest ports: - 127.0.0.1:15000:5000 From bba8d7cd8305196a1db104919f405524af706d77 Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Fri, 31 Jan 2025 18:06:42 +0400 Subject: [PATCH 3/9] (feat): update the script to fetch DAI token address --- start-zk-chains.sh | 59 +++++++++++--- zk-chains-docker-compose.yml | 148 ++++++++++++++++++----------------- 2 files changed, 122 insertions(+), 85 deletions(-) diff --git a/start-zk-chains.sh b/start-zk-chains.sh index 4d67b17..f7f4c45 100755 --- a/start-zk-chains.sh +++ b/start-zk-chains.sh @@ -1,28 +1,61 @@ #!/usr/bin/env bash -# usage: ./start-zk-chains.sh INSTANCE_TYPE -# Instance type is specifying the docker image to take: -# see https://hub.docker.com/r/matterlabs/local-node/tags for full list. -# latest2.0 - is the 'main' one. +set -e +# usage: ./start-network.sh INSTANCE_TYPE +# Instance type specifies the docker image to take. INSTANCE_TYPE=${1:-latest2.0} export INSTANCE_TYPE=$INSTANCE_TYPE -# Fetch the latest images +# Fetch the latest images and start all services docker compose -f zk-chains-docker-compose.yml pull +docker compose -f zk-chains-docker-compose.yml up -d zksync + +echo "Waiting for zkSync master node to be ready..." +until curl --fail http://localhost:15102/health; do + echo "zkSync not ready yet, sleeping..." + sleep 10 +done + +echo "zkSync is ready. Waiting for token deployment..." +until docker exec local-setup-zksync-1 test -f /configs/erc20.yaml; do + echo "Token config file not found yet, checking again in 5 seconds..." + sleep 5 +done + +echo "Extracting deployed token address from inside zksync container..." +CUSTOM_TOKEN_ADDRESS=$(docker exec local-setup-zksync-1 awk -F": " '/tokens:/ {found_tokens=1} found_tokens && /DAI:/ {found_dai=1} found_dai && /address:/ {print $2; exit}' /configs/erc20.yaml) + +if [ -z "$CUSTOM_TOKEN_ADDRESS" ]; then + echo "❌ Error: Could not retrieve token address. Exiting." + exit 1 +fi + +echo "✅ CUSTOM_TOKEN_ADDRESS=$CUSTOM_TOKEN_ADDRESS" + +# ✅ Write to .env for docker-compose +echo "CUSTOM_BASE_TOKEN=$CUSTOM_TOKEN_ADDRESS" > .env + +# ✅ Restart zksync_custombase with the correct value +docker compose -f zk-chains-docker-compose.yml up -d zksync_custombase + +echo "✅ zksync_custombase started with CUSTOM_BASE_TOKEN=$CUSTOM_TOKEN_ADDRESS" + +# Ensure all services are running +echo "Starting all services..." docker compose -f zk-chains-docker-compose.yml up -d +# Function to check if all services are healthy check_all_services_healthy() { - service="zksync" - (docker compose ps $service | grep "(healthy)") - if [ $? -eq 0 ]; then - return 0 - else - return 1 # If any service is not healthy, return 1 - fi + services=("zksync" "zksync_custombase") + for service in "${services[@]}"; do + if ! docker compose ps "$service" | grep -q "(healthy)"; then + return 1 + fi + done + return 0 } - # Loop until all services are healthy while ! check_all_services_healthy; do echo "Services are not yet healthy, waiting..." diff --git a/zk-chains-docker-compose.yml b/zk-chains-docker-compose.yml index d7a1b1a..29512c2 100644 --- a/zk-chains-docker-compose.yml +++ b/zk-chains-docker-compose.yml @@ -69,7 +69,7 @@ services: zksync: stdin_open: true tty: true - image: matterlabs/local-node:latest2.0_gateway + image: matterlabs/local-node:latest2.0_gateway_test healthcheck: test: curl --fail http://localhost:3071/health || exit 1 interval: 10s @@ -79,12 +79,14 @@ services: volumes: - shared_config:/etc/env/target - shared_tokens:/etc/tokens + - shared_configs:/configs # ✅ Share /configs volume with other services depends_on: - reth - postgres ports: - 127.0.0.1:15100:3050 # JSON RPC HTTP port - 127.0.0.1:15101:3051 # JSON RPC WS port + - 127.0.0.1:15102:3071 # ✅ Expose health check port on host environment: - DATABASE_PROVER_URL=postgres://postgres:notsecurepassword@postgres/prover_local - DATABASE_URL=postgres://postgres:notsecurepassword@postgres/zksync_local @@ -93,39 +95,40 @@ services: - # zksync_custombase: - # stdin_open: true - # tty: true - # image: matterlabs/local-node:hyperlocal - # depends_on: - # reth: - # condition: service_started - # postgres: - # condition: service_started - # zksync: - # condition: service_healthy - # healthcheck: - # test: curl --fail http://localhost:3071/health || exit 1 - # interval: 10s - # timeout: 5s - # retries: 200 - # start_period: 30s - # volumes: - # - shared_config:/etc/master_env - # - shared_tokens:/etc/tokens:ro - # ports: - # - 127.0.0.1:15200:3050 # JSON RPC HTTP port - # - 127.0.0.1:15201:3051 # JSON RPC WS port - # environment: - # - DATABASE_PROVER_URL=postgres://postgres:notsecurepassword@postgres/prover_custombase - # - DATABASE_URL=postgres://postgres:notsecurepassword@postgres/zksync_custombase - # - ETH_CLIENT_WEB3_URL=http://reth:8545 - # - CHAIN_ETH_ZKSYNC_NETWORK_ID=272 - # - IN_DOCKER=true - # - MASTER_URL=http://zksync:3050 - # - MASTER_HEALTH_URL=http://zksync:3071/health - # - MASTER_ENV_FILE=/etc/master_env/dev.env - # - CUSTOM_BASE_TOKEN=BAT + zksync_custombase: + stdin_open: true + tty: true + image: matterlabs/local-node:latest2.0_gateway_test + depends_on: + reth: + condition: service_started + postgres: + condition: service_started + zksync: + condition: service_healthy + healthcheck: + test: curl --fail http://localhost:3071/health || exit 1 + interval: 10s + timeout: 5s + retries: 200 + start_period: 30s + volumes: + - shared_config:/etc/master_env + - shared_tokens:/etc/tokens:ro + - shared_configs:/configs # ✅ Mount /configs from zksync (era) into zksync_custombase + ports: + - 127.0.0.1:15200:3050 # JSON RPC HTTP port + - 127.0.0.1:15201:3051 # JSON RPC WS port + environment: + - DATABASE_PROVER_URL=postgres://postgres:notsecurepassword@postgres/prover_custombase + - DATABASE_URL=postgres://postgres:notsecurepassword@postgres/zksync_custombase + - ETH_CLIENT_WEB3_URL=http://reth:8545 + - CHAIN_ETH_ZKSYNC_NETWORK_ID=272 + - IN_DOCKER=true + - MASTER_URL=http://zksync:3050 + - MASTER_HEALTH_URL=http://zksync:3071/health + - MASTER_ENV_FILE=/etc/master_env/dev.env + - CUSTOM_TOKEN_ADDRESS=${CUSTOM_BASE_TOKEN} # zksync_validium: # stdin_open: true @@ -174,15 +177,15 @@ services: - BLOCKCHAIN_RPC_URL=http://zksync:3050 restart: unless-stopped - # data-fetcher_custombase: - # platform: linux/amd64 - # image: "matterlabs/block-explorer-data-fetcher:latest" - # environment: - # - PORT=3040 - # - LOG_LEVEL=verbose - # - NODE_ENV=development - # - BLOCKCHAIN_RPC_URL=http://zksync_custombase:3050 - # restart: unless-stopped + data-fetcher_custombase: + platform: linux/amd64 + image: "matterlabs/block-explorer-data-fetcher:latest" + environment: + - PORT=3040 + - LOG_LEVEL=verbose + - NODE_ENV=development + - BLOCKCHAIN_RPC_URL=http://zksync_custombase:3050 + restart: unless-stopped # data-fetcher_validium: # platform: linux/amd64 @@ -212,21 +215,21 @@ services: - BATCHES_PROCESSING_POLLING_INTERVAL=1000 restart: unless-stopped - # worker_custombase: - # platform: linux/amd64 - # image: "matterlabs/block-explorer-worker:latest" - # environment: - # - PORT=3001 - # - LOG_LEVEL=verbose - # - NODE_ENV=development - # - DATABASE_HOST=postgres - # - DATABASE_USER=postgres - # - DATABASE_PASSWORD=notsecurepassword - # - DATABASE_NAME=block-explorer_custombase - # - BLOCKCHAIN_RPC_URL=http://zksync_custombase:3050 - # - DATA_FETCHER_URL=http://data-fetcher_custombase:3040 - # - BATCHES_PROCESSING_POLLING_INTERVAL=1000 - # restart: unless-stopped + worker_custombase: + platform: linux/amd64 + image: "matterlabs/block-explorer-worker:latest" + environment: + - PORT=3001 + - LOG_LEVEL=verbose + - NODE_ENV=development + - DATABASE_HOST=postgres + - DATABASE_USER=postgres + - DATABASE_PASSWORD=notsecurepassword + - DATABASE_NAME=block-explorer_custombase + - BLOCKCHAIN_RPC_URL=http://zksync_custombase:3050 + - DATA_FETCHER_URL=http://data-fetcher_custombase:3040 + - BATCHES_PROCESSING_POLLING_INTERVAL=1000 + restart: unless-stopped # worker_validium: @@ -262,20 +265,20 @@ services: restart: unless-stopped - # api_custombase: - # platform: linux/amd64 - # image: "matterlabs/block-explorer-api:latest" - # environment: - # - PORT=3020 - # - METRICS_PORT=3005 - # - LOG_LEVEL=verbose - # - NODE_ENV=development - # - DATABASE_URL=postgres://postgres:notsecurepassword@postgres:5432/block-explorer_custombase - # ports: - # - '127.0.0.1:15202:3020' - # depends_on: - # - worker_custombase - # restart: unless-stopped + api_custombase: + platform: linux/amd64 + image: "matterlabs/block-explorer-api:latest" + environment: + - PORT=3020 + - METRICS_PORT=3005 + - LOG_LEVEL=verbose + - NODE_ENV=development + - DATABASE_URL=postgres://postgres:notsecurepassword@postgres:5432/block-explorer_custombase + ports: + - '127.0.0.1:15202:3020' + depends_on: + - worker_custombase + restart: unless-stopped # api_validium: @@ -401,3 +404,4 @@ volumes: reth: shared_config: shared_tokens: + shared_configs: # ✅ Shared volume for /configs From 0eb57b2ce08372b5d97b8a5fe835771499690d05 Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Fri, 31 Jan 2025 20:20:22 +0400 Subject: [PATCH 4/9] (fix): rename all instances of custom_token_address --- start-zk-chains.sh | 2 +- zk-chains-docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/start-zk-chains.sh b/start-zk-chains.sh index f7f4c45..34d9f8d 100755 --- a/start-zk-chains.sh +++ b/start-zk-chains.sh @@ -34,7 +34,7 @@ fi echo "✅ CUSTOM_TOKEN_ADDRESS=$CUSTOM_TOKEN_ADDRESS" # ✅ Write to .env for docker-compose -echo "CUSTOM_BASE_TOKEN=$CUSTOM_TOKEN_ADDRESS" > .env +echo "CUSTOM_TOKEN_ADDRESS=$CUSTOM_TOKEN_ADDRESS" > .env # ✅ Restart zksync_custombase with the correct value docker compose -f zk-chains-docker-compose.yml up -d zksync_custombase diff --git a/zk-chains-docker-compose.yml b/zk-chains-docker-compose.yml index 29512c2..9c98bee 100644 --- a/zk-chains-docker-compose.yml +++ b/zk-chains-docker-compose.yml @@ -128,7 +128,7 @@ services: - MASTER_URL=http://zksync:3050 - MASTER_HEALTH_URL=http://zksync:3071/health - MASTER_ENV_FILE=/etc/master_env/dev.env - - CUSTOM_TOKEN_ADDRESS=${CUSTOM_BASE_TOKEN} + - CUSTOM_TOKEN_ADDRESS=${CUSTOM_TOKEN_ADDRESS} # zksync_validium: # stdin_open: true From dc77f57122b906fc76d59738fd716be635f26d54 Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Mon, 3 Feb 2025 18:18:14 +0400 Subject: [PATCH 5/9] (fix): remove overlapping port --- zk-chains-docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zk-chains-docker-compose.yml b/zk-chains-docker-compose.yml index 9c98bee..41fcf5e 100644 --- a/zk-chains-docker-compose.yml +++ b/zk-chains-docker-compose.yml @@ -86,7 +86,7 @@ services: ports: - 127.0.0.1:15100:3050 # JSON RPC HTTP port - 127.0.0.1:15101:3051 # JSON RPC WS port - - 127.0.0.1:15102:3071 # ✅ Expose health check port on host + # - 127.0.0.1:15102:3071 # ✅ Expose health check port on host environment: - DATABASE_PROVER_URL=postgres://postgres:notsecurepassword@postgres/prover_local - DATABASE_URL=postgres://postgres:notsecurepassword@postgres/zksync_local From 55c18220727f584a78d17fccde86b42a3fde041c Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Tue, 4 Feb 2025 16:40:04 +0400 Subject: [PATCH 6/9] (fix): expose health port --- zk-chains-docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zk-chains-docker-compose.yml b/zk-chains-docker-compose.yml index 41fcf5e..9c98bee 100644 --- a/zk-chains-docker-compose.yml +++ b/zk-chains-docker-compose.yml @@ -86,7 +86,7 @@ services: ports: - 127.0.0.1:15100:3050 # JSON RPC HTTP port - 127.0.0.1:15101:3051 # JSON RPC WS port - # - 127.0.0.1:15102:3071 # ✅ Expose health check port on host + - 127.0.0.1:15102:3071 # ✅ Expose health check port on host environment: - DATABASE_PROVER_URL=postgres://postgres:notsecurepassword@postgres/prover_local - DATABASE_URL=postgres://postgres:notsecurepassword@postgres/zksync_local From c73521a70ca5dd316cfbd8d67ac133e785a08d29 Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Tue, 4 Feb 2025 17:02:09 +0400 Subject: [PATCH 7/9] (fix): expose health port --- zk-chains-docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zk-chains-docker-compose.yml b/zk-chains-docker-compose.yml index 9c98bee..b07abd0 100644 --- a/zk-chains-docker-compose.yml +++ b/zk-chains-docker-compose.yml @@ -259,7 +259,7 @@ services: - NODE_ENV=development - DATABASE_URL=postgres://postgres:notsecurepassword@postgres:5432/block-explorer ports: - - '127.0.0.1:15102:3020' + - '127.0.0.1:15103:3020' depends_on: - worker_main restart: unless-stopped From f1fc24de6206cdb3f742710f7fc5ad39df25ea40 Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Tue, 4 Feb 2025 17:44:43 +0400 Subject: [PATCH 8/9] (fix): incorrect health check --- start-zk-chains.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start-zk-chains.sh b/start-zk-chains.sh index 34d9f8d..acf9329 100755 --- a/start-zk-chains.sh +++ b/start-zk-chains.sh @@ -49,7 +49,7 @@ docker compose -f zk-chains-docker-compose.yml up -d check_all_services_healthy() { services=("zksync" "zksync_custombase") for service in "${services[@]}"; do - if ! docker compose ps "$service" | grep -q "(healthy)"; then + if ! docker compose -f zk-chains-docker-compose.yml ps "$service" | grep -q "(healthy)"; then return 1 fi done From 9efbc53bbdabb0783e7560f4390a10ba68cd0f17 Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Wed, 5 Feb 2025 19:52:19 +0400 Subject: [PATCH 9/9] (fix): replace custom toke to wbtc + provide correct health port --- start-zk-chains.sh | 2 +- zk-chains-docker-compose.yml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/start-zk-chains.sh b/start-zk-chains.sh index acf9329..63c2da1 100755 --- a/start-zk-chains.sh +++ b/start-zk-chains.sh @@ -24,7 +24,7 @@ until docker exec local-setup-zksync-1 test -f /configs/erc20.yaml; do done echo "Extracting deployed token address from inside zksync container..." -CUSTOM_TOKEN_ADDRESS=$(docker exec local-setup-zksync-1 awk -F": " '/tokens:/ {found_tokens=1} found_tokens && /DAI:/ {found_dai=1} found_dai && /address:/ {print $2; exit}' /configs/erc20.yaml) +CUSTOM_TOKEN_ADDRESS=$(docker exec local-setup-zksync-1 awk -F": " '/tokens:/ {found_tokens=1} found_tokens && /WBTC:/ {found_dai=1} found_dai && /address:/ {print $2; exit}' /configs/erc20.yaml) if [ -z "$CUSTOM_TOKEN_ADDRESS" ]; then echo "❌ Error: Could not retrieve token address. Exiting." diff --git a/zk-chains-docker-compose.yml b/zk-chains-docker-compose.yml index b07abd0..e1c70f5 100644 --- a/zk-chains-docker-compose.yml +++ b/zk-chains-docker-compose.yml @@ -107,7 +107,7 @@ services: zksync: condition: service_healthy healthcheck: - test: curl --fail http://localhost:3071/health || exit 1 + test: curl --fail http://localhost:3171/health || exit 1 interval: 10s timeout: 5s retries: 200 @@ -117,13 +117,13 @@ services: - shared_tokens:/etc/tokens:ro - shared_configs:/configs # ✅ Mount /configs from zksync (era) into zksync_custombase ports: - - 127.0.0.1:15200:3050 # JSON RPC HTTP port - - 127.0.0.1:15201:3051 # JSON RPC WS port + - 127.0.0.1:15200:3150 # JSON RPC HTTP port + - 127.0.0.1:15201:3151 # JSON RPC WS port environment: - DATABASE_PROVER_URL=postgres://postgres:notsecurepassword@postgres/prover_custombase - DATABASE_URL=postgres://postgres:notsecurepassword@postgres/zksync_custombase - ETH_CLIENT_WEB3_URL=http://reth:8545 - - CHAIN_ETH_ZKSYNC_NETWORK_ID=272 + - CHAIN_ETH_ZKSYNC_NETWORK_ID=277 - IN_DOCKER=true - MASTER_URL=http://zksync:3050 - MASTER_HEALTH_URL=http://zksync:3071/health @@ -391,8 +391,8 @@ services: condition: service_healthy # zksync_validium: # condition: service_healthy - # zksync_custombase: - # condition: service_healthy + zksync_custombase: + condition: service_healthy image: ghcr.io/mm-zk/zksync_tools:latest ports: - 127.0.0.1:15000:5000