Skip to content
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

install avalanchego & subnetevm via avalanche-cli #392

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ jobs:
- name: Install Foundry
run: ./scripts/install_foundry.sh

- name: Install avalanche-cli
run: curl -sSfL https://raw.githubusercontent.com/ava-labs/avalanche-cli/main/scripts/install.sh | sh -s -- -b /usr/local/bin v1.5.3

- name: Run E2E Tests
# Forge installs to BASE_DIR, but updates the PATH definition in $HOME/.bashrc
run: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ source vars.sh # source the variables needed to interact with the

In addition to the docker setup, end-to-end integration tests written using Ginkgo are provided in the `tests/` directory. E2E tests are run as part of CI, but can also be run locally. Any new features or cross-chain example applications checked into the repository should be accompanied by an end-to-end tests. See the [Contribution Guide](./CONTRIBUTING.md) for additional details.

To run the E2E tests locally, you'll need to install Gingko following the instructions [here](https://onsi.github.io/ginkgo/#installing-ginkgo).
To run the E2E tests locally, you'll need to install Gingko following the instructions [here](https://onsi.github.io/ginkgo/#installing-ginkgo), and avalanche-cli as instructed [here](https://docs.avax.network/tooling/cli-guides/install-avalanche-cli).

Then run the following command from the root of the repository:

Expand Down
133 changes: 0 additions & 133 deletions scripts/install_avalanchego_release.sh

This file was deleted.

118 changes: 0 additions & 118 deletions scripts/install_subnetevm_release.sh

This file was deleted.

33 changes: 26 additions & 7 deletions scripts/local/e2e_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,34 @@ source "$TELEPORTER_PATH"/scripts/versions.sh
BASEDIR=${BASEDIR:-"$HOME/.teleporter-deps"}

cwd=$(pwd)
# Install the avalanchego and subnet-evm binaries
rm -rf $BASEDIR/avalanchego
BASEDIR=$BASEDIR AVALANCHEGO_BUILD_PATH=$BASEDIR/avalanchego ./scripts/install_avalanchego_release.sh
BASEDIR=$BASEDIR ./scripts/install_subnetevm_release.sh

cp ${BASEDIR}/subnet-evm/subnet-evm ${BASEDIR}/avalanchego/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy
echo "Copied ${BASEDIR}/subnet-evm/subnet-evm binary to ${BASEDIR}/avalanchego/plugins/"
AVALANCHE_CLI_DIR=$HOME/.avalanche-cli

export AVALANCHEGO_BUILD_PATH=$BASEDIR/avalanchego
export AVALANCHEGO_BUILD_PATH=${AVALANCHE_CLI_DIR}/bin/avalanchego/avalanchego-${AVALANCHEGO_VERSION}

# ensure that avalanche-cli has installed the version of avalanchego that we need:
if [[ ! -x "$AVALANCHEGO_BUILD_PATH/avalanchego" ]]; then
avalanche network clean
avalanche network start --avalanchego-version "$AVALANCHEGO_VERSION"
avalanche network clean
fi

# ensure that avalanche-cli has installed the version of subnetevm that we need:
subnetevm_bin=${AVALANCHE_CLI_DIR}/bin/subnet-evm/subnet-evm-${SUBNET_EVM_VERSION}/subnet-evm
if [[ ! -x "$subnetevm_bin" ]]; then
avalanche subnet create dummy --evm --vm-version "$SUBNET_EVM_VERSION" \
--force \
--teleporter --relayer --evm-chain-id 1 --evm-token DUM --evm-defaults # this line is just to avoid the dialog prompts
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make the order of operations for these two consistent? I like
Path
Comment
if block

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed in 5c48264


# Install the subnet-evm binary as a plugin within the avalanche-cli resources.
# This is a hack that can probably be undone when we stop setting up the
# avalanche network and subnet ourselves (via BeforeSuite/AfterSuite in
# tests/local/e2e_test.go) and start having avalanche-cli do that for us
# instead.
Comment on lines +40 to +43
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're going to use the tempnet fixture rather than avalanche-cli for use in the Ginkgo E2E tests, this comment should probably be updated.

mkdir -p "${AVALANCHEGO_BUILD_PATH}/plugins"
cp "$subnetevm_bin" \
"${AVALANCHEGO_BUILD_PATH}/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy"

cd $TELEPORTER_PATH/contracts
if command -v forge &> /dev/null; then
Expand Down