Files
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

46 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
# This script starts N nodes (TODO N instead of 5) and waits for ctrl-c to shutdown the process group of Luxd processes
# Uses data directory to store all Luxd data neatly in one location with minimal config overhead
if ! [[ "$0" =~ scripts/run.sh ]]; then
echo "must be run from repository root, but got $0"
exit 255
fi
EVM_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
)
# Load the constants
source "$EVM_PATH"/scripts/constants.sh
# Set up lux binary path and assume build directory is set
LUXD_BUILD_PATH=${LUXD_BUILD_PATH:-"$GOPATH/src/github.com/luxfi/luxd/build"}
LUXD_PATH=${LUXD_PATH:-"$LUXD_BUILD_PATH/luxd"}
LUXD_PLUGIN_DIR=${LUXD_PLUGIN_DIR:-"$PLUGIN_DIR"}
DATA_DIR=${DATA_DIR:-/tmp/evm-start-node/$(date "+%Y-%m-%d%:%H:%M:%S")}
mkdir -p "$DATA_DIR"
# Set the config file contents for the path passed in as the first argument
function _set_config(){
cat <<EOF >"$1"
{
"network-id": "local",
"sybil-protection-enabled": false,
"health-check-frequency": "5s",
"plugin-dir": "$LUXD_PLUGIN_DIR"
}
EOF
}
NODE_NAME="node1"
NODE_DATA_DIR="$DATA_DIR/$NODE_NAME"
echo "Creating data directory: $NODE_DATA_DIR"
mkdir -p "$NODE_DATA_DIR"
NODE_CONFIG_FILE_PATH="$NODE_DATA_DIR/config.json"
_set_config "$NODE_CONFIG_FILE_PATH"
(set -x; $LUXD_PATH --data-dir="$NODE_DATA_DIR" --config-file="$NODE_CONFIG_FILE_PATH")