Skip to content

Commit

Permalink
Rename Public to Testnet (0xPolygonHermez#2193)
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniRamirezM authored Jun 20, 2023
1 parent 25dee5b commit 54771bd
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ jobs:
- name: Put testnet and mainnet artifacts into a single zip
run: |
# TESTNET
mkdir -p testnet/config/environments/public
mkdir -p testnet/config/environments/testnet
mkdir -p testnet/db/scripts
cp config/environments/public/* testnet/config/environments/public
cp config/environments/testnet/* testnet/config/environments/testnet
cp docker-compose.yml testnet
cp db/scripts/init_prover_db.sql testnet/db/scripts
mv testnet/config/environments/public/example.env testnet
mv testnet/config/environments/testnet/example.env testnet
sed -i -e "s/image: zkevm-node/image: hermeznetwork\/zkevm-node:$GIT_TAG_NAME/g" testnet/docker-compose.yml
zip -r testnet.zip testnet
# MAINNET
mkdir -p mainnet/config/environments/public
mkdir -p mainnet/config/environments/testnet
mkdir -p mainnet/db/scripts
cp config/environments/mainnet/* mainnet/config/environments/public
cp config/environments/mainnet/* mainnet/config/environments/testnet
cp docker-compose.yml mainnet
cp db/scripts/init_prover_db.sql mainnet/db/scripts
mv mainnet/config/environments/public/example.env mainnet
mv mainnet/config/environments/testnet/example.env mainnet
sed -i -e "s/image: zkevm-node/image: hermeznetwork\/zkevm-node:$GIT_TAG_NAME/g" mainnet/docker-compose.yml
zip -r mainnet.zip mainnet
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ RUN cd /src && make build
# CONTAINER FOR RUNNING BINARY
FROM alpine:3.16.0
COPY --from=build /src/dist/zkevm-node /app/zkevm-node
COPY --from=build /src/config/environments/public/public.node.config.toml /app/example.config.toml
COPY --from=build /src/config/environments/testnet/testnet.node.config.toml /app/example.config.toml
EXPOSE 8123
CMD ["/bin/sh", "-c", "/app/zkevm-node run"]
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 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/public}/public.node.config.toml:/app/config.toml
- ${ZKEVM_ADVANCED_CONFIG_DIR:-./config/environments/testnet}/testnet.node.config.toml:/app/config.toml
command:
- "/bin/sh"
- "-c"
Expand All @@ -48,7 +48,7 @@ services:
environment:
- ZKEVM_NODE_ETHERMAN_URL=${ZKEVM_NODE_ETHERMAN_URL}
volumes:
- ${ZKEVM_ADVANCED_CONFIG_DIR:-./config/environments/public}/public.node.config.toml:/app/config.toml
- ${ZKEVM_ADVANCED_CONFIG_DIR:-./config/environments/testnet}/testnet.node.config.toml:/app/config.toml
command:
- "/bin/sh"
- "-c"
Expand All @@ -68,7 +68,7 @@ services:
volumes:
- ./db/scripts/init_prover_db.sql:/docker-entrypoint-initdb.d/init.sql
- ${ZKEVM_NODE_STATEDB_DATA_DIR}:/var/lib/postgresql/data
- ${ZKEVM_ADVANCED_CONFIG_DIR:-./config/environments/public}/postgresql.conf:/etc/postgresql.conf
- ${ZKEVM_ADVANCED_CONFIG_DIR:-./config/environments/testnet}/postgresql.conf:/etc/postgresql.conf
environment:
- POSTGRES_USER=state_user
- POSTGRES_PASSWORD=state_password
Expand Down Expand Up @@ -113,6 +113,6 @@ services:
- 50061:50061 # MT
- 50071:50071 # Executor
volumes:
- ${ZKEVM_ADVANCED_CONFIG_DIR:-./config/environments/public}/public.prover.config.json:/usr/src/app/config.json
- ${ZKEVM_ADVANCED_CONFIG_DIR:-./config/environments/testnet}/testnet.prover.config.json:/usr/src/app/config.json
command: >
zkProver -c /usr/src/app/config.json
6 changes: 3 additions & 3 deletions docs/modes.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ By default the config files found in the repository will spin up the Node in JSO

This will syncronize with the Trusted Sequencer (run by Polygon).

Use the default [public config file](https://github.com/0xPolygonHermez/zkevm-node/blob/develop/config/environments/public/public.node.config.toml), and make sure the following values are set to:
Use the default [testnet config file](https://github.com/0xPolygonHermez/zkevm-node/blob/develop/config/environments/testnet/testnet.node.config.toml), and make sure the following values are set to:

```toml
[RPC]
...
SequencerNodeURI = "https://public.zkevm-test.net:2083"
```

Same goes for the Prover Config ([prover-config.json](https://github.com/0xPolygonHermez/zkevm-node/blob/develop/config/environments/public/public.prover.config.json)):
Same goes for the Prover Config ([prover-config.json](https://github.com/0xPolygonHermez/zkevm-node/blob/develop/config/environments/testnet/testnet.prover.config.json)):

```json
{
Expand Down Expand Up @@ -78,7 +78,7 @@ Machine 1:

#### Machine 1

Use default [prover config](https://github.com/0xPolygonHermez/zkevm-node/blob/develop/config/environments/public/public.prover.config.json) but change the following values (`runProverServer` set to true, rest false):
Use default [prover config](https://github.com/0xPolygonHermez/zkevm-node/blob/develop/config/environments/testnet/testnet.prover.config.json) but change the following values (`runProverServer` set to true, rest false):

For *only* Prover Config (`only-prover-config.json`):

Expand Down
6 changes: 3 additions & 3 deletions docs/production-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Explained step by step:
5. Download and extract the artifacts: `curl -L https://github.com/0xPolygonHermez/zkevm-node/releases/latest/download/$ZKEVM_NET.zip > $ZKEVM_NET.zip && unzip -o $ZKEVM_NET.zip -d $ZKEVM_DIR && rm $ZKEVM_NET.zip`. Note you may need to install `unzip` for this command to work
6. Copy the file with the env parameters: `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/public/* $ZKEVM_CONFIG_DIR/`
1. Copy the config files into the config directory `cp $ZKEVM_DIR/$ZKEVM_NET/config/environments/testnet/* $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
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 Expand Up @@ -87,8 +87,8 @@ In the basic setup, there are Postgres being instanciated as Docker containers.
- Run dedicated instances for Postgres. To achieve this you will need to:
- Remove the Postgres services (`zkevm-pool-db` and `zkevm-state-db`) from the `docker-compose.yml`
- Instantiate Postgres elsewhere (note that you will have to create credentials and run some queries to make this work, following the config files and docker-compose should give a clear idea of what to do)
- Update the `public.node.config.toml` to use the correct URI for both DBs
- Update `prover.public.config.json` to use the correct URI for the state DB
- Update the `testnet.node.config.toml` to use the correct URI for both DBs
- Update `testnet.prover.config.json` to use the correct URI for the state DB
- Use a setup of Postgres that allows to have separated endpoints for read / write replicas

### JSON RPC
Expand Down

0 comments on commit 54771bd

Please sign in to comment.