From 6087da4684273c7e8762ae756785c9a374bdbb1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Jakub=20Nani=C5=A1ta?= Date: Tue, 12 Dec 2023 16:24:18 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=9A=20OmniGraph=E2=84=A2=20Small=20stu?= =?UTF-8?q?ff=20for=20the=20exposed=20networks=20(#107)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 37 ++++++++++++++++++- .../hardhat.config.ts | 6 +-- turbo.json | 1 + 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 807faf08c..5705ed52e 100644 --- a/README.md +++ b/README.md @@ -82,10 +82,28 @@ It is possible to expose the test networks defined in `docker-compose.yaml` on y yarn start ``` -You will need to use the `MNEMONIC` defined in `docker-compose.templates.yaml` if you require funded accounts: +Once the networks are running, you can go to the `ua-utils-evm-hardhat-test` package: ```bash -export MNEMONIC='test test test test test test test test test test test junk' +cd packages/ua-utils-hardhat-test +``` + +Setup the default `EndpointV2` and `DefaultOApp`: + +```bash +npx hardhat lz:test:oapp:deploy +``` + +And execute `hardhat` tasks as usual: + +```bash +npx hardhat lz:oapp:getDefaultConfig +``` + +If you are developing tasks, it's useful to build the code when it changes. To do this, run the following from the project root: + +```bash +yarn dev ``` To stop the network containers, just run: @@ -119,3 +137,18 @@ yarn upgrade-interactive --scope @layerzerolabs --latest However, this utility has an issue with packages that are listed both at the workspace root and in the individual packages, e.g. `@layerzerolabs/prettier-config-next` - it errors out saying that a workspace package could not be found. To work around this (since this version of yarn is outdated and a fix for this problem will not be provided), you can remove the entries from the root `package.json` before running the command, then add them back (just don't forget to update their versions). + +#### Problems using the `dev` script + +`turbo` might complain about concurrency issues when running `yarn dev`: + +```diff +- error preparing engine: Invalid persistent task configuration: +- You have 18 persistent tasks but `turbo` is configured for concurrency of 10. Set --concurrency to at least 19 +``` + +If you see this error, just follow turbo's lead and use: + +```bash +yarn dev --concurrency 19 +``` diff --git a/packages/ua-utils-evm-hardhat-test/hardhat.config.ts b/packages/ua-utils-evm-hardhat-test/hardhat.config.ts index 689ef45ce..fac8ccae8 100644 --- a/packages/ua-utils-evm-hardhat-test/hardhat.config.ts +++ b/packages/ua-utils-evm-hardhat-test/hardhat.config.ts @@ -1,6 +1,5 @@ import 'hardhat-deploy' import '@layerzerolabs/toolbox-hardhat' -import assert from 'assert' import { EndpointId } from '@layerzerolabs/lz-definitions' import type { HardhatUserConfig } from 'hardhat/types' @@ -8,8 +7,9 @@ import type { HardhatUserConfig } from 'hardhat/types' // using your own keyboard (using exposed networks) import './tasks' -const MNEMONIC = process.env.MNEMONIC -assert(MNEMONIC, `Missing MNEMONIC environment variable`) +// We will default the mnemonic to the value we use in docker compose +// for easy exposed network workflow +const MNEMONIC = process.env.MNEMONIC ?? 'test test test test test test test test test test test junk' /** * This is a dummy hardhat config that enables us to test diff --git a/turbo.json b/turbo.json index 782f32509..2d576df3f 100644 --- a/turbo.json +++ b/turbo.json @@ -15,6 +15,7 @@ }, "dev": { "cache": false, + "dependsOn": ["^build"], "outputs": [], "persistent": true },