From 9e88898428d7745a3b07d4362c85cc28657f904b Mon Sep 17 00:00:00 2001 From: Nikhil Suri Date: Fri, 21 Oct 2022 08:32:10 -0700 Subject: [PATCH] Smoother Onboarding (#25) * Autoformatter changes * Updated guardiand script for x86_64 * Added .nvmrc files * Updated evm-messenger README with common errors * Revert "Autoformatter changes" This reverts commit 9c9816c6572033486ac5ef46d5e8a805295a1bda. --- projects/evm-messenger/.nvmrc | 1 + projects/evm-messenger/README.md | 13 +++++++++++-- projects/wormhole-local-validator/.nvmrc | 1 + projects/wormhole-local-validator/guardiand.bash | 3 ++- 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 projects/evm-messenger/.nvmrc create mode 100644 projects/wormhole-local-validator/.nvmrc diff --git a/projects/evm-messenger/.nvmrc b/projects/evm-messenger/.nvmrc new file mode 100644 index 0000000..6276cf1 --- /dev/null +++ b/projects/evm-messenger/.nvmrc @@ -0,0 +1 @@ +v16.14.2 diff --git a/projects/evm-messenger/README.md b/projects/evm-messenger/README.md index e4d2016..cd326d9 100644 --- a/projects/evm-messenger/README.md +++ b/projects/evm-messenger/README.md @@ -7,7 +7,7 @@ This project uses Foundry to compile and deploy EVM contracts. You can find inst The javascript dependencies can be installed via `npm install` in this folder. ## Test Scripts -After you have Guardiand running, you can run the basic test with `npm run test`. This will: +After you have Guardiand running (you can use the [wormhole-local-validator](https://github.com/wormhole-foundation/xdapp-book/tree/main/projects/wormhole-local-validator), you can run the basic test with `npm run test`. This will: - Deploy a simple Messenger contract (found in chains/evm/src/Messenger.sol) to each EVM chain - Register each contract with the other chain - Send a message from each contract @@ -15,4 +15,13 @@ After you have Guardiand running, you can run the basic test with `npm run test` - Submit the VAA to each contract - Print out the Message -If everything goes correctly, you should get a printout with the Hello World messages on each chain. \ No newline at end of file +If everything goes correctly, you should get a printout with the Hello World messages on each chain. + +## Common Errors +### Nonce Issues +If you see transactions failing due to nonce mismatch errors, restart your local evm chain. If using the [wormhole-local-validator](https://github.com/wormhole-foundation/xdapp-book/tree/main/projects/wormhole-local-validator), just rerun `npm run evm` and then retry `npm run test`. + +This is intermittent and likely caused by the js lib and evm chain being out of sync. + +### Transaction Underpriced Issues +Transactions failing with the message `transaction underpriced` is an intermittent issue. Restart the evm chains and rerun `npm run test`. If the issue persists, you may need to manually set gas prices when calling the Messenger contract in the `send_msg` logic in `orchestrator.js`. \ No newline at end of file diff --git a/projects/wormhole-local-validator/.nvmrc b/projects/wormhole-local-validator/.nvmrc new file mode 100644 index 0000000..6276cf1 --- /dev/null +++ b/projects/wormhole-local-validator/.nvmrc @@ -0,0 +1 @@ +v16.14.2 diff --git a/projects/wormhole-local-validator/guardiand.bash b/projects/wormhole-local-validator/guardiand.bash index 36a9cbc..20b209c 100644 --- a/projects/wormhole-local-validator/guardiand.bash +++ b/projects/wormhole-local-validator/guardiand.bash @@ -9,7 +9,8 @@ DOCKER_IMAGE="ghcr.io/certusone/guardiand:dev.v2" DOCKER_FLAGS= HOST= TERRAD_HOST= -if [ "$(uname -m)" = "arm64" ]; then +machine=$(uname -m) +if [ $machine = "arm64" ] || [ $machine = "x86_64" ]; then DOCKER_FLAGS="-p 7070:7070 -p 7071:7071 -p 6060:6060 -p 8999:8999/udp --platform linux/amd64" HOST="host.docker.internal" TERRAD_HOST="host.docker.internal"