matter-labs / zksync

zkSync: trustless scaling and privacy engine for Ethereum
https://zksync.io
Apache License 2.0
4.86k stars 2.69k forks source link

Starting the Local Node, When I tried to deploy zksync locally, I encountered an error. #609

Closed haerker closed 2 months ago

haerker commented 3 months ago

when i run ./start

The error message reads: [+] Running 2/0 ✔ Container local-setup-postgres-1 Created 0.0s ✔ Container local-setup-zksync-1 Created 0.0s Attaching to postgres-1, zksync-1 postgres-1 | postgres-1 | PostgreSQL Database directory appears to contain a database; Skipping initialization postgres-1 | postgres-1 | 2024-03-29 05:59:33.635 UTC [1] LOG: starting PostgreSQL 12.18 (Debian 12.18-1.pgdg120+2) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit postgres-1 | 2024-03-29 05:59:33.635 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 postgres-1 | 2024-03-29 05:59:33.635 UTC [1] LOG: listening on IPv6 address "::", port 5432 postgres-1 | 2024-03-29 05:59:33.832 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" postgres-1 | 2024-03-29 05:59:34.104 UTC [27] LOG: database system was shut down at 2024-03-29 05:56:20 UTC postgres-1 | 2024-03-29 05:59:34.204 UTC [1] LOG: database system is ready to accept connections zksync-1 | /usr/bin/entrypoint.sh: line 44: /etc/env/dev.env: No such file or directory zksync-1 exited with code 1

my docker compose.yml is:


version: '3.2'
services:
  postgres:
    image: "postgres:12"
    logging:
      driver: none 
    volumes:
      - postgres:/var/lib/postgresql/data
    environment:
      - POSTGRES_HOST_AUTH_METHOD=trust
      - POSTGRES_DB=zksync_local
  zksync:
    stdin_open: true
    tty: true
    image: matterlabs/local-node:latest2.0
    depends_on:
      - postgres
    ports:
      - "3050:3050" # JSON RPC HTTP port
      - "3051:3051" # JSON RPC WS port
    volumes:
      # Configs folder bind
      - zksync-config:/etc/env/
      # Storage folder bind
      - zksync-data:/var/lib/zksync/data
    environment:
      - DATABASE_URL=postgres://postgres@postgres/zksync_local
      - ETH_CLIENT_WEB3_URL=http://172.19.205.103:8545

volumes:
  postgres:
  zksync-config:
  zksync-data:

The error seems to indicate that zksync is unable to connect to PostgreSQL. How can I fix this?

bxpana commented 2 months ago

If you're still having issues you can create a post on https://github.com/zkSync-Community-Hub/zkync-developers/discussions