From 637994c254583bb4c3a7b7a006df0749f697367d Mon Sep 17 00:00:00 2001 From: Hanzo AI Date: Fri, 15 May 2026 16:34:30 -0700 Subject: [PATCH] env: drop LUX_ prefix from env vars (noise) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- LLM.md | 12 +++++----- cmd/backendcmd/spawnServer.go | 8 +++---- cmd/devcmd/stack.go | 4 ++-- cmd/kmscmd/kms.go | 6 ++--- cmd/networkcmd/start_k8s.go | 4 ++-- cmd/nodecmd/deploy.go | 8 +++---- cmd/nodecmd/k8s_test.go | 4 ++-- cmd/nodecmd/node.go | 2 +- cmd/rpccmd/transfer.go | 6 ++--- cmd/zkcmd/ceremony.go | 4 ++-- main.go | 4 ++-- pkg/binutils/processes.go | 2 +- pkg/chain/public.go | 2 +- pkg/key/backend_env.go | 39 +++++++++++--------------------- pkg/key/backend_walletconnect.go | 4 ++-- pkg/key/soft_key.go | 2 +- pkg/models/network.go | 4 ++-- pkg/prompts/missing.go | 4 ++-- scripts/deploy-do-node.sh | 6 ++--- 19 files changed, 56 insertions(+), 69 deletions(-) diff --git a/LLM.md b/LLM.md index 338f349f1..9f1e606fe 100644 --- a/LLM.md +++ b/LLM.md @@ -50,7 +50,7 @@ Helm chart at `~/work/lux/devops/charts/lux/`. This ensures: - Identical deployments to deploy-all.sh - startup.sh with bootstrap, staking keys, upgrade-file-content, chain configs - Per-pod LoadBalancer services for external access -- Configurable via `$LUX_CHART_PATH` or `--chart-path` +- Configurable via `$CHART_PATH` or `--chart-path` ## Quick Reference @@ -81,7 +81,7 @@ lux chain create mychain --token-name=MYTOKEN --token-symbol=MTK lux chain import --chain=c --path=/path/to/blocks.rlp # Import RLP blocks to C-Chain lux chain import --chain=zoo --path=/path/to/zoo.rlp # Import to chain -# AMM Trading (LUX_MNEMONIC supported) +# AMM Trading (MNEMONIC supported) lux amm balance # Check token balances lux amm status # Show AMM contract status lux amm pools # List liquidity pools @@ -259,16 +259,16 @@ The AMM CLI supports Uniswap V2/V3 style DEX trading on Lux and Zoo networks. ### Wallet Access (Priority Order) 1. `--private-key` flag (hex private key) -2. `LUX_PRIVATE_KEY` environment variable -3. `LUX_MNEMONIC` environment variable (BIP39 mnemonic) +2. `PRIVATE_KEY` environment variable +3. `MNEMONIC` environment variable (BIP39 mnemonic) ```bash # Using mnemonic -export LUX_MNEMONIC="word1 word2 ... word12" +export MNEMONIC="word1 word2 ... word12" lux amm balance --network lux-testnet # Using private key -export LUX_PRIVATE_KEY="0x..." +export PRIVATE_KEY="0x..." lux amm balance --network zoo ``` diff --git a/cmd/backendcmd/spawnServer.go b/cmd/backendcmd/spawnServer.go index 3e0179e38..b70079cb1 100644 --- a/cmd/backendcmd/spawnServer.go +++ b/cmd/backendcmd/spawnServer.go @@ -18,7 +18,7 @@ var app *application.Lux // NewCmd creates the lux-server command (formerly cli-backend). // This is the gRPC server that manages local network nodes. -// The network type is determined by LUX_NETWORK_TYPE environment variable. +// The network type is determined by NETWORK_TYPE environment variable. func NewCmd(injectedApp *application.Lux) *cobra.Command { app = injectedApp @@ -34,7 +34,7 @@ Each network type (mainnet, testnet, local) runs its own server on a dedicated p - testnet: 8098 - local: 8099 -The network type is determined by the LUX_NETWORK_TYPE environment variable.`, +The network type is determined by the NETWORK_TYPE environment variable.`, RunE: startBackend, Args: cobra.ExactArgs(0), Hidden: true, @@ -55,7 +55,7 @@ func NewNetworkCmd(injectedApp *application.Lux, networkType string) *cobra.Comm Long: fmt.Sprintf("The Lux gRPC server for %s network. Invoked automatically by 'lux network start'.", networkType), RunE: func(cmd *cobra.Command, args []string) error { // Override the environment variable with the command's network type - _ = os.Setenv("LUX_NETWORK_TYPE", networkType) + _ = os.Setenv("NETWORK_TYPE", networkType) return startBackend(cmd, args) }, Args: cobra.ExactArgs(0), @@ -77,7 +77,7 @@ func NewAllNetworkCmds(injectedApp *application.Lux) []*cobra.Command { func startBackend(_ *cobra.Command, _ []string) error { // Get network type from environment variable (set by StartServerProcessForNetwork) // Defaults to "mainnet" for backward compatibility - networkType := os.Getenv("LUX_NETWORK_TYPE") + networkType := os.Getenv("NETWORK_TYPE") if networkType == "" { networkType = "mainnet" } diff --git a/cmd/devcmd/stack.go b/cmd/devcmd/stack.go index d9a67154e..7465c04d7 100644 --- a/cmd/devcmd/stack.go +++ b/cmd/devcmd/stack.go @@ -273,8 +273,8 @@ func stackUp(*cobra.Command, []string) error { ux.Logger.PrintToUser("Starting %s on port %d...", name, port) if _, err := spawnProcessWithEnv(binary, appArgs, logFile, pidDir, name, []string{ fmt.Sprintf("PORT=%d", port), - fmt.Sprintf("LUX_CHAINS_FILE=%s", filepath.Join(baseDir, stackChainsFile)), - fmt.Sprintf("LUX_RPC_URL=http://127.0.0.1:%d", luxdEntry.PortBase+i*portStride), + fmt.Sprintf("CHAINS_FILE=%s", filepath.Join(baseDir, stackChainsFile)), + fmt.Sprintf("RPC_URL=http://127.0.0.1:%d", luxdEntry.PortBase+i*portStride), }); err != nil { _ = logFile.Close() ux.Logger.PrintToUser("Warning: failed to start %s: %v", name, err) diff --git a/cmd/kmscmd/kms.go b/cmd/kmscmd/kms.go index b71129c2d..c50ae62b3 100644 --- a/cmd/kmscmd/kms.go +++ b/cmd/kmscmd/kms.go @@ -224,13 +224,13 @@ func runServerStart(cmd *cobra.Command, args []string) error { // getRootKey gets or generates the root encryption key. func getRootKey(dataDir string) ([]byte, error) { // Check environment variable first - if envKey := os.Getenv("LUX_KMS_ROOT_KEY"); envKey != "" { + if envKey := os.Getenv("KMS_ROOT_KEY"); envKey != "" { key, err := hex.DecodeString(envKey) if err != nil { - return nil, fmt.Errorf("invalid LUX_KMS_ROOT_KEY: %w", err) + return nil, fmt.Errorf("invalid KMS_ROOT_KEY: %w", err) } if len(key) != 32 { - return nil, fmt.Errorf("LUX_KMS_ROOT_KEY must be 32 bytes (64 hex chars)") + return nil, fmt.Errorf("KMS_ROOT_KEY must be 32 bytes (64 hex chars)") } return key, nil } diff --git a/cmd/networkcmd/start_k8s.go b/cmd/networkcmd/start_k8s.go index 749a6e07a..eca3d9246 100644 --- a/cmd/networkcmd/start_k8s.go +++ b/cmd/networkcmd/start_k8s.go @@ -23,7 +23,7 @@ type K8sNetworkConfig struct { // This delegates to `helm upgrade --install` to ensure a single source of truth. func StartK8sNetwork(cfg K8sNetworkConfig) error { // Resolve chart path - chartPath := os.Getenv("LUX_CHART_PATH") + chartPath := os.Getenv("CHART_PATH") if chartPath == "" { home, _ := os.UserHomeDir() chartPath = filepath.Join(home, "work", "lux", "devops", "charts", "lux") @@ -31,7 +31,7 @@ func StartK8sNetwork(cfg K8sNetworkConfig) error { // Validate chart exists if _, err := os.Stat(filepath.Join(chartPath, "Chart.yaml")); err != nil { - return fmt.Errorf("Helm chart not found at %s (set $LUX_CHART_PATH)", chartPath) + return fmt.Errorf("Helm chart not found at %s (set $CHART_PATH)", chartPath) } // Validate values file diff --git a/cmd/nodecmd/deploy.go b/cmd/nodecmd/deploy.go index 175da2ff8..dc8830427 100644 --- a/cmd/nodecmd/deploy.go +++ b/cmd/nodecmd/deploy.go @@ -25,9 +25,9 @@ var ( ) // defaultChartPath returns the default Helm chart path. -// Searches: 1) $LUX_CHART_PATH, 2) ~/work/lux/devops/charts/lux +// Searches: 1) $CHART_PATH, 2) ~/work/lux/devops/charts/lux func defaultChartPath() string { - if p := os.Getenv("LUX_CHART_PATH"); p != "" { + if p := os.Getenv("CHART_PATH"); p != "" { return p } home, _ := os.UserHomeDir() @@ -47,7 +47,7 @@ nodes, upgrade-file-content, chain configs, and per-pod services. CHART DISCOVERY (in order): 1. --chart-path flag - 2. $LUX_CHART_PATH environment variable + 2. $CHART_PATH environment variable 3. ~/work/lux/devops/charts/lux/ EXAMPLES: @@ -83,7 +83,7 @@ func runDeploy(_ *cobra.Command, _ []string) error { // Validate chart exists if _, err := os.Stat(filepath.Join(chart, "Chart.yaml")); err != nil { - return fmt.Errorf("Helm chart not found at %s (set --chart-path or $LUX_CHART_PATH)", chart) + return fmt.Errorf("Helm chart not found at %s (set --chart-path or $CHART_PATH)", chart) } // Validate values file exists diff --git a/cmd/nodecmd/k8s_test.go b/cmd/nodecmd/k8s_test.go index 7ea26e95e..39f8fb2d7 100644 --- a/cmd/nodecmd/k8s_test.go +++ b/cmd/nodecmd/k8s_test.go @@ -127,14 +127,14 @@ func TestResolveNetwork(t *testing.T) { func TestDefaultChartPath(t *testing.T) { // Without env var, should return ~/work/lux/devops/charts/lux - t.Setenv("LUX_CHART_PATH", "") + t.Setenv("CHART_PATH", "") p := defaultChartPath() if p == "" { t.Error("defaultChartPath() returned empty string") } // With env var, should return the env value - t.Setenv("LUX_CHART_PATH", "/custom/chart") + t.Setenv("CHART_PATH", "/custom/chart") p = defaultChartPath() if p != "/custom/chart" { t.Errorf("defaultChartPath() = %q, want /custom/chart", p) diff --git a/cmd/nodecmd/node.go b/cmd/nodecmd/node.go index 53056af49..c02389081 100644 --- a/cmd/nodecmd/node.go +++ b/cmd/nodecmd/node.go @@ -30,7 +30,7 @@ KUBERNETES COMMANDS (via Helm chart): rollback Revert to previous StatefulSet revision The deploy command uses the canonical Helm chart at ~/work/lux/devops/charts/lux/ -(configurable via --chart-path or $LUX_CHART_PATH). All other k8s commands use +(configurable via --chart-path or $CHART_PATH). All other k8s commands use the Kubernetes API directly for fast read/write operations. All k8s commands require one of --mainnet, --testnet, --devnet, or --namespace. diff --git a/cmd/rpccmd/transfer.go b/cmd/rpccmd/transfer.go index 36ae069b7..467d26090 100644 --- a/cmd/rpccmd/transfer.go +++ b/cmd/rpccmd/transfer.go @@ -64,7 +64,7 @@ Example: }, } - cmd.Flags().StringVar(&flags.rpcURL, "rpc-url", "", "Base RPC URL (default: LUX_RPC_URL or running network endpoint)") + cmd.Flags().StringVar(&flags.rpcURL, "rpc-url", "", "Base RPC URL (default: RPC_URL or running network endpoint)") cmd.Flags().StringVar(&flags.from, "from", "", "Key name to use (default: MNEMONIC account 0)") cmd.Flags().StringVar(&flags.fromChain, "from-chain", "P", "Source chain: P, X, or C") cmd.Flags().StringVar(&flags.toChain, "to-chain", "C", "Destination chain: P, X, or C") @@ -123,7 +123,7 @@ func resolveRPCBaseURL(app *application.Lux, override string) (string, error) { if override != "" { return strings.TrimSuffix(override, "/"), nil } - if env := os.Getenv("LUX_RPC_URL"); env != "" { + if env := os.Getenv("RPC_URL"); env != "" { return strings.TrimSuffix(env, "/"), nil } if app != nil { @@ -131,7 +131,7 @@ func resolveRPCBaseURL(app *application.Lux, override string) (string, error) { return strings.TrimSuffix(endpoint, "/"), nil } } - return "", fmt.Errorf("rpc base URL not set (use --rpc-url or LUX_RPC_URL)") + return "", fmt.Errorf("rpc base URL not set (use --rpc-url or RPC_URL)") } func resolveNetworkID(baseURL string) (uint32, error) { diff --git a/cmd/zkcmd/ceremony.go b/cmd/zkcmd/ceremony.go index 6153dd47a..f43e60f86 100644 --- a/cmd/zkcmd/ceremony.go +++ b/cmd/zkcmd/ceremony.go @@ -14,12 +14,12 @@ import ( ) // findCeremonyBinary locates the ceremony binary. -// Search order: PATH, $LUX_NODE_ROOT/build/ceremony, /usr/local/bin/ceremony. +// Search order: PATH, $NODE_ROOT/build/ceremony, /usr/local/bin/ceremony. func findCeremonyBinary() (string, error) { if p, err := exec.LookPath("ceremony"); err == nil { return p, nil } - if root := os.Getenv("LUX_NODE_ROOT"); root != "" { + if root := os.Getenv("NODE_ROOT"); root != "" { p := filepath.Join(root, "build", "ceremony") if _, err := os.Stat(p); err == nil { return p, nil diff --git a/main.go b/main.go index 9199ffac8..6f03756d7 100644 --- a/main.go +++ b/main.go @@ -20,8 +20,8 @@ func init() { // Go's default dialer waits 30s per dead IP before trying the next. // Allow skipping TLS verification for devnet/internal endpoints // that may use self-signed or staging certificates. - // Set LUX_INSECURE_TLS=1 to skip verification. - skipTLS := os.Getenv("LUX_INSECURE_TLS") == "1" + // Set INSECURE_TLS=1 to skip verification. + skipTLS := os.Getenv("INSECURE_TLS") == "1" http.DefaultTransport = &http.Transport{ DialContext: (&net.Dialer{Timeout: 5 * time.Second}).DialContext, TLSHandshakeTimeout: 10 * time.Second, diff --git a/pkg/binutils/processes.go b/pkg/binutils/processes.go index f5325a0ac..545ac2ce8 100644 --- a/pkg/binutils/processes.go +++ b/pkg/binutils/processes.go @@ -285,7 +285,7 @@ func StartServerProcessForNetwork(app *application.Lux, networkType string) erro } cmd := exec.Command(netrunnerPath, args...) //nolint:gosec // G204: Running our netrunner binary - cmd.Env = append(os.Environ(), fmt.Sprintf("LUX_NETWORK_TYPE=%s", networkType)) + cmd.Env = append(os.Environ(), fmt.Sprintf("NETWORK_TYPE=%s", networkType)) cmd.Stdout = outputFile cmd.Stderr = outputFile diff --git a/pkg/chain/public.go b/pkg/chain/public.go index 162e7adc3..1d0407bbc 100644 --- a/pkg/chain/public.go +++ b/pkg/chain/public.go @@ -419,7 +419,7 @@ func (d *PublicDeployer) loadWallet(preloadTxs ...ids.ID) (primary.Wallet, error ctx := context.Background() ux.Logger.PrintToUser("loadWallet: starting...") - api := os.Getenv("LUX_NODE_ENDPOINT") + api := os.Getenv("NODE_ENDPOINT") if api == "" { switch d.network { case models.Testnet: diff --git a/pkg/key/backend_env.go b/pkg/key/backend_env.go index 5a6834b1d..622d33f53 100644 --- a/pkg/key/backend_env.go +++ b/pkg/key/backend_env.go @@ -15,42 +15,35 @@ import ( "github.com/luxfi/crypto/secp256k1" ) -// Environment variable names for key loading. -// Each variable supports two forms: generic (MNEMONIC) and prefixed (MNEMONIC). -// Generic form takes priority so the same mnemonic/key works across tools. +// Environment variable names for key loading. Brand prefix dropped — these +// are the canonical (unprefixed) names every tool reads. const ( // EnvMnemonic contains a BIP39 mnemonic phrase. - // Env: MNEMONIC or MNEMONIC EnvMnemonic = "MNEMONIC" // EnvPrivateKey contains a hex-encoded secp256k1 private key. - // Env: PRIVATE_KEY or PRIVATE_KEY EnvPrivateKey = "PRIVATE_KEY" // EnvBLSKey contains a hex-encoded BLS private key. - // Env: BLS_KEY or LUX_BLS_KEY - EnvBLSKey = "LUX_BLS_KEY" + EnvBLSKey = "BLS_KEY" // EnvKeyPassword for encrypted key files. - // Env: KEY_PASSWORD or KEY_PASSWORD EnvKeyPassword = "KEY_PASSWORD" // EnvKeySessionTimeout configures the session timeout duration. // Format: Go duration string (e.g., "30s", "5m", "1h"). // Default: 30s (30 seconds of inactivity before auto-lock). - // Env: KEY_SESSION_TIMEOUT or KEY_SESSION_TIMEOUT EnvKeySessionTimeout = "KEY_SESSION_TIMEOUT" // EnvKeyIndex selects the BIP-44 address index for mnemonic derivation. // Path: m/44'/9000'/0'/0/{index} for P/X-Chain. // Default: "auto" — scans indices 0-99 to find the first funded account. // Set to a specific number (e.g., "1") to use that index directly. - // Env: MNEMONIC_ACCOUNT or LUX_KEY_INDEX - EnvKeyIndex = "LUX_KEY_INDEX" + // MNEMONIC_ACCOUNT takes priority for backward compatibility with other tools. + EnvKeyIndex = "KEY_INDEX" // EnvLightMnemonic is the well-known dev/local mnemonic for local development. // This mnemonic is PUBLIC and safe to commit — it is NOT used for production. - // Env: LIGHT_MNEMONIC EnvLightMnemonic = "LIGHT_MNEMONIC" // LightMnemonic is the default mnemonic for local development networks. @@ -58,19 +51,13 @@ const ( LightMnemonic = "light light light light light light light light light light light energy" ) -// getEnv returns the value of an environment variable, checking the generic -// (unprefixed) form first, then the LUX_ prefixed form. -// e.g., getEnv("MNEMONIC") checks MNEMONIC first, then MNEMONIC. -func getEnv(luxPrefixed string) string { - // Try generic form: strip LUX_ prefix - generic := strings.TrimPrefix(luxPrefixed, "LUX_") - if v := os.Getenv(generic); v != "" { - return v - } - return os.Getenv(luxPrefixed) +// getEnv returns the value of the named environment variable. +func getEnv(name string) string { + return os.Getenv(name) } -// getKeyIndex returns the configured key index from MNEMONIC_ACCOUNT or LUX_KEY_INDEX. +// getKeyIndex returns the configured key index from MNEMONIC_ACCOUNT or KEY_INDEX. +// MNEMONIC_ACCOUNT (industry-standard name) takes priority. func getKeyIndex() string { if v := os.Getenv("MNEMONIC_ACCOUNT"); v != "" { return v @@ -160,15 +147,15 @@ func (b *EnvBackend) LoadKey(ctx context.Context, name, password string) (*HDKey } func (*EnvBackend) loadFromEnv(name string) (*HDKeySet, error) { - // Priority 1: MNEMONIC / MNEMONIC + // Priority 1: MNEMONIC if mnemonic := getEnv(EnvMnemonic); mnemonic != "" { if !ValidateMnemonic(mnemonic) { - return nil, errors.New("invalid mnemonic in MNEMONIC / MNEMONIC") + return nil, errors.New("invalid mnemonic in MNEMONIC") } return DeriveAllKeys(name, mnemonic) } - // Priority 2: PRIVATE_KEY / PRIVATE_KEY (hex-encoded EC key) + // Priority 2: PRIVATE_KEY (hex-encoded EC key) if privKeyHex := getEnv(EnvPrivateKey); privKeyHex != "" { privKeyHex = strings.TrimPrefix(privKeyHex, "0x") privKeyBytes, err := hex.DecodeString(privKeyHex) diff --git a/pkg/key/backend_walletconnect.go b/pkg/key/backend_walletconnect.go index b1456ad50..3cb1fdc86 100644 --- a/pkg/key/backend_walletconnect.go +++ b/pkg/key/backend_walletconnect.go @@ -52,7 +52,7 @@ var ( ErrWCUserRejected = errors.New("walletconnect: user rejected request") ErrWCTimeout = errors.New("walletconnect: request timed out") ErrWCDisconnected = errors.New("walletconnect: disconnected from relay") - ErrWCNoProjectID = errors.New("walletconnect: project ID required (set LUX_WC_PROJECT_ID)") + ErrWCNoProjectID = errors.New("walletconnect: project ID required (set WC_PROJECT_ID)") ErrWCInvalidResponse = errors.New("walletconnect: invalid response from wallet") ) @@ -135,7 +135,7 @@ func (*WalletConnectBackend) SupportsRemoteSigning() bool { func (b *WalletConnectBackend) Initialize(ctx context.Context) error { // Get project ID from environment - b.projectID = os.Getenv("LUX_WC_PROJECT_ID") + b.projectID = os.Getenv("WC_PROJECT_ID") if b.projectID == "" { // WalletConnect Cloud project ID is optional but recommended // Public fallback for development diff --git a/pkg/key/soft_key.go b/pkg/key/soft_key.go index 765620475..a574869bb 100644 --- a/pkg/key/soft_key.go +++ b/pkg/key/soft_key.go @@ -510,7 +510,7 @@ func GetOrCreateLocalKey(networkID uint32) (*SoftKey, error) { // Priority 2: MNEMONIC / MNEMONIC if mnemonic := getEnv(EnvMnemonic); mnemonic != "" { - // MNEMONIC_ACCOUNT (or LUX_KEY_INDEX) selects BIP-44 address index. + // MNEMONIC_ACCOUNT (or KEY_INDEX) selects BIP-44 address index. // Derivation: m/44'/9000'/0'/0/{account} for P/X-Chain // m/44'/60'/0'/0/{account} for C-Chain/EVM // Default: 0 diff --git a/pkg/models/network.go b/pkg/models/network.go index d6d22c6fa..2acddced0 100644 --- a/pkg/models/network.go +++ b/pkg/models/network.go @@ -141,11 +141,11 @@ func (Network) BootstrappingContext() (context.Context, func()) { } // Endpoint returns the RPC endpoint for the network. -// LUX_NODE_ENDPOINT env var overrides the canonical api.lux*.network DNS +// NODE_ENDPOINT env var overrides the canonical api.lux*.network DNS // for ops paths where the public endpoint isn't reachable (cross-cluster // deploys, captive testnets, etc). func (s Network) Endpoint() string { - if ovr := os.Getenv("LUX_NODE_ENDPOINT"); ovr != "" { + if ovr := os.Getenv("NODE_ENDPOINT"); ovr != "" { return ovr } switch s { diff --git a/pkg/prompts/missing.go b/pkg/prompts/missing.go index a56073abb..b8df22394 100644 --- a/pkg/prompts/missing.go +++ b/pkg/prompts/missing.go @@ -12,7 +12,7 @@ import ( // MissingOpt describes a required option that was not provided. type MissingOpt struct { Flag string // e.g., "--chain-id" - Env string // e.g., "LUX_CHAIN_ID" (optional) + Env string // e.g., "CHAIN_ID" (optional) Prompt string // e.g., "EVM chain ID" - used for interactive prompts Note string // optional additional context Default string // optional default value hint @@ -53,7 +53,7 @@ func MissingError(cmd string, missing []MissingOpt) error { // // missing := []prompts.MissingOpt{} // if chainID == "" { -// missing = append(missing, prompts.MissingOpt{Flag: "--chain-id", Env: "LUX_CHAIN_ID", Prompt: "EVM chain ID"}) +// missing = append(missing, prompts.MissingOpt{Flag: "--chain-id", Env: "CHAIN_ID", Prompt: "EVM chain ID"}) // } // if err := prompts.PromptOrFail("lux chain create", missing, func(m MissingOpt) (string, error) { // return app.Prompt.CaptureString(m.Prompt) diff --git a/scripts/deploy-do-node.sh b/scripts/deploy-do-node.sh index bf9cb641c..e0cedc90a 100755 --- a/scripts/deploy-do-node.sh +++ b/scripts/deploy-do-node.sh @@ -9,12 +9,12 @@ TESTNET_IP="24.144.93.58" DEVNET_IP="143.110.230.60" NETWORK=$1 -MNEMONIC="${2:-$LUX_MNEMONIC}" +MNEMONIC="${2:-$MNEMONIC}" if [ -z "$NETWORK" ] || [ -z "$MNEMONIC" ]; then echo "Usage: $0 [mnemonic]" echo " network: mainnet, testnet, or devnet" - echo " mnemonic: optional, uses LUX_MNEMONIC env var if not provided" + echo " mnemonic: optional, uses MNEMONIC env var if not provided" exit 1 fi @@ -52,7 +52,7 @@ After=network.target [Service] Type=simple User=root -Environment="LUX_MNEMONIC_FILE=/run/lux/mnemonic" +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 \