Files
evm/scripts/update_luxd_version.sh
zeekayandGitHub 8d53833026 env: drop LUX_ prefix from env vars (noise) (#113)
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.
2026-05-15 16:05:42 -07:00

44 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
if ! [[ "$0" =~ scripts/update_luxd_version.sh ]]; then
echo "must be run from repository root, but got $0"
exit 255
fi
EVM_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
)
# If version is not provided, the existing version in go.mod is assumed
VERSION="${1:-}"
if [[ -n "${VERSION}" ]]; then
echo "Ensuring Node version $VERSION in go.mod"
go get "github.com/luxfi/node@${VERSION}"
go mod tidy
fi
# Discover LUXD_VERSION
. "$EVM_PATH"/scripts/constants.sh
# The full SHA is required for versioning custom actions.
CURL_ARGS=(curl -s)
if [[ -n "${GITHUB_TOKEN:-}" ]]; then
# Using an auth token avoids being rate limited when run in CI
CURL_ARGS+=(-H "Authorization: token ${GITHUB_TOKEN}")
else
echo "No GITHUB_TOKEN found, using unauthenticated requests"
fi
GIT_COMMIT=$("${CURL_ARGS[@]}" "https://api.github.com/repos/luxfi/node/commits/${LUXD_VERSION}")
FULL_LUXD_VERSION="$(grep -m1 '"sha":' <<< "${GIT_COMMIT}" | cut -d'"' -f4)"
# Ensure the custom action version matches the lux version
WORKFLOW_PATH=".github/workflows/tests.yml"
CUSTOM_ACTION="luxfi/node/.github/actions/run-monitored-tmpnet-cmd"
echo "Ensuring Node version ${FULL_LUXD_VERSION} for ${CUSTOM_ACTION} custom action in ${WORKFLOW_PATH} "
sed -i.bak "s|\(uses: ${CUSTOM_ACTION}\)@.*|\1@${FULL_LUXD_VERSION}|g" "${WORKFLOW_PATH}" && rm -f "${WORKFLOW_PATH}.bak"