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:
Hanzo AI
2026-05-15 12:15:55 -07:00
parent f56ab5d4af
commit 6295e68ea0
19 changed files with 91 additions and 111 deletions
@@ -12,9 +12,9 @@ else
MODULE_DETAILS="$(go list -m "github.com/luxfi/node" 2>/dev/null)"
# Extract the version part
LUX_VERSION="$(echo "${MODULE_DETAILS}" | awk '{print $2}')"
NODE_VERSION="$(echo "${MODULE_DETAILS}" | awk '{print $2}')"
if [[ -z "${LUX_VERSION}" ]]; then
if [[ -z "${NODE_VERSION}" ]]; then
echo "Failed to get luxd version from go.mod"
exit 1
fi
@@ -23,12 +23,12 @@ else
# v*YYYYMMDDHHMMSS-abcdef123456
#
# If not, the value is assumed to represent a tag
if [[ "${LUX_VERSION}" =~ ^v.*[0-9]{14}-[0-9a-f]{12}$ ]]; then
if [[ "${NODE_VERSION}" =~ ^v.*[0-9]{14}-[0-9a-f]{12}$ ]]; then
# Use the module hash as the version
LUX_VERSION="$(echo "${LUX_VERSION}" | cut -d'-' -f3)"
NODE_VERSION="$(echo "${NODE_VERSION}" | cut -d'-' -f3)"
fi
FLAKE="github:luxfi/node?ref=${LUX_VERSION}"
FLAKE="github:luxfi/node?ref=${NODE_VERSION}"
echo "Starting nix shell for ${FLAKE}"
fi
@@ -9,6 +9,6 @@ set -euo pipefail
# when go is already installed.
# 3 directories above this script
LUX_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd ../../.. && pwd )
NODE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd ../../.. && pwd )
echo GO_VERSION="~$(sed -n -e 's/^go //p' "${LUX_PATH}"/go.mod)"
echo GO_VERSION="~$(sed -n -e 's/^go //p' "${NODE_PATH}"/go.mod)"
+4 -4
View File
@@ -5,9 +5,9 @@ set -o nounset
set -o pipefail
# Lux root directory
LUX_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd ../.. && pwd )
NODE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd ../.. && pwd )
"$LUX_PATH"/scripts/build.sh
"$NODE_PATH"/scripts/build.sh
# Check to see if the build script creates any unstaged changes to prevent
# regression where builds go.mod/go.sum files get out of date.
if [[ -z $(git status -s) ]]; then
@@ -15,5 +15,5 @@ if [[ -z $(git status -s) ]]; then
# TODO: Revise this check once we can reliably build without changes
# exit 1
fi
"$LUX_PATH"/scripts/build_test.sh
"$LUX_PATH"/scripts/build_fuzz.sh 2
"$NODE_PATH"/scripts/build_test.sh
"$NODE_PATH"/scripts/build_fuzz.sh 2
+1 -1
View File
@@ -51,7 +51,7 @@ jobs:
platforms: linux/amd64
push: true
build-args: |
LUX_CGO=0
CGO_ENABLED=0
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false
+10 -10
View File
@@ -82,17 +82,17 @@ RUN ARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) && \
ldconfig 2>/dev/null || true
# Fetch pre-built luxcpp/cevm libs (libevm, libevm-gpu, libluxgpu,
# libcevm_precompiles + go_bridge.h). When LUX_CGO=1 these libraries are
# libcevm_precompiles + go_bridge.h). When CGO_ENABLED=1 these libraries are
# linked into the C-Chain plugin via github.com/luxfi/chains/evm/cevm
# and become the default execution backend (parallel + GPU EVM).
#
# CI/RELEASE GAP: the luxcpp/cevm release artifacts MUST publish per-arch
# tarballs at the URL below for both linux-x86_64 and linux-arm64. Until
# those tarballs exist, builds with LUX_CGO=1 will fail at this step and
# operators must build with LUX_CGO=0 (pure-Go fallback).
ARG LUX_CGO=1
# those tarballs exist, builds with CGO_ENABLED=1 will fail at this step and
# operators must build with CGO_ENABLED=0 (pure-Go fallback).
ARG CGO_ENABLED=1
ARG CEVM_VERSION=v0.19.0
RUN if [ "${LUX_CGO}" = "1" ]; then \
RUN if [ "${CGO_ENABLED}" = "1" ]; then \
ARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) && \
if [ "$ARCH" = "amd64" ]; then CEVM_ARCH="linux-x86_64"; else CEVM_ARCH="linux-arm64"; fi && \
wget -q "https://github.com/luxcpp/cevm/releases/download/${CEVM_VERSION}/luxcpp-cevm-${CEVM_ARCH}.tar.gz" \
@@ -101,17 +101,17 @@ RUN if [ "${LUX_CGO}" = "1" ]; then \
rm /tmp/cevm.tar.gz && \
ldconfig 2>/dev/null || true ; \
else \
echo "LUX_CGO=0: skipping luxcpp/cevm fetch (pure-Go fallback build)" ; \
echo "CGO_ENABLED=0: skipping luxcpp/cevm fetch (pure-Go fallback build)" ; \
fi
# Build node. LUX_CGO=1 (default) links luxcpp/cevm for parallel + GPU EVM.
# Set LUX_CGO=0 for portable pure-Go builds without the native libs.
# Build node. CGO_ENABLED=1 (default) links luxcpp/cevm for parallel + GPU EVM.
# Set CGO_ENABLED=0 for portable pure-Go builds without the native libs.
ARG RACE_FLAG=""
ARG BUILD_SCRIPT=build.sh
ARG LUXD_COMMIT=""
ENV CGO_ENABLED=${LUX_CGO}
ENV CGO_ENABLED=${CGO_ENABLED}
RUN . ./build_env.sh && \
echo "{CC=$CC, TARGETPLATFORM=$TARGETPLATFORM, BUILDPLATFORM=$BUILDPLATFORM, LUX_CGO=${LUX_CGO}}" && \
echo "{CC=$CC, TARGETPLATFORM=$TARGETPLATFORM, BUILDPLATFORM=$BUILDPLATFORM, CGO_ENABLED=${CGO_ENABLED}}" && \
export GOARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) && \
export LUXD_COMMIT="${LUXD_COMMIT}" && \
GOFLAGS="-mod=mod" ./scripts/${BUILD_SCRIPT} ${RACE_FLAG}
+7 -27
View File
@@ -1299,13 +1299,8 @@ func getOrCreateAutomineGenesis(stakingCfg *builder.StakingConfig, dataDir strin
// Save for future restarts. The CChainGenesis field is metadata only —
// the actual genesis bytes are embedded in genesisBytes — but mirror
// the resolved value (env override or default) so audits read true.
// the resolved value so audits read true.
savedCChain := automineCChainGenesis
if path := os.Getenv("LUX_AUTOMINE_CCHAIN_GENESIS_PATH"); path != "" {
if body, ferr := os.ReadFile(path); ferr == nil {
savedCChain = string(body)
}
}
newDevCfg := &AutomineNetworkConfig{
Version: devNetworkConfigVersion,
StartTime: startTime,
@@ -1338,18 +1333,10 @@ func getOrCreateAutomineGenesis(stakingCfg *builder.StakingConfig, dataDir strin
// buildAutomineGenesis creates a genesis configuration for single-node development mode.
// It uses the node's own credentials as the sole validator.
//
// C-Chain genesis resolution order:
// 1. LUX_AUTOMINE_CCHAIN_GENESIS_PATH env — operator-supplied genesis JSON
// file (downstream networks like Liquidity that need a non-default chainId
// point this at their own genesis). Path is read at boot and embedded
// verbatim into the primary-network genesis bytes.
// 2. automineCChainGenesis constant below (chainId 31337, lqd default).
//
// The override is intentional code, not a kludge: lqd's automine flow embeds
// C-Chain genesis bytes into the primary-network genesis at boot, and the
// chain-config-dir scan only resolves AFTER the EVM plugin has already
// loaded its embedded genesis. Without an override, every fork has to patch
// the constant, defeating the point of a shared lqd binary.
// C-Chain genesis comes from the embedded automineCChainGenesis constant
// below (chainId 31337). Downstream networks that need a different
// chainId ship their own platform-genesis bundle; the node does not
// accept an out-of-band file path at runtime.
func buildAutomineGenesis(stakingCfg *builder.StakingConfig, startTime uint64) ([]byte, ids.ID, error) {
// Parse node ID from staking config
nodeID, err := ids.NodeIDFromString(stakingCfg.NodeID)
@@ -1357,16 +1344,9 @@ func buildAutomineGenesis(stakingCfg *builder.StakingConfig, startTime uint64) (
return nil, ids.Empty, fmt.Errorf("failed to parse node ID for automine mode: %w", err)
}
// Resolve C-Chain genesis: env override > built-in default.
// C-Chain genesis: built-in default (downstream networks bring
// their own platform-genesis bundle, not a path read at boot).
cChainGenesis := automineCChainGenesis
if path := os.Getenv("LUX_AUTOMINE_CCHAIN_GENESIS_PATH"); path != "" {
body, ferr := os.ReadFile(path)
if ferr != nil {
return nil, ids.Empty, fmt.Errorf("read LUX_AUTOMINE_CCHAIN_GENESIS_PATH=%q: %w", path, ferr)
}
cChainGenesis = string(body)
log.Info("automine: using operator-supplied C-Chain genesis", "path", path, "size", len(body))
}
// Lux Treasury address: 0x9011E888251AB053B7bD1cdB598Db4f9DEd94714
// This is derived from LUX_MNEMONIC and funded on C-Chain
+1 -1
View File
@@ -42,7 +42,7 @@ deploy_network() {
echo "Deploying subnets to $network"
echo "=============================="
LUX_PRIVATE_KEY="$KEY" "$DEPLOY_BIN" \
PRIVATE_KEY="$KEY" "$DEPLOY_BIN" \
--network="$network" \
--state-dir="$STATE_DIR" 2>&1
+17 -17
View File
@@ -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
+5 -5
View File
@@ -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
+3 -3
View File
@@ -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
+2 -2
View File
@@ -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:-.}
+6 -6
View File
@@ -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
+2 -2
View File
@@ -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"
+5 -5
View File
@@ -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
+4 -4
View File
@@ -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 -5
View File
@@ -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]}"
+4 -4
View File
@@ -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
+4 -4
View File
@@ -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
+4 -4
View File
@@ -77,12 +77,12 @@ func FetchFromKMS(cfg KMSConfig) (*KMSStakingKeys, error) {
// FetchFromKMSEnv reads KMS config from environment variables and fetches staking keys.
func FetchFromKMSEnv() (*KMSStakingKeys, error) {
endpoint := os.Getenv("LUX_KMS_ENDPOINT")
secretPath := os.Getenv("LUX_KMS_STAKING_PATH")
authToken := os.Getenv("LUX_KMS_TOKEN")
endpoint := os.Getenv("KMS_ENDPOINT")
secretPath := os.Getenv("KMS_STAKING_PATH")
authToken := os.Getenv("KMS_TOKEN")
if endpoint == "" || secretPath == "" {
return nil, fmt.Errorf("LUX_KMS_ENDPOINT and LUX_KMS_STAKING_PATH must be set")
return nil, fmt.Errorf("KMS_ENDPOINT and KMS_STAKING_PATH must be set")
}
return FetchFromKMS(KMSConfig{