Skip to content

Commit

Permalink
review iteration 2
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis committed Feb 21, 2024
1 parent 158778e commit 87d3b17
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 38 deletions.
24 changes: 2 additions & 22 deletions LOCAL_TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand Down
28 changes: 14 additions & 14 deletions cmd/zetae2e/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 2 additions & 2 deletions contrib/localnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand Down

0 comments on commit 87d3b17

Please sign in to comment.