mirror of
https://github.com/luxfi/node.git
synced 2026-07-27 03:39:39 +00:00
chore(brand): drop LUX_ env-var prefixes (LUX_PATH, LUX_KMS_*, LUX_CGO, LUX_PRIVATE_KEY, LUX_AUTOMINE_*)
- scripts/* + .github/actions/* + .github/workflows/*: LUX_PATH -> NODE_PATH, LUX_VERSION -> NODE_VERSION. - Dockerfile: LUX_CGO -> CGO_ENABLED (matches Go convention). - staking/kms.go: LUX_KMS_ENDPOINT/PATH/TOKEN -> KMS_ENDPOINT/PATH/TOKEN. - deploy-subnets.sh: LUX_PRIVATE_KEY -> PRIVATE_KEY. - config/config.go: drop LUX_AUTOMINE_CCHAIN_GENESIS_PATH env override; downstream networks ship their own platform-genesis bundle instead.
This commit is contained in:
@@ -17,13 +17,13 @@ if [[ "${TEST_SETUP}" != "node" && "${TEST_SETUP}" != "xsvm" ]]; then
|
||||
fi
|
||||
|
||||
# Directory above this script
|
||||
LUX_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
|
||||
NODE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
|
||||
|
||||
source "${LUX_PATH}"/scripts/constants.sh
|
||||
source "${LUX_PATH}"/scripts/git_commit.sh
|
||||
source "${NODE_PATH}"/scripts/constants.sh
|
||||
source "${NODE_PATH}"/scripts/git_commit.sh
|
||||
|
||||
# Import common functions used to build images for antithesis test setups
|
||||
source "${LUX_PATH}"/scripts/lib_build_antithesis_images.sh
|
||||
source "${NODE_PATH}"/scripts/lib_build_antithesis_images.sh
|
||||
|
||||
# Specifying an image prefix will ensure the image is pushed after build
|
||||
IMAGE_PREFIX="${IMAGE_PREFIX:-}"
|
||||
@@ -41,7 +41,7 @@ GO_VERSION="$(go list -m -f '{{.GoVersion}}')"
|
||||
# Helper to simplify calling build_builder_image for test setups in this repo
|
||||
function build_builder_image_for_node {
|
||||
echo "Building builder image"
|
||||
build_antithesis_builder_image "${GO_VERSION}" "antithesis-node-builder:${IMAGE_TAG}" "${LUX_PATH}" "${LUX_PATH}"
|
||||
build_antithesis_builder_image "${GO_VERSION}" "antithesis-node-builder:${IMAGE_TAG}" "${NODE_PATH}" "${NODE_PATH}"
|
||||
}
|
||||
|
||||
# Helper to simplify calling build_antithesis_images for test setups in this repo
|
||||
@@ -57,35 +57,35 @@ function build_antithesis_images_for_node {
|
||||
echo "Building images for ${test_setup}"
|
||||
fi
|
||||
build_antithesis_images "${GO_VERSION}" "${image_prefix}" "antithesis-${test_setup}" "${IMAGE_TAG}" "${IMAGE_TAG}" \
|
||||
"${LUX_PATH}/tests/antithesis/${test_setup}/Dockerfile" "${uninstrumented_node_dockerfile}" \
|
||||
"${LUX_PATH}" "${node_only}" "${git_commit}"
|
||||
"${NODE_PATH}/tests/antithesis/${test_setup}/Dockerfile" "${uninstrumented_node_dockerfile}" \
|
||||
"${NODE_PATH}" "${node_only}" "${git_commit}"
|
||||
}
|
||||
|
||||
if [[ "${TEST_SETUP}" == "node" ]]; then
|
||||
build_builder_image_for_node
|
||||
|
||||
echo "Generating compose configuration for ${TEST_SETUP}"
|
||||
gen_antithesis_compose_config "${IMAGE_TAG}" "${LUX_PATH}/tests/antithesis/node/gencomposeconfig" \
|
||||
"${LUX_PATH}/build/antithesis/node"
|
||||
gen_antithesis_compose_config "${IMAGE_TAG}" "${NODE_PATH}/tests/antithesis/node/gencomposeconfig" \
|
||||
"${NODE_PATH}/build/antithesis/node"
|
||||
|
||||
build_antithesis_images_for_node "${TEST_SETUP}" "${IMAGE_PREFIX}" "${LUX_PATH}/Dockerfile" "${NODE_ONLY:-}"
|
||||
build_antithesis_images_for_node "${TEST_SETUP}" "${IMAGE_PREFIX}" "${NODE_PATH}/Dockerfile" "${NODE_ONLY:-}"
|
||||
else
|
||||
build_builder_image_for_node
|
||||
|
||||
# Only build the node node image to use as the base for the xsvm image. Provide an empty
|
||||
# image prefix (the 1st argument) to prevent the image from being pushed
|
||||
NODE_ONLY=1
|
||||
build_antithesis_images_for_node node "" "${LUX_PATH}/Dockerfile" "${NODE_ONLY}"
|
||||
build_antithesis_images_for_node node "" "${NODE_PATH}/Dockerfile" "${NODE_ONLY}"
|
||||
|
||||
# Ensure node and xsvm binaries are available to create an initial db state that includes chains.
|
||||
echo "Building binaries required for configuring the ${TEST_SETUP} test setup"
|
||||
"${LUX_PATH}"/scripts/build.sh
|
||||
"${LUX_PATH}"/scripts/build_xsvm.sh
|
||||
"${NODE_PATH}"/scripts/build.sh
|
||||
"${NODE_PATH}"/scripts/build_xsvm.sh
|
||||
|
||||
echo "Generating compose configuration for ${TEST_SETUP}"
|
||||
gen_antithesis_compose_config "${IMAGE_TAG}" "${LUX_PATH}/tests/antithesis/xsvm/gencomposeconfig" \
|
||||
"${LUX_PATH}/build/antithesis/xsvm" \
|
||||
"LUXD_PATH=${LUX_PATH}/build/node LUXD_PLUGIN_DIR=${LUX_PATH}/build/plugins"
|
||||
gen_antithesis_compose_config "${IMAGE_TAG}" "${NODE_PATH}/tests/antithesis/xsvm/gencomposeconfig" \
|
||||
"${NODE_PATH}/build/antithesis/xsvm" \
|
||||
"LUXD_PATH=${NODE_PATH}/build/node LUXD_PLUGIN_DIR=${NODE_PATH}/build/plugins"
|
||||
|
||||
build_antithesis_images_for_node "${TEST_SETUP}" "${IMAGE_PREFIX}" "${LUX_PATH}/vms/example/xsvm/Dockerfile"
|
||||
build_antithesis_images_for_node "${TEST_SETUP}" "${IMAGE_PREFIX}" "${NODE_PATH}/vms/example/xsvm/Dockerfile"
|
||||
fi
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
set -euo pipefail
|
||||
|
||||
# Luxgo root folder
|
||||
LUX_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
|
||||
NODE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
|
||||
# Load the constants
|
||||
source "$LUX_PATH"/scripts/constants.sh
|
||||
source "$LUX_PATH"/scripts/git_commit.sh
|
||||
source "$NODE_PATH"/scripts/constants.sh
|
||||
source "$NODE_PATH"/scripts/git_commit.sh
|
||||
|
||||
echo "Building bootstrap-monitor..."
|
||||
go build -ldflags\
|
||||
"-X github.com/luxfi/node/version.GitCommit=$git_commit $static_ld_flags"\
|
||||
-o "$LUX_PATH/build/bootstrap-monitor"\
|
||||
"$LUX_PATH/tests/fixture/bootstrapmonitor/cmd/"*.go
|
||||
-o "$NODE_PATH/build/bootstrap-monitor"\
|
||||
"$NODE_PATH/tests/fixture/bootstrapmonitor/cmd/"*.go
|
||||
|
||||
@@ -10,10 +10,10 @@ set -euo pipefail
|
||||
# Builds the image for the bootstrap monitor
|
||||
|
||||
# Directory above this script
|
||||
LUX_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
|
||||
NODE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
|
||||
|
||||
# Load the constants
|
||||
source "$LUX_PATH"/scripts/constants.sh
|
||||
source "$NODE_PATH"/scripts/constants.sh
|
||||
|
||||
# The published name should be 'avaplatform/bootstrap-monitor', but to avoid unintentional pushes it
|
||||
# is defaulted to 'bootstrap-monitor' (without a repo or registry name) which can only be used to
|
||||
@@ -27,4 +27,4 @@ export SKIP_BUILD_RACE=1
|
||||
# to run the bootstrap monitor will need to specify ./bootstrap-monitor".
|
||||
#
|
||||
# TODO(marun) Figure out how to set the CMD for a multi-arch image.
|
||||
bash -x "${LUX_PATH}"/scripts/build_image.sh --build-arg BUILD_SCRIPT=build_bootstrap_monitor.sh
|
||||
bash -x "${NODE_PATH}"/scripts/build_image.sh --build-arg BUILD_SCRIPT=build_bootstrap_monitor.sh
|
||||
|
||||
@@ -11,9 +11,9 @@ set -euo pipefail
|
||||
# Mostly taken from https://github.com/golang/go/issues/46312#issuecomment-1153345129
|
||||
|
||||
# Directory above this script
|
||||
LUX_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
|
||||
NODE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
|
||||
# Load the constants
|
||||
source "$LUX_PATH"/scripts/constants.sh
|
||||
source "$NODE_PATH"/scripts/constants.sh
|
||||
|
||||
fuzzTime=${1:-1}
|
||||
fuzzDir=${2:-.}
|
||||
|
||||
@@ -27,7 +27,7 @@ set -euo pipefail
|
||||
# Reference: https://docs.docker.com/buildx/working-with-buildx/
|
||||
|
||||
# Directory above this script
|
||||
LUX_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
|
||||
NODE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
|
||||
|
||||
# Skip building the race image
|
||||
SKIP_BUILD_RACE="${SKIP_BUILD_RACE:-}"
|
||||
@@ -36,9 +36,9 @@ SKIP_BUILD_RACE="${SKIP_BUILD_RACE:-}"
|
||||
FORCE_TAG_LATEST="${FORCE_TAG_LATEST:-}"
|
||||
|
||||
# Load the constants
|
||||
source "$LUX_PATH"/scripts/constants.sh
|
||||
source "$LUX_PATH"/scripts/git_commit.sh
|
||||
source "$LUX_PATH"/scripts/image_tag.sh
|
||||
source "$NODE_PATH"/scripts/constants.sh
|
||||
source "$NODE_PATH"/scripts/git_commit.sh
|
||||
source "$NODE_PATH"/scripts/image_tag.sh
|
||||
|
||||
if [[ -z "${SKIP_BUILD_RACE}" && $image_tag == *"-r" ]]; then
|
||||
echo "Branch name must not end in '-r'"
|
||||
@@ -108,12 +108,12 @@ fi
|
||||
|
||||
echo "Building Docker Image with tags: $DOCKER_IMAGE:$commit_hash , $DOCKER_IMAGE:$image_tag"
|
||||
${DOCKER_CMD} -t "$DOCKER_IMAGE:$commit_hash" -t "$DOCKER_IMAGE:$image_tag" \
|
||||
"$LUX_PATH" -f "$LUX_PATH/Dockerfile"
|
||||
"$NODE_PATH" -f "$NODE_PATH/Dockerfile"
|
||||
|
||||
if [[ -z "${SKIP_BUILD_RACE}" ]]; then
|
||||
echo "Building Docker Image with tags (race detector): $DOCKER_IMAGE:$commit_hash-r , $DOCKER_IMAGE:$image_tag-r"
|
||||
${DOCKER_CMD} --build-arg="RACE_FLAG=-r" -t "$DOCKER_IMAGE:$commit_hash-r" -t "$DOCKER_IMAGE:$image_tag-r" \
|
||||
"$LUX_PATH" -f "$LUX_PATH/Dockerfile"
|
||||
"$NODE_PATH" -f "$NODE_PATH/Dockerfile"
|
||||
fi
|
||||
|
||||
# Only tag the latest image for the master branch when images are pushed to a registry
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
set -euo pipefail
|
||||
|
||||
# Directory above this script
|
||||
LUX_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
|
||||
NODE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
|
||||
# Load the constants
|
||||
source "$LUX_PATH"/scripts/constants.sh
|
||||
source "$NODE_PATH"/scripts/constants.sh
|
||||
|
||||
EXCLUDED_TARGETS="| grep -v /mocks | grep -v proto | grep -v tests/e2e | grep -v tests/load/c | grep -v tests/upgrade | grep -v tests/fixture/bootstrapmonitor/e2e"
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
set -euo pipefail
|
||||
|
||||
# Luxgo root folder
|
||||
LUX_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
|
||||
NODE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
|
||||
# Load the constants
|
||||
source "$LUX_PATH"/scripts/constants.sh
|
||||
source "$LUX_PATH"/scripts/git_commit.sh
|
||||
source "$NODE_PATH"/scripts/constants.sh
|
||||
source "$NODE_PATH"/scripts/git_commit.sh
|
||||
|
||||
echo "Building tmpnetctl..."
|
||||
go build -ldflags\
|
||||
"-X github.com/luxfi/node/version.GitCommit=$git_commit $static_ld_flags"\
|
||||
-o "$LUX_PATH/build/tmpnetctl"\
|
||||
"$LUX_PATH/tests/fixture/tmpnet/tmpnetctl/"*.go
|
||||
-o "$NODE_PATH/build/tmpnetctl"\
|
||||
"$NODE_PATH/tests/fixture/tmpnet/tmpnetctl/"*.go
|
||||
|
||||
@@ -8,10 +8,10 @@ set -euo pipefail
|
||||
# Use lower_case variables in the scripts and UPPER_CASE variables for override
|
||||
# Use the constants.sh for env overrides
|
||||
|
||||
LUX_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd ) # Directory above this script
|
||||
NODE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd ) # Directory above this script
|
||||
|
||||
# Where Lux Node binary goes
|
||||
node_path="$LUX_PATH/build/luxd"
|
||||
node_path="$NODE_PATH/build/luxd"
|
||||
|
||||
# Docker Hub repository for node images
|
||||
node_dockerhub_repo="luxfi/node"
|
||||
@@ -45,8 +45,8 @@ export GONOSUMDB="${GONOSUMDB:-github.com/luxfi/*}"
|
||||
LUXCPP_ROOT="${LUXCPP_ROOT:-}"
|
||||
if [ -z "$LUXCPP_ROOT" ]; then
|
||||
# Try to find luxcpp relative to this repo
|
||||
if [ -d "$LUX_PATH/../luxcpp/install/lib/pkgconfig" ]; then
|
||||
LUXCPP_ROOT="$LUX_PATH/../luxcpp/install"
|
||||
if [ -d "$NODE_PATH/../luxcpp/install/lib/pkgconfig" ]; then
|
||||
LUXCPP_ROOT="$NODE_PATH/../luxcpp/install"
|
||||
elif [ -d "$HOME/work/luxcpp/install/lib/pkgconfig" ]; then
|
||||
LUXCPP_ROOT="$HOME/work/luxcpp/install"
|
||||
fi
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
LUX_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd ) # Directory above this script
|
||||
NODE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd ) # Directory above this script
|
||||
|
||||
# WARNING: this will use the most recent commit even if there are un-committed changes present
|
||||
git_commit="${LUXD_COMMIT:-$(git --git-dir="${LUX_PATH}/.git" rev-parse HEAD)}"
|
||||
git_commit="${LUXD_COMMIT:-$(git --git-dir="${NODE_PATH}/.git" rev-parse HEAD)}"
|
||||
commit_hash="${git_commit::8}"
|
||||
|
||||
# Extract version from git tag - try git first, then fallback to version file
|
||||
# Examples: v1.22.19 -> 1.22.19, v1.22.19-0-g7dc749f -> 1.22.19
|
||||
git_raw_version="${LUXD_VERSION:-$(git --git-dir="${LUX_PATH}/.git" describe --tags --always 2>/dev/null || echo "")}"
|
||||
git_raw_version="${LUXD_VERSION:-$(git --git-dir="${NODE_PATH}/.git" describe --tags --always 2>/dev/null || echo "")}"
|
||||
|
||||
# Strip leading 'v' if present
|
||||
git_raw_version="${git_raw_version#v}"
|
||||
@@ -24,9 +24,9 @@ if [[ "$git_raw_version" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
|
||||
version_major="${BASH_REMATCH[1]}"
|
||||
version_minor="${BASH_REMATCH[2]}"
|
||||
version_patch="${BASH_REMATCH[3]}"
|
||||
elif [[ -f "${LUX_PATH}/version.txt" ]]; then
|
||||
elif [[ -f "${NODE_PATH}/version.txt" ]]; then
|
||||
# Fallback to version.txt file for CI builds without tags
|
||||
version_content=$(cat "${LUX_PATH}/version.txt")
|
||||
version_content=$(cat "${NODE_PATH}/version.txt")
|
||||
if [[ "$version_content" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
|
||||
version_major="${BASH_REMATCH[1]}"
|
||||
version_minor="${BASH_REMATCH[2]}"
|
||||
|
||||
@@ -16,18 +16,18 @@ set -euo pipefail
|
||||
# TEST_SETUP=node ./scripts/tests.build_antithesis_images.sh # Test build of images for node test setup
|
||||
# DEBUG=1 TEST_SETUP=node ./scripts/tests.build_antithesis_images.sh # Retain the temporary compose path for troubleshooting
|
||||
|
||||
LUX_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
|
||||
NODE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
|
||||
|
||||
# Discover the default tag that will be used for the image
|
||||
source "${LUX_PATH}"/scripts/git_commit.sh
|
||||
source "${NODE_PATH}"/scripts/git_commit.sh
|
||||
export IMAGE_TAG="${commit_hash}"
|
||||
|
||||
# Build the images for the specified test setup
|
||||
export TEST_SETUP="${TEST_SETUP:-}"
|
||||
bash -x "${LUX_PATH}"/scripts/build_antithesis_images.sh
|
||||
bash -x "${NODE_PATH}"/scripts/build_antithesis_images.sh
|
||||
|
||||
# Test the images
|
||||
export IMAGE_NAME="antithesis-${TEST_SETUP}-config"
|
||||
export DEBUG="${DEBUG:-}"
|
||||
set -x
|
||||
. "${LUX_PATH}"/scripts/lib_test_antithesis_images.sh
|
||||
. "${NODE_PATH}"/scripts/lib_test_antithesis_images.sh
|
||||
|
||||
@@ -9,11 +9,11 @@ set -euo pipefail
|
||||
# TODO(marun) Perform more extensive validation (e.g. e2e testing) against one or more images
|
||||
|
||||
# Directory above this script
|
||||
LUX_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
|
||||
NODE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
|
||||
|
||||
source "$LUX_PATH"/scripts/constants.sh
|
||||
source "$LUX_PATH"/scripts/git_commit.sh
|
||||
source "$LUX_PATH"/scripts/image_tag.sh
|
||||
source "$NODE_PATH"/scripts/constants.sh
|
||||
source "$NODE_PATH"/scripts/git_commit.sh
|
||||
source "$NODE_PATH"/scripts/image_tag.sh
|
||||
|
||||
build_and_test() {
|
||||
local image_name=$1
|
||||
|
||||
Reference in New Issue
Block a user