This repository contains a Docker Compose setup for running a PostgreSQL database and an external node service. The setup is designed to be used with a specific external node version, and it configures the PostgreSQL instance with custom settings tailored for performance.
- Docker
- Docker Compose
- Clone this repository.
- Ensure Docker and Docker Compose are installed.
- Run
docker compose --file testnet-external-node.yml up -dto start the services. - The services will be up and running as per the configurations defined in the
testnet-external-node.ymlfor the testnet.
- Image:
postgres:14 - Exposed Ports:
5430 - Volumes:
mainnet-postgres(Persistent storage for PostgreSQL data) - Environment Variables:
POSTGRES_PASSWORD: Password for the PostgreSQL user.PGPORT: Port number on which PostgreSQL will listen.
- Custom Configuration Parameters:
max_connections=200log_error_verbosity=terseshared_buffers=2GBeffective_cache_size=4GBmaintenance_work_mem=1GBcheckpoint_completion_target=0.9random_page_cost=1.1effective_io_concurrency=200min_wal_size=4GBmax_wal_size=16GBmax_worker_processes=16checkpoint_timeout=1800
- Healthcheck:
- Runs a query to check if the PostgreSQL instance is ready.
- Image:
matterlabs/external-node:v29.1.2 - Depends on: PostgreSQL service (ensures the service starts after PostgreSQL is healthy)
- Ports:
3060(HTTP)3061(WebSocket)3081(Healthcheck)3322(Prometheus)
- Volumes:
mainnet-rocksdb(Persistent storage for RocksDB data) - Environment Variables:
DATABASE_URL: Connection URL for the PostgreSQL instance.DATABASE_POOL_SIZE: Size of the database connection pool.EN_HTTP_PORT: Port for the HTTP server.EN_WS_PORT: Port for the WebSocket server.EN_HEALTHCHECK_PORT: Port for the health check.EN_PROMETHEUS_PORT: Port for Prometheus metrics.EN_ETH_CLIENT_URL: URL of the Ethereum client.EN_MAIN_NODE_URL: URL of the main node.EN_L1_CHAIN_ID: Layer 1 chain ID.EN_L2_CHAIN_ID: Layer 2 chain ID.EN_L1_BATCH_COMMIT_DATA_GENERATOR_MODE: Mode for batch commit data generator.EN_STATE_CACHE_PATH: Path for the state cache.EN_MERKLE_TREE_PATH: Path for the Merkle tree.EN_SNAPSHOTS_RECOVERY_ENABLED: Enable or disable snapshots recovery.RUST_LOG: Log level settings.EN_DA_CLIENT: DA client configuration.EN_DA_AVAIL_CLIENT_TYPE: "FullClient"EN_DA_BRIDGE_API_URL: Avail Bridge API URLEN_DA_TIMEOUT_MS: "20000"EN_DA_API_NODE_URL: Avail API Node URLEN_DA_APP_ID: Avail App IDEN_DA_SECRETS_SEED_PHRASE: A randomly generated seed phrase, it is just needed to initialize a client that will verify your blobs, no transactions will be send from that account, so it is ok if it is freshly created and has no balance.
mainnet-postgres: Stores PostgreSQL data.mainnet-rocksdb: Stores RocksDB data for the external node.