From 87d3b172491c6f6dae5c08b2d97188dca2a3488c Mon Sep 17 00:00:00 2001 From: lumtis Date: Wed, 21 Feb 2024 13:25:47 +0100 Subject: [PATCH] review iteration 2 --- LOCAL_TESTING.md | 24 ++---------------------- cmd/zetae2e/config/config.go | 28 ++++++++++++++-------------- contrib/localnet/README.md | 4 ++-- 3 files changed, 18 insertions(+), 38 deletions(-) diff --git a/LOCAL_TESTING.md b/LOCAL_TESTING.md index 70f3681b2e..c127aa0e7d 100644 --- a/LOCAL_TESTING.md +++ b/LOCAL_TESTING.md @@ -28,11 +28,6 @@ Now we have built all the docker images, we can run the e2e test with make comma # in zeta-node/ make start-e2e-test ``` -which does the following docker compose command: -```bash -# in zeta-node/contrib/localnet/orchestrator -$ docker compose up -d -``` ### Run upgrade tests @@ -84,11 +79,7 @@ To stop the tests, # in zeta-node/ make stop-test ``` -which does the following docker compose command: -```bash -# in zeta-node/contrib/localnet/orchestrator -$ docker compose down --remove-orphans -``` + ### Run monitoring setup Before starting the monitoring setup, make sure the Zetacore API is up at http://localhost:1317. @@ -98,11 +89,7 @@ You can also add any additional ETH addresses to monitor in `zeta-node/contrib/l # in zeta-node/ make start-monitoring ``` -which does the following docker compose command: -```bash -# in zeta-node/contrib/localnet/ -$ docker compose -f docker-compose-monitoring.yml up -d -``` + ### Grafana credentials and dashboards The Grafana default credentials are admin:admin. The dashboards are located at http://localhost:3000. @@ -114,13 +101,6 @@ The Grafana default credentials are admin:admin. The dashboards are located at h make stop-monitoring ``` -which does the following docker compose command: - -```bash -# in zeta-node/contrib/localnet/ -$ docker compose -f docker-compose-monitoring.yml down --remove-orphans -``` - ## Interacting with the Localnet In addition to running automated tests, you can also interact with the localnet directly for more specific testing. diff --git a/cmd/zetae2e/config/config.go b/cmd/zetae2e/config/config.go index 88bc9c9e0a..2d0cd3fed0 100644 --- a/cmd/zetae2e/config/config.go +++ b/cmd/zetae2e/config/config.go @@ -87,22 +87,22 @@ func RunnerFromConfig( } // ExportContractsFromRunner export contracts from the runner to config using a source config -func ExportContractsFromRunner(oldRunner *runner.E2ERunner, conf config.Config) config.Config { +func ExportContractsFromRunner(r *runner.E2ERunner, conf config.Config) config.Config { // copy contracts from deployer runner - conf.Contracts.EVM.ZetaEthAddress = oldRunner.ZetaEthAddr.Hex() - conf.Contracts.EVM.ConnectorEthAddr = oldRunner.ConnectorEthAddr.Hex() - conf.Contracts.EVM.CustodyAddr = oldRunner.ERC20CustodyAddr.Hex() - conf.Contracts.EVM.USDT = oldRunner.USDTERC20Addr.Hex() + conf.Contracts.EVM.ZetaEthAddress = r.ZetaEthAddr.Hex() + conf.Contracts.EVM.ConnectorEthAddr = r.ConnectorEthAddr.Hex() + conf.Contracts.EVM.CustodyAddr = r.ERC20CustodyAddr.Hex() + conf.Contracts.EVM.USDT = r.USDTERC20Addr.Hex() - conf.Contracts.ZEVM.SystemContractAddr = oldRunner.SystemContractAddr.Hex() - conf.Contracts.ZEVM.ETHZRC20Addr = oldRunner.ETHZRC20Addr.Hex() - conf.Contracts.ZEVM.USDTZRC20Addr = oldRunner.USDTZRC20Addr.Hex() - conf.Contracts.ZEVM.BTCZRC20Addr = oldRunner.BTCZRC20Addr.Hex() - conf.Contracts.ZEVM.UniswapFactoryAddr = oldRunner.UniswapV2FactoryAddr.Hex() - conf.Contracts.ZEVM.UniswapRouterAddr = oldRunner.UniswapV2RouterAddr.Hex() - conf.Contracts.ZEVM.ZEVMSwapAppAddr = oldRunner.ZEVMSwapAppAddr.Hex() - conf.Contracts.ZEVM.ContextAppAddr = oldRunner.ContextAppAddr.Hex() - conf.Contracts.ZEVM.TestDappAddr = oldRunner.TestDAppAddr.Hex() + conf.Contracts.ZEVM.SystemContractAddr = r.SystemContractAddr.Hex() + conf.Contracts.ZEVM.ETHZRC20Addr = r.ETHZRC20Addr.Hex() + conf.Contracts.ZEVM.USDTZRC20Addr = r.USDTZRC20Addr.Hex() + conf.Contracts.ZEVM.BTCZRC20Addr = r.BTCZRC20Addr.Hex() + conf.Contracts.ZEVM.UniswapFactoryAddr = r.UniswapV2FactoryAddr.Hex() + conf.Contracts.ZEVM.UniswapRouterAddr = r.UniswapV2RouterAddr.Hex() + conf.Contracts.ZEVM.ZEVMSwapAppAddr = r.ZEVMSwapAppAddr.Hex() + conf.Contracts.ZEVM.ContextAppAddr = r.ContextAppAddr.Hex() + conf.Contracts.ZEVM.TestDappAddr = r.TestDAppAddr.Hex() return conf } diff --git a/contrib/localnet/README.md b/contrib/localnet/README.md index 2e877b07c4..17a2ae3d03 100644 --- a/contrib/localnet/README.md +++ b/contrib/localnet/README.md @@ -2,7 +2,7 @@ This directory contains a set of scripts to help you quickly set up a local ZetaChain network for development and testing purposes. The scripts are based on the Docker -and [Docker Compose](https://docs.docker.com/compose/). +and Docker Compose. As a development testing environment, the setup aims to be flexible, close to real world, and with fast turnaround @@ -19,7 +19,7 @@ The `docker-compose.yml` file defines a network with: The following Docker compose files can extend the default localnet setup: - `docker-compose-stresstest.yml`: Spin up more nodes and clients for testing performance of the network. -- `docker-compose-upgrade.yml`: Spin up a network with with a upgrade proposal defined at a specific height.\ +- `docker-compose-upgrade.yml`: Spin up a network with with a upgrade proposal defined at a specific height. Finally, `docker-compose-monitoring.yml` can be run separately to spin up a local grafana and prometheus setup to monitor the network.