Skip to content

Commit

Permalink
support custom names
Browse files Browse the repository at this point in the history
  • Loading branch information
mm-zk committed Apr 17, 2024
1 parent 6468e97 commit d90c36c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
7 changes: 3 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.2'
services:
reth:
restart: always
Expand All @@ -24,7 +23,7 @@ services:
zksync:
stdin_open: true
tty: true
image: matterlabs/local-node:mmzk_0416-1
image: matterlabs/local-node:${INSTANCE_TYPE}
healthcheck:
test: curl --fail http://localhost:3071/health || exit 1
interval: 10s
Expand All @@ -35,8 +34,8 @@ services:
- reth
- postgres
ports:
- "3050:3050" # JSON RPC HTTP port
- "3051:3051" # JSON RPC WS port
- 127.0.0.1:3050:3050 # JSON RPC HTTP port
- 127.0.0.1:3051:3051 # JSON RPC WS port
environment:
- DATABASE_PROVER_URL=postgres://postgres:notsecurepassword@postgres/prover_local
- DATABASE_URL=postgres://postgres:notsecurepassword@postgres/zksync_local
Expand Down
30 changes: 30 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,32 @@
#!/usr/bin/env bash
# docker compose up -d

# usage: ./start.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.

INSTANCE_TYPE=${1:-latest2.0}

export INSTANCE_TYPE=$INSTANCE_TYPE
docker compose up -d


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
}


# Loop until all services are healthy
while ! check_all_services_healthy; do
echo "Services are not yet healthy, waiting..."
sleep 10 # Check every 10 seconds
done

echo "All services are healthy!"

0 comments on commit d90c36c

Please sign in to comment.