mirror of
https://github.com/luxfi/evm.git
synced 2026-09-24 00:27:44 +00:00
Update to use default plugin dir ($HOME/.avalanchego/plugins) (#1245)
* Update to use default plugin dir ($HOME/.avalanchego/plugins) This has been the default for avalanchego since v1.9.6. * fixup: Update dockerfile to copy the original rather than the symlink * remove plugin paths Signed-off-by: Ceyhun Onur <[email protected]> --------- Signed-off-by: Ceyhun Onur <[email protected]> Co-authored-by: Ceyhun Onur <[email protected]>
This commit is contained in:
committed by
GitHub
co-authored by
Ceyhun Onur
parent
5fed36811e
commit
dff8c47675
@@ -56,7 +56,7 @@ jobs:
|
||||
run: echo "TIMEOUT=1200s" >> "$GITHUB_ENV"
|
||||
- run: go mod download
|
||||
shell: bash
|
||||
- run: ./scripts/build.sh ./build/subnetevm
|
||||
- run: ./scripts/build.sh
|
||||
shell: bash
|
||||
- run: ./scripts/build_test.sh
|
||||
env:
|
||||
@@ -96,7 +96,7 @@ jobs:
|
||||
run: BASEDIR=/tmp/e2e-test AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego ./scripts/install_avalanchego_release.sh
|
||||
- name: Build Subnet-EVM Plugin Binary
|
||||
shell: bash
|
||||
run: ./scripts/build.sh /tmp/e2e-test/avalanchego/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy
|
||||
run: ./scripts/build.sh
|
||||
- name: Run E2E Precompile Tests
|
||||
shell: bash
|
||||
run: AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego DATA_DIR=/tmp/e2e-test/precompile-data ./scripts/run_ginkgo_precompile.sh
|
||||
@@ -138,7 +138,7 @@ jobs:
|
||||
run: BASEDIR=/tmp/e2e-test AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego ./scripts/install_avalanchego_release.sh
|
||||
- name: Build Subnet-EVM Plugin Binary
|
||||
shell: bash
|
||||
run: ./scripts/build.sh /tmp/e2e-test/avalanchego/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy
|
||||
run: ./scripts/build.sh
|
||||
- name: Run Warp E2E Tests
|
||||
uses: ava-labs/avalanchego/.github/actions/run-monitored-tmpnet-cmd@v1-actions
|
||||
with:
|
||||
@@ -170,7 +170,7 @@ jobs:
|
||||
run: BASEDIR=/tmp/e2e-test AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego ./scripts/install_avalanchego_release.sh
|
||||
- name: Build Subnet-EVM Plugin Binary
|
||||
shell: bash
|
||||
run: ./scripts/build.sh /tmp/e2e-test/avalanchego/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy
|
||||
run: ./scripts/build.sh
|
||||
- name: Run E2E Load Tests
|
||||
uses: ava-labs/avalanchego/.github/actions/run-monitored-tmpnet-cmd@v1-actions
|
||||
with:
|
||||
|
||||
+5
-2
@@ -19,14 +19,17 @@ RUN go mod download && go mod tidy -compat=1.21
|
||||
# Copy the code into the container
|
||||
COPY . .
|
||||
|
||||
# Ensure pre-existing builds are not available for inclusion in the final image
|
||||
RUN [ -d ./build ] && rm -rf ./build/* || true
|
||||
|
||||
# Pass in SUBNET_EVM_COMMIT as an arg to allow the build script to set this externally
|
||||
ARG SUBNET_EVM_COMMIT
|
||||
ARG CURRENT_BRANCH
|
||||
|
||||
RUN export SUBNET_EVM_COMMIT=$SUBNET_EVM_COMMIT && export CURRENT_BRANCH=$CURRENT_BRANCH && ./scripts/build.sh /build/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy
|
||||
RUN export SUBNET_EVM_COMMIT=$SUBNET_EVM_COMMIT && export CURRENT_BRANCH=$CURRENT_BRANCH && ./scripts/build.sh
|
||||
|
||||
# ============= Cleanup Stage ================
|
||||
FROM avaplatform/avalanchego:$AVALANCHE_VERSION AS builtImage
|
||||
|
||||
# Copy the evm binary into the correct location in the container
|
||||
COPY --from=builder /build/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy /avalanchego/build/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy
|
||||
COPY --from=builder /build/build/subnet-evm /avalanchego/build/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy
|
||||
|
||||
+12
-4
@@ -17,14 +17,22 @@ source "$SUBNET_EVM_PATH"/scripts/versions.sh
|
||||
source "$SUBNET_EVM_PATH"/scripts/constants.sh
|
||||
|
||||
if [[ $# -eq 1 ]]; then
|
||||
BINARY_PATH=$1
|
||||
PLUGIN_DIR=$1
|
||||
elif [[ $# -eq 0 ]]; then
|
||||
BINARY_PATH="$GOPATH/src/github.com/ava-labs/avalanchego/build/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy"
|
||||
PLUGIN_DIR="${DEFAULT_PLUGIN_DIR}"
|
||||
else
|
||||
echo "Invalid arguments to build subnet-evm. Requires zero (default location) or one argument to specify binary location."
|
||||
echo "Invalid arguments to build subnet-evm. Requires zero (default plugin dir) or one argument to specify the plugin dir."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PLUGIN_PATH="${PLUGIN_DIR}/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy"
|
||||
|
||||
BINARY_PATH="build/subnet-evm"
|
||||
|
||||
# Build Subnet EVM, which is run as a subprocess
|
||||
echo "Building Subnet EVM @ GitCommit: $SUBNET_EVM_COMMIT at $BINARY_PATH"
|
||||
go build -ldflags "-X github.com/ava-labs/subnet-evm/plugin/evm.GitCommit=$SUBNET_EVM_COMMIT $STATIC_LD_FLAGS" -o "$BINARY_PATH" "plugin/"*.go
|
||||
go build -ldflags "-X github.com/ava-labs/subnet-evm/plugin/evm.GitCommit=$SUBNET_EVM_COMMIT $STATIC_LD_FLAGS" -o "./$BINARY_PATH" "plugin/"*.go
|
||||
|
||||
echo "Symlinking ${BINARY_PATH} to ${PLUGIN_PATH}"
|
||||
mkdir -p "${PLUGIN_DIR}"
|
||||
ln -sf "${PWD}/${BINARY_PATH}" "${PLUGIN_PATH}"
|
||||
|
||||
@@ -7,6 +7,7 @@ set -euo pipefail
|
||||
|
||||
# Set the PATHS
|
||||
GOPATH="$(go env GOPATH)"
|
||||
DEFAULT_PLUGIN_DIR="${HOME}/.avalanchego/plugins"
|
||||
|
||||
# Avalabs docker hub
|
||||
# avaplatform/avalanchego - defaults to local as to avoid unintentional pushes
|
||||
|
||||
@@ -116,7 +116,6 @@ else
|
||||
fi
|
||||
|
||||
AVALANCHEGO_PATH=${AVALANCHEGO_BUILD_PATH}/avalanchego
|
||||
AVALANCHEGO_PLUGIN_DIR=${AVALANCHEGO_BUILD_PATH}/plugins
|
||||
|
||||
mkdir -p "${AVALANCHEGO_BUILD_PATH}"
|
||||
|
||||
@@ -125,4 +124,4 @@ cp "${BUILD_DIR}"/avalanchego "${AVALANCHEGO_PATH}"
|
||||
|
||||
echo "Installed AvalancheGo release ${AVALANCHE_VERSION}"
|
||||
echo "AvalancheGo Path: ${AVALANCHEGO_PATH}"
|
||||
echo "Plugin Dir: ${AVALANCHEGO_PLUGIN_DIR}"
|
||||
echo "Plugin Dir: ${DEFAULT_PLUGIN_DIR}"
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ source "$SUBNET_EVM_PATH"/scripts/constants.sh
|
||||
# Set up avalanche binary path and assume build directory is set
|
||||
AVALANCHEGO_BUILD_PATH=${AVALANCHEGO_BUILD_PATH:-"$GOPATH/src/github.com/ava-labs/avalanchego/build"}
|
||||
AVALANCHEGO_PATH=${AVALANCHEGO_PATH:-"$AVALANCHEGO_BUILD_PATH/avalanchego"}
|
||||
AVALANCHEGO_PLUGIN_DIR=${AVALANCHEGO_PLUGIN_DIR:-"$AVALANCHEGO_BUILD_PATH/plugins"}
|
||||
AVALANCHEGO_PLUGIN_DIR=${AVALANCHEGO_PLUGIN_DIR:-"$DEFAULT_PLUGIN_DIR"}
|
||||
DATA_DIR=${DATA_DIR:-/tmp/subnet-evm-start-node/$(date "+%Y-%m-%d%:%H:%M:%S")}
|
||||
|
||||
mkdir -p "$DATA_DIR"
|
||||
|
||||
@@ -22,7 +22,7 @@ go install -v github.com/onsi/ginkgo/v2/ginkgo@"${GINKGO_VERSION}"
|
||||
EXTRA_ARGS=()
|
||||
AVALANCHEGO_BUILD_PATH="${AVALANCHEGO_BUILD_PATH:-}"
|
||||
if [[ -n "${AVALANCHEGO_BUILD_PATH}" ]]; then
|
||||
EXTRA_ARGS=("--avalanchego-path=${AVALANCHEGO_BUILD_PATH}/avalanchego" "--plugin-dir=${AVALANCHEGO_BUILD_PATH}/plugins")
|
||||
EXTRA_ARGS=("--avalanchego-path=${AVALANCHEGO_BUILD_PATH}/avalanchego")
|
||||
echo "Running with extra args:" "${EXTRA_ARGS[@]}"
|
||||
fi
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ go install -v github.com/onsi/ginkgo/v2/ginkgo@"${GINKGO_VERSION}"
|
||||
EXTRA_ARGS=()
|
||||
AVALANCHEGO_BUILD_PATH="${AVALANCHEGO_BUILD_PATH:-}"
|
||||
if [[ -n "${AVALANCHEGO_BUILD_PATH}" ]]; then
|
||||
EXTRA_ARGS=("--avalanchego-path=${AVALANCHEGO_BUILD_PATH}/avalanchego" "--plugin-dir=${AVALANCHEGO_BUILD_PATH}/plugins")
|
||||
EXTRA_ARGS=("--avalanchego-path=${AVALANCHEGO_BUILD_PATH}/avalanchego")
|
||||
echo "Running with extra args:" "${EXTRA_ARGS[@]}"
|
||||
fi
|
||||
|
||||
|
||||
+1
-3
@@ -14,9 +14,7 @@ test runs to minimize the setup cost involved:
|
||||
$ ./scripts/build_tmpnetctl.sh
|
||||
|
||||
# Start a new temporary network configured with subnet-evm's default plugin path
|
||||
$ ./build/tmpnetctl start-network \
|
||||
--avalanche-path=./build/avalanchego
|
||||
--plugin-dir=$GOPATH/src/github.com/ava-labs/avalanchego/build/plugins
|
||||
$ ./build/tmpnetctl start-network --avalanche-path=./build/avalanchego
|
||||
|
||||
# From the root of a clone of subnet-evm, execute the warp test suite against the existing network
|
||||
$ ginkgo -vv ./tests/warp -- --use-existing-network --network-dir=$HOME/.tmpnet/networks/latest
|
||||
|
||||
Reference in New Issue
Block a user