mirror of
https://github.com/luxfi/evm.git
synced 2026-09-24 00:27:44 +00:00
Renames LUX_-prefixed env vars to their canonical, non-noisy forms:
- LUX_RLP_PATH -> RLP_PATH (test override for the RLP fixture path)
- LUX_VERSION -> LUXD_VERSION (the luxd version being downloaded/cloned)
- LUX_PLUGIN_DIR -> PLUGIN_DIR (the lux plugin install dir, ~/.lux/plugins)
LUX_VERSION had two callers: shell scripts treating it as the luxd
version, and install_luxd_release.sh that already aliased
'LUXD_VERSION=${LUXD_VERSION:-${LUX_VERSION#v}}' on read. Collapse this
to a single canonical name (LUXD_VERSION) and a one-liner v-prefix
strip; no more aliasing.
LUX_PLUGIN_DIR points at ~/.lux/plugins on disk — the path is unchanged,
only the env var name. INSTALL=1 ./scripts/build.sh continues to work,
just driven from $PLUGIN_DIR.
Note: the historical README mention of LUX_VM_RUNTIME_ENGINE_ADDR /
LUX_VM_TRANSPORT (legacy luxfi/vm <= v1.1.0 names) is left in place
because it documents past behavior, per task convention for CHANGELOG/
historical docs.
BREAKING: external callers (CI, dev scripts, operators) must update
env var names. Per CLAUDE.md no-backwards-compatibility rule, the old
forms are removed.
62 lines
2.5 KiB
Bash
Executable File
62 lines
2.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
# Builds docker images for antithesis testing.
|
|
|
|
# e.g.,
|
|
# ./scripts/build_antithesis_images.sh # Build local images
|
|
# IMAGE_PREFIX=<registry>/<repo> IMAGE_TAG=latest ./scripts/build_antithesis_images.sh # Specify a prefix to enable image push and use a specific tag
|
|
|
|
# Directory above this script
|
|
EVM_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
|
|
|
|
# Assume it's necessary to build the luxd node image from source
|
|
# TODO(marun) Support use of a released node image if using a release version of luxd
|
|
|
|
source "${EVM_PATH}"/scripts/constants.sh
|
|
# shellcheck source=/dev/null
|
|
source "${EVM_PATH}"/scripts/lib_luxd_clone.sh
|
|
|
|
clone_luxd "${LUXD_VERSION}"
|
|
LUXD_IMAGE_TAG="$(luxd_image_tag_from_clone)"
|
|
|
|
# Build luxd node image in the clone path
|
|
pushd "${LUXD_CLONE_PATH}" > /dev/null
|
|
NODE_ONLY=1 TEST_SETUP=luxd IMAGE_TAG="${LUXD_IMAGE_TAG}" bash -x "${LUXD_CLONE_PATH}"/scripts/build_antithesis_images.sh
|
|
popd > /dev/null
|
|
|
|
# Specifying an image prefix will ensure the image is pushed after build
|
|
IMAGE_PREFIX="${IMAGE_PREFIX:-}"
|
|
|
|
IMAGE_TAG="${IMAGE_TAG:-}"
|
|
if [[ -z "${IMAGE_TAG}" ]]; then
|
|
# Default to tagging with the commit hash
|
|
source "${EVM_PATH}"/scripts/constants.sh
|
|
IMAGE_TAG="${EVM_COMMIT::8}"
|
|
fi
|
|
|
|
# The dockerfiles don't specify the golang version to minimize the changes required to bump
|
|
# the version. Instead, the golang version is provided as an argument.
|
|
GO_VERSION="$(go list -m -f '{{.GoVersion}}')"
|
|
|
|
# Import common functions used to build images for antithesis test setups
|
|
# shellcheck source=/dev/null
|
|
source "${LUXD_CLONE_PATH}"/scripts/lib_build_antithesis_images.sh
|
|
|
|
build_antithesis_builder_image "${GO_VERSION}" "antithesis-evm-builder:${IMAGE_TAG}" "${LUXD_CLONE_PATH}" "${EVM_PATH}"
|
|
|
|
# Ensure luxd and evm binaries are available to create an initial db state that includes subnets.
|
|
pushd "${LUXD_CLONE_PATH}" && ./scripts/build.sh && popd
|
|
"${EVM_PATH}"/scripts/build.sh
|
|
|
|
echo "Generating compose configuration"
|
|
gen_antithesis_compose_config "${IMAGE_TAG}" "${EVM_PATH}/tests/antithesis/gencomposeconfig" \
|
|
"${EVM_PATH}/build/antithesis" \
|
|
"LUXD_PATH=${LUXD_CLONE_PATH}/build/luxd \
|
|
LUXD_PLUGIN_DIR=${PLUGIN_DIR}"
|
|
|
|
build_antithesis_images "${GO_VERSION}" "${IMAGE_PREFIX}" "antithesis-evm" "${IMAGE_TAG}" \
|
|
"${LUXD_IMAGE_TAG}" "${EVM_PATH}/tests/antithesis/Dockerfile" \
|
|
"${EVM_PATH}/Dockerfile" "${EVM_PATH}"
|