-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standalone getting started guide #155
Conversation
19dd4d6
Co-authored-by: Meaghan FitzGerald <[email protected]> Signed-off-by: cam-schultz <[email protected]>
Co-authored-by: Meaghan FitzGerald <[email protected]> Signed-off-by: cam-schultz <[email protected]>
Co-authored-by: Meaghan FitzGerald <[email protected]> Signed-off-by: cam-schultz <[email protected]>
Co-authored-by: Meaghan FitzGerald <[email protected]> Signed-off-by: cam-schultz <[email protected]>
Co-authored-by: Meaghan FitzGerald <[email protected]> Signed-off-by: cam-schultz <[email protected]>
Co-authored-by: Meaghan FitzGerald <[email protected]> Signed-off-by: cam-schultz <[email protected]>
|
||
## Step 5: Testing | ||
|
||
For testing, `scripts/local/test.sh` sets up a local Avalanche network with three subnets deployed with Teleporter, and a relayer to deliver Teleporter messages. To add an integration test simply add a new test script under `integration-tests`. An integration test for `ExampleCrossChainMessenger` is already included (`scripts/local/integration_tests/example_messenger.sh`), which performs the following steps: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ran scripts/local/test.sh
in teleporter base directory and it failed.
I believe it is because while running /code/docker/run_setup.sh
, subnet-evm is not cloned to the docker container before sourcing the latest avalanchego version from ./scripts/versions.sh
in subnet-evm.
ARCH set to arm64
Using published awm-relayer image
Waiting for containers to start...
WARN[0000] The "TEST_TARGET" variable is not set. Defaulting to a blank string.
[+] Building 0.8s (22/22) FINISHED docker:desktop-linux
=> [test_runner internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 2.22kB 0.0s
=> [test_runner internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [test_runner internal] load metadata for docker.io/library/ubuntu:20.04 0.7s
=> [local_network internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [local_network internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 2.22kB 0.0s
=> [test_runner auth] library/ubuntu:pull token for registry-1.docker.io 0.0s
=> [local_network 1/14] FROM docker.io/library/ubuntu:20.04@sha256:ed4a42283d9943135ed87d4ee34e542f7f5ad9ecf2f244870e23122f703f91c2 0.0s
=> CACHED [test_runner 2/14] RUN apt-get update && apt-get upgrade -y && apt-get clean 0.0s
=> CACHED [test_runner 3/14] RUN apt-get install -y wget curl git python3 make gcc build-essential 0.0s
=> CACHED [test_runner 4/14] RUN apt-get install -y bison 0.0s
=> CACHED [test_runner 5/14] RUN wget https://go.dev/dl/go1.20.10.linux-arm64.tar.gz 0.0s
=> CACHED [test_runner 6/14] RUN rm -rf /usr/local/go && tar -C /usr/local -xzf go1.20.10.linux-arm64.tar.gz 0.0s
=> CACHED [test_runner 7/14] RUN go version 0.0s
=> CACHED [test_runner 8/14] RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* && localedef -i en_US 0.0s
=> CACHED [test_runner 9/14] RUN curl -L https://raw.githubusercontent.com/ava-labs/foundry/v0.1.0/foundryup/install > /tmp/foundry-in 0.0s
=> CACHED [test_runner 10/14] RUN apt-get update && apt-get install -y python3-pip 0.0s
=> CACHED [test_runner 11/14] RUN pip3 install base58 0.0s
=> CACHED [test_runner 12/14] RUN curl -sSfL https://raw.githubusercontent.com/ava-labs/avalanche-cli/main/scripts/install.sh | sh -s - 0.0s
=> CACHED [test_runner 13/14] RUN avalanche --version 0.0s
=> CACHED [test_runner 14/14] RUN echo '{"MetricsEnabled}":false}' > ~/.avalanche-cli/config 0.0s
=> [test_runner] exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:cd2514843237abc94311537a801c1aa85072f4f2993e865baea3213adcaef35e 0.0s
=> => naming to docker.io/library/test-runner-image 0.0s
=> [local_network] exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:164396b1c78dee645d78e82b1fea8512637af7fd14e1f6fd2b3c9f2bad4d4339 0.0s
=> => naming to docker.io/library/local-network-image 0.0s
[+] Running 3/0
✔ Container teleporter-relayer-1 Created 0.0s
✔ Container local_network_test Created 0.0s
✔ Container test_runner Created 0.0s
Attaching to local_network_test, teleporter-relayer-1, test_runner
teleporter-relayer-1 | Waiting for subnets to start up. Retry count:
test_runner | Waiting for subnets to start up. Retry count:
local_network_test | /code/docker/run_setup.sh: line 34: ./scripts/versions.sh: No such file or directory
local_network_test exited with code 1
Aborting on container exit...
[+] Stopping 3/0
✔ Container test_runner Stopped 0.0s
✔ Container teleporter-relayer-1 Stopped 0.0s
✔ Container local_network_test Stopped 0.0s
Waiting for containers to start...
Docker process is dead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might conflict with #152
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is teleporter/subnet-evm
populated? After cloning teleporter
, run git submodule update --init --recursive
to do so.
That being said, we're planning on removing the Docker-based integration tests, as well as reworking our subnet-evm
dependency, so this part of the README will be removed soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is teleporter/subnet-evm populated? After cloning teleporter, run git submodule update --init --recursive to do so.
Did this and it ran, but seems that once the subnets were up and running the script exited due to foundry not being installed.
teleporter-relayer-1 | Waiting for subnets to start up. Retry count: 160
local_network_test | % Total % Received % Xferd Average Speed Time Time Time Current
local_network_test | Dload Upload Total Spent
local_network_test | Left Speed
0 0 0 0 0 0 0 0
local_network_test | --:--:-- --:--:--
local_network_test | --:--:--
local_network_test | 0
100 1097 100 1022 100 75 998k 75000 --:--:-- --:--:-- --:--:-- 1071k
local_network_test | Subnet A chain ID: aQP7s5jeKjXBuGfEiLTxb2jViWPiqeygfD5pfUxmPjUAG37CT
local_network_test | Subnet B chain ID: J3i5NRXusfHDEAHWPa1fm5P9LKdCLqn8sZQXLFByXGLtkd4cY
local_network_test | Subnet C chain ID: wuU5JChqjAaUDsct3tTSgQxxsyL3rhAVjoBzuyqsU24S1gtek
local_network_test | C-Chain chain ID: 2JeJDKL9Bvn1vLuuPL1DpUccBCVUh7iRnkv3a5pV9kJW5HbuQz
local_network_test | /code/docker/run_setup.sh: line 101: forge: command not found
local_network_test exited with code 127
Aborting on container exit...
That being said, we're planning on removing the Docker-based integration tests, as well as reworking our subnet-evm dependency, so this part of the README will be removed soon.
Might not be worth troubleshooting this further if this testing portion is going to be rewritten. If this test is removed, this tutorial should definitely still include a test script or equivalent instructions for beginners.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was an issue with how our foundry fork was setup. If you were running this on Mac M1, then this should be resolved now. In any case, agreed not worth debugging here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good to me. I've left a few minor comments.
|
||
Now that `MyExampleCrossChainMessenger` has an instantiation of `ITeleporterMessenger`, the next step is to add in functionality of sending and receiving arbitrary string data between chains. | ||
|
||
To start, create the function declarations for `sendMessage`, which will send string data cross-chain to the specified destination address' receiver. This function allows callers to specify the destination chain ID, destination address to send to, relayer fees, required gas limit for message execution on destination address, and the actual message data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: From "... for message execution on destination address" to "... for message execution at the destination address' receiver" (or just "at the destination").
super nit: Would it be more accurate to call it "message handling" instead of "message execution"? Or maybe "execution of the message data"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestions. I think for the purposes of this tutorial, we should just leave it as "message execution". The details of failed message execution and retries are covered in the more in-depth Teleporter documentation.
uint256 requiredGasLimit, | ||
string calldata message | ||
) external returns (uint256 messageID) { | ||
// For non-zero fee amounts, first transfer the fee into the control of this contract, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: perhaps "into the control of this contract" to "to this contract".
Why this should be merged
Splits out the getting started with a cross-chain application guide into its own markdown file so that it can be more easily integrated into the docs site.
How this works
Self explanitory
How this was tested
N/A
How is this documented
Self explanitory