Skip to content

Commit

Permalink
Use ZKEVM_NETWORK variable to specify location of config files in doc…
Browse files Browse the repository at this point in the history
…ker compose file (0xPolygonHermez#2524)

* Use ZKEVM_NETWORK variable to specify location of config files in docker-compose

* fix config path in step 7.1

* rename ZKEVM_NODE_STATE_DB_DATA_DIR to ZKEVM_NODE_STATEDB_DATA_DIR
  • Loading branch information
agnusmor authored Sep 8, 2023
1 parent 81288dc commit d5c0135
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion config/environments/mainnet/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ZKEVM_NETWORK = "mainnet"
# URL of a JSON RPC for Ethereum mainnet
ZKEVM_NODE_ETHERMAN_URL = "http://your.L1node.url"
# PATH WHERE THE STATEDB POSTGRES CONTAINER WILL STORE PERSISTENT DATA
ZKEVM_NODE_STATE_DB_DATA_DIR = "/path/to/persistent/data/statedb"
ZKEVM_NODE_STATEDB_DATA_DIR = "/path/to/persistent/data/statedb"
# PATH WHERE THE POOLDB POSTGRES CONTAINER WILL STORE PERSISTENT DATA
ZKEVM_NODE_POOLDB_DATA_DIR = "/path/to/persistent/data/pooldb"
# OPTIONAL, UNCOMENT IF YOU WANT TO DO ADVANCED CONFIG
Expand Down
2 changes: 1 addition & 1 deletion config/environments/testnet/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ZKEVM_NETWORK = "testnet"
# URL of a JSON RPC for Goerli
ZKEVM_NODE_ETHERMAN_URL = "http://your.L1node.url"
# PATH WHERE THE STATEDB POSTGRES CONTAINER WILL STORE PERSISTENT DATA
ZKEVM_NODE_STATE_DB_DATA_DIR = "/path/to/persistent/data/statedb"
ZKEVM_NODE_STATEDB_DATA_DIR = "/path/to/persistent/data/statedb"
# PATH WHERE THE POOLDB POSTGRES CONTAINER WILL STORE PERSISTENT DATA
ZKEVM_NODE_POOLDB_DATA_DIR = "/path/to/persistent/data/pooldb"
# OPTIONAL, UNCOMENT IF YOU WANT TO DO ADVANCED CONFIG
Expand Down
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
environment:
- ZKEVM_NODE_ETHERMAN_URL=${ZKEVM_NODE_ETHERMAN_URL}
volumes:
- ${ZKEVM_ADVANCED_CONFIG_DIR:-./config/environments/testnet}/node.config.toml:/app/config.toml
- ${ZKEVM_ADVANCED_CONFIG_DIR:-./config/environments/${ZKEVM_NETWORK}}/node.config.toml:/app/config.toml
command:
- "/bin/sh"
- "-c"
Expand All @@ -50,7 +50,7 @@ services:
environment:
- ZKEVM_NODE_ETHERMAN_URL=${ZKEVM_NODE_ETHERMAN_URL}
volumes:
- ${ZKEVM_ADVANCED_CONFIG_DIR:-./config/environments/testnet}/node.config.toml:/app/config.toml
- ${ZKEVM_ADVANCED_CONFIG_DIR:-./config/environments/${ZKEVM_NETWORK}}/node.config.toml:/app/config.toml
command:
- "/bin/sh"
- "-c"
Expand All @@ -69,8 +69,8 @@ services:
- 5432:5432
volumes:
- ./db/scripts/init_prover_db.sql:/docker-entrypoint-initdb.d/init.sql
- ${ZKEVM_NODE_STATE_DB_DATA_DIR}:/var/lib/postgresql/data
- ${ZKEVM_ADVANCED_CONFIG_DIR:-./config/environments/testnet}/postgresql.conf:/etc/postgresql.conf
- ${ZKEVM_NODE_STATEDB_DATA_DIR}:/var/lib/postgresql/data
- ${ZKEVM_ADVANCED_CONFIG_DIR:-./config/environments/${ZKEVM_NETWORK}}/postgresql.conf:/etc/postgresql.conf
environment:
- POSTGRES_USER=state_user
- POSTGRES_PASSWORD=state_password
Expand Down Expand Up @@ -115,6 +115,6 @@ services:
- 50061:50061 # MT
- 50071:50071 # Executor
volumes:
- ${ZKEVM_ADVANCED_CONFIG_DIR:-./config/environments/testnet}/prover.config.json:/usr/src/app/config.json
- ${ZKEVM_ADVANCED_CONFIG_DIR:-./config/environments/${ZKEVM_NETWORK}}/prover.config.json:/usr/src/app/config.json
command: >
zkProver -c /usr/src/app/config.json
2 changes: 1 addition & 1 deletion docs/production-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ docker compose --env-file $ZKEVM_CONFIG_DIR/.env -f $ZKEVM_DIR/$ZKEVM_NET/docker
6. Copy the file with the env parameters into config directory: `mkdir -p $ZKEVM_CONFIG_DIR && cp $ZKEVM_DIR/$ZKEVM_NET/example.env $ZKEVM_CONFIG_DIR/.env`
7. Edit the env file, with your favourite editor. The example will use nano: `nano $ZKEVM_CONFIG_DIR/.env`. This file contains the configuration that anyone should modify. For advanced configuration:
1. Copy the config files into the config directory `cp $ZKEVM_DIR/$ZKEVM_NET/config/environments/testnet/* $ZKEVM_CONFIG_DIR/`
1. Copy the config files into the config directory `cp $ZKEVM_DIR/$ZKEVM_NET/config/environments/$ZKEVM_NET/* $ZKEVM_CONFIG_DIR/`
2. Make sure the modify the `ZKEVM_ADVANCED_CONFIG_DIR` from `$ZKEVM_CONFIG_DIR/.env` with the correct path
3. Edit the different configuration files in the $ZKEVM_CONFIG_DIR directory and make the necessary changes
8. Run the node: `docker compose --env-file $ZKEVM_CONFIG_DIR/.env -f $ZKEVM_DIR/$ZKEVM_NET/docker-compose.yml up -d`. You may need to run this command using `sudo` depending on your Docker setup.
Expand Down

0 comments on commit d5c0135

Please sign in to comment.