mirror of
https://github.com/luxfi/cli.git
synced 2026-10-30 17:01:20 +00:00
Renames LUX_-prefixed env vars to canonical, non-noisy forms: - LUX_MNEMONIC -> MNEMONIC (deploy script + LLM doc) - LUX_PRIVATE_KEY -> PRIVATE_KEY (deploy script + LLM doc) - LUX_INSECURE_TLS -> INSECURE_TLS - LUX_NODE_ENDPOINT -> NODE_ENDPOINT - LUX_NETWORK_TYPE -> NETWORK_TYPE (backend gRPC server selector) - LUX_RPC_URL -> RPC_URL - LUX_NODE_ROOT -> NODE_ROOT - LUX_CHART_PATH -> CHART_PATH - LUX_CHAINS_FILE -> CHAINS_FILE - LUX_KMS_ROOT_KEY -> KMS_ROOT_KEY - LUX_WC_PROJECT_ID -> WC_PROJECT_ID (WalletConnect) - LUX_BLS_KEY -> BLS_KEY (was already supported via getEnv()) - LUX_KEY_INDEX -> KEY_INDEX (was already supported via getEnv()) pkg/key/backend_env.go: removed the LUX_-prefix-stripping getEnv() helper (now reads env vars by exact name) and dropped the broken "MNEMONIC / MNEMONIC" / "PRIVATE_KEY / PRIVATE_KEY" doc comments which were a previous incomplete rename. NOT renamed (defined in upstream luxfi/constants — separate concern): - LUX_NODE_PATH (constants.EnvNodePath) - LUX_NETRUNNER_PATH (constants.EnvNetrunnerPath) - LUX_EVM_PATH (constants.EnvEVMPath) - LUX_PLUGINS_DIR (constants.EnvPluginsDir) Doc comments referencing those env vars (cmd/root.go, cmd/networkcmd/start.go, cmd/nodecmd/link.go) describe the constants-defined names accurately and are left alone. NOT renamed (script-local variables, not env vars): - LUX_ZONE in scripts/update-cloudflare-dns.sh (Cloudflare DNS zone ID) - LUX_BIN_DIR in scripts/install.sh (~/.lux/bin path constant) BREAKING: external callers/operators must update env var names. Per CLAUDE.md no-backwards-compatibility rule, the old forms are removed.
90 lines
2.6 KiB
Bash
Executable File
90 lines
2.6 KiB
Bash
Executable File
#!/bin/bash
|
|
# Deploy Lux node to DigitalOcean with mnemonic-based key derivation
|
|
# Usage: ./deploy-do-node.sh <network> <mnemonic>
|
|
|
|
set -e
|
|
|
|
MAINNET_IP="164.92.101.46"
|
|
TESTNET_IP="24.144.93.58"
|
|
DEVNET_IP="143.110.230.60"
|
|
|
|
NETWORK=$1
|
|
MNEMONIC="${2:-$MNEMONIC}"
|
|
|
|
if [ -z "$NETWORK" ] || [ -z "$MNEMONIC" ]; then
|
|
echo "Usage: $0 <network> [mnemonic]"
|
|
echo " network: mainnet, testnet, or devnet"
|
|
echo " mnemonic: optional, uses MNEMONIC env var if not provided"
|
|
exit 1
|
|
fi
|
|
|
|
case $NETWORK in
|
|
mainnet) IP=$MAINNET_IP; NETWORK_ID=1 ;;
|
|
testnet) IP=$TESTNET_IP; NETWORK_ID=2 ;;
|
|
devnet) IP=$DEVNET_IP; NETWORK_ID=3 ;;
|
|
*) echo "Invalid network: $NETWORK"; exit 1 ;;
|
|
esac
|
|
|
|
echo "=== Deploying Lux $NETWORK Node to $IP ==="
|
|
|
|
# Upload genesis files
|
|
echo "Uploading genesis files..."
|
|
scp /Users/z/work/lux/genesis/configs/$NETWORK/genesis.json root@$IP:/data/lux/config/
|
|
scp /Users/z/work/lux/genesis/configs/$NETWORK/cchain.json root@$IP:/data/lux/config/ 2>/dev/null || true
|
|
|
|
# Create encrypted mnemonic file and setup on remote
|
|
echo "Setting up node with mnemonic..."
|
|
# shellcheck disable=SC2087 # Intentional: local vars ($MNEMONIC, $NETWORK, $NETWORK_ID) must expand client-side
|
|
ssh root@$IP << REMOTE
|
|
set -e
|
|
|
|
# Store mnemonic in memory-backed file system (tmpfs) for security
|
|
mkdir -p /run/lux
|
|
echo "$MNEMONIC" > /run/lux/mnemonic
|
|
chmod 600 /run/lux/mnemonic
|
|
|
|
# Create systemd service that derives keys from mnemonic
|
|
cat > /etc/systemd/system/luxd.service << 'SYSTEMD'
|
|
[Unit]
|
|
Description=Lux $NETWORK Node
|
|
After=network.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=root
|
|
Environment="MNEMONIC_FILE=/run/lux/mnemonic"
|
|
Environment="NETWORK_ID=$NETWORK_ID"
|
|
ExecStartPre=/usr/local/bin/luxd-keygen --mnemonic-file=/run/lux/mnemonic --output=/data/lux/staking
|
|
ExecStart=/usr/local/bin/luxd \
|
|
--network-id=$NETWORK_ID \
|
|
--genesis-file=/data/lux/config/genesis.json \
|
|
--http-host=0.0.0.0 \
|
|
--http-port=9630 \
|
|
--staking-port=9631 \
|
|
--data-dir=/data/lux/db \
|
|
--plugin-dir=/data/lux/plugins \
|
|
--staking-tls-cert-file=/data/lux/staking/staker.crt \
|
|
--staking-tls-key-file=/data/lux/staking/staker.key \
|
|
--staking-signer-key-file=/data/lux/staking/signer.key \
|
|
--index-enabled \
|
|
--api-admin-enabled \
|
|
--log-level=warn \
|
|
--log-dir=/data/lux/logs \
|
|
--http-allowed-hosts=*
|
|
Restart=always
|
|
RestartSec=10
|
|
LimitNOFILE=65536
|
|
StandardOutput=null
|
|
StandardError=journal
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
SYSTEMD
|
|
|
|
systemctl daemon-reload
|
|
echo "Node configured. Start with: systemctl start luxd"
|
|
REMOTE
|
|
|
|
echo "Done! Node configured on $IP"
|
|
echo "Next: Upload snapshot and start the node"
|