Skip to content

Commit

Permalink
🪚 OmniGraph™ Small stuff for the exposed networks (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
janjakubnanista authored Dec 13, 2023
1 parent 381bc69 commit 6087da4
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
```
6 changes: 3 additions & 3 deletions packages/ua-utils-evm-hardhat-test/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import 'hardhat-deploy'
import '@layerzerolabs/toolbox-hardhat'
import assert from 'assert'
import { EndpointId } from '@layerzerolabs/lz-definitions'
import type { HardhatUserConfig } from 'hardhat/types'

// These tasks are only for when you want to play with this setup
// 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
Expand Down
1 change: 1 addition & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"dev": {
"cache": false,
"dependsOn": ["^build"],
"outputs": [],
"persistent": true
},
Expand Down

0 comments on commit 6087da4

Please sign in to comment.