diff --git a/README.md b/README.md index 6b72376..f4b31d6 100644 --- a/README.md +++ b/README.md @@ -76,9 +76,13 @@ Will start a hyperchain with 3 L2s, L1 and necessary explorers. To run: ```shell +# to fetch the latest images +docker compose -f hyperchain-docker-compose.yml pull + docker compose -f hyperchain-docker-compose.yml up -d ``` +Afterwards, you'll have explorers available at http://localhost:15000 http://localhost:15001 and http://localhost:15005 ### Manual transfer to hyperchains diff --git a/explorer_mapping.js b/explorer_mapping.js index e68e069..6045947 100644 --- a/explorer_mapping.js +++ b/explorer_mapping.js @@ -7,12 +7,12 @@ const e = [ { apiUrl: "http://localhost:15202", bridgeUrl: "http://localhost:3000/bridge", hostnames: [ "localhost" - ], icon: "/images/icons/zksync-arrows.svg", l2ChainId: 272, l2NetworkName: "Slave", maintenance: !1, name: "local_slave1", published: !0, rpcUrl: "http://localhost:15200" + ], icon: "/images/icons/zksync-arrows.svg", l2ChainId: 272, l2NetworkName: "CustomBase", maintenance: !1, name: "local_custombase", published: !0, rpcUrl: "http://localhost:15200" }, { apiUrl: "http://localhost:15302", bridgeUrl: "http://localhost:3000/bridge", hostnames: [ "localhost" - ], icon: "/images/icons/zksync-arrows.svg", l2ChainId: 273, l2NetworkName: "Slave2", maintenance: !1, name: "local_slave2", published: !0, rpcUrl: "http://localhost:15300" + ], icon: "/images/icons/zksync-arrows.svg", l2ChainId: 273, l2NetworkName: "Validium", maintenance: !1, name: "local_validium", published: !0, rpcUrl: "http://localhost:15300" } ]; var s = { diff --git a/hyperchain-docker-compose.yml b/hyperchain-docker-compose.yml index b7c8908..eb96cae 100644 --- a/hyperchain-docker-compose.yml +++ b/hyperchain-docker-compose.yml @@ -2,7 +2,7 @@ # # - L1 (reth) with explorer (blockscout) # - a single postgres (with all the databases) -# - 3 zksync chains (with ids 270, 272, 273) - 'master', 'slave', 'slave2' +# - 3 zksync chains (with ids 270, 272, 273) - 'master', 'custombase', 'validium' # - together with their explorers # - hyperexplorer to merge it all together. @@ -19,7 +19,7 @@ # - 15101 - ws # - 15102 - explorer api # -# So 15100 - 'master', 15200 - 'slave', 15300 - 'slave2' +# So 15100 - 'master', 15200 - 'custombase', 15300 - 'validium' # Database is on 15432 # pgAdmin to manage PostgreSQL DB is on 15430 @@ -77,6 +77,7 @@ services: start_period: 30s volumes: - shared_config:/etc/env/target + - shared_tokens:/etc/tokens depends_on: - reth - postgres @@ -90,57 +91,76 @@ services: - zksync_slave: + zksync_custombase: stdin_open: true tty: true image: matterlabs/local-node:hyperlocal depends_on: - - reth - - postgres - - zksync + 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_slave - - DATABASE_URL=postgres://postgres:notsecurepassword@postgres/zksync_slave + - 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_slave2: + zksync_validium: stdin_open: true tty: true image: matterlabs/local-node:hyperlocal depends_on: - - reth - - postgres - - zksync - - zksync_slave # daisy chain + 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_slave2 - - DATABASE_URL=postgres://postgres:notsecurepassword@postgres/zksync_slave2 + - 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_slave:3071/health ## daisy chain + - 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 @@ -152,24 +172,24 @@ services: - BLOCKCHAIN_RPC_URL=http://zksync:3050 restart: unless-stopped - data-fetcher_slave: + 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_slave:3050 + - BLOCKCHAIN_RPC_URL=http://zksync_custombase:3050 restart: unless-stopped - data-fetcher_slave2: + 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_slave2:3050 + - BLOCKCHAIN_RPC_URL=http://zksync_validium:3050 restart: unless-stopped @@ -190,7 +210,7 @@ services: - BATCHES_PROCESSING_POLLING_INTERVAL=1000 restart: unless-stopped - worker_slave: + worker_custombase: platform: linux/amd64 image: "matterlabs/block-explorer-worker:latest" environment: @@ -200,14 +220,14 @@ services: - DATABASE_HOST=postgres - DATABASE_USER=postgres - DATABASE_PASSWORD=notsecurepassword - - DATABASE_NAME=block-explorer_slave - - BLOCKCHAIN_RPC_URL=http://zksync_slave:3050 - - DATA_FETCHER_URL=http://data-fetcher_slave:3040 + - 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_slave2: + worker_validium: platform: linux/amd64 image: "matterlabs/block-explorer-worker:latest" environment: @@ -217,9 +237,9 @@ services: - DATABASE_HOST=postgres - DATABASE_USER=postgres - DATABASE_PASSWORD=notsecurepassword - - DATABASE_NAME=block-explorer_slave2 - - BLOCKCHAIN_RPC_URL=http://zksync_slave2:3050 - - DATA_FETCHER_URL=http://data-fetcher_slave2:3040 + - 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 @@ -240,7 +260,7 @@ services: restart: unless-stopped - api_slave: + api_custombase: platform: linux/amd64 image: "matterlabs/block-explorer-api:latest" environment: @@ -248,15 +268,15 @@ services: - METRICS_PORT=3005 - LOG_LEVEL=verbose - NODE_ENV=development - - DATABASE_URL=postgres://postgres:notsecurepassword@postgres:5432/block-explorer_slave + - DATABASE_URL=postgres://postgres:notsecurepassword@postgres:5432/block-explorer_custombase ports: - '127.0.0.1:15202:3020' depends_on: - - worker_slave + - worker_custombase restart: unless-stopped - api_slave2: + api_validium: platform: linux/amd64 image: "matterlabs/block-explorer-api:latest" environment: @@ -264,11 +284,11 @@ services: - METRICS_PORT=3005 - LOG_LEVEL=verbose - NODE_ENV=development - - DATABASE_URL=postgres://postgres:notsecurepassword@postgres:5432/block-explorer_slave2 + - DATABASE_URL=postgres://postgres:notsecurepassword@postgres:5432/block-explorer_validium ports: - '127.0.0.1:15302:3020' depends_on: - - worker_slave2 + - worker_validium restart: unless-stopped app: @@ -282,8 +302,8 @@ services: - '127.0.0.1:15005:3010' depends_on: - api_main - - api_slave - - api_slave2 + - api_custombase + - api_validium restart: unless-stopped @@ -364,7 +384,10 @@ services: depends_on: zksync: 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 @@ -375,3 +398,4 @@ services: volumes: reth: shared_config: + shared_tokens: diff --git a/hyperexplorer.json b/hyperexplorer.json index 6ebceb1..e645965 100644 --- a/hyperexplorer.json +++ b/hyperexplorer.json @@ -14,16 +14,16 @@ "explorer": "http://localhost:15005/?network=local", "type": "rollup" }, - "slave1": { + "custombase": { "chain_id": "0x110", - "l2_url": "http://zksync_slave:3050", - "explorer": "http://localhost:15005/?network=local_slave1", + "l2_url": "http://zksync_custombase:3050", + "explorer": "http://localhost:15005/?network=local_custombase", "type": "rollup" }, - "slave2": { + "validium": { "chain_id": "0x111", - "l2_url": "http://zksync_slave2:3050", - "explorer": "http://localhost:15005/?network=local_slave2", + "l2_url": "http://zksync_validium:3050", + "explorer": "http://localhost:15005/?network=local_validium", "type": "rollup" } } diff --git a/init.sql b/init.sql index 45fce30..47fa24f 100644 --- a/init.sql +++ b/init.sql @@ -1,3 +1,3 @@ CREATE DATABASE "block-explorer"; -CREATE DATABASE "block-explorer_slave"; -CREATE DATABASE "block-explorer_slave2"; \ No newline at end of file +CREATE DATABASE "block-explorer_custombase"; +CREATE DATABASE "block-explorer_validium"; \ No newline at end of file