mirror of
https://github.com/luxfi/cli.git
synced 2026-10-30 17:01:20 +00:00
Sweep "brand" out of the API entirely. Package and types now match the
domain vocabulary the user sees in chain.yaml + CLI output:
pkg/brand → pkg/network (one package per concept)
Brand → Spec (parsed chain.yaml)
NetCfg → Env (per-env block)
RuntimeProfile → Profile
RuntimeProfile.Brand → Profile.Name
ChainLock → Lock
$LUX_BRAND_PATH → $LUX_NETWORK_PATH
Surface BOTH identifiers distinctly — they are deliberately different:
NetworkID uint32 — validator wire, --network-id, info.getNetworkID
PrimaryEvmChainID uint64 — C-chain EIP-155, eth_chainId, MetaMask
Lux brand keeps them apart (NID 1 / EVM 96369). Sovereign-L1 brand
forks (Zoo, Hanzo, Pars, Osage, Liquidity) collapse them by convention
(Zoo NID == EVM == 200200). The validator no longer enforces equality;
both are surfaced in lux ps and lux info.
New verb:
lux info <name>/<env> full Profile dump (both IDs, ports, paths,
snapshot name, service label, RPC endpoints,
live probe state)
lux ps output now shows NETWORK_ID and EVM_CHAIN_ID as separate columns.
chain.lock manifest now records both IDs so booting against a foreign
EVM-chain-ID dataDir is also rejected (previously only checked
networkID).
32 lines
749 B
Go
32 lines
749 B
Go
// Package ctxcmd implements `lux ctx` — list discoverable name/env
|
|
// tuples from $LUX_NETWORK_PATH.
|
|
package ctxcmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/luxfi/cli/pkg/network"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func NewCmd() *cobra.Command {
|
|
return &cobra.Command{
|
|
Use: "ctx",
|
|
Short: "List discoverable network/env contexts",
|
|
Long: `Scans $LUX_NETWORK_PATH (default ~/work/{lux,zoo,hanzo,pars,osage,adnexus}/universe)
|
|
for chain.yaml files and prints every (network, env) tuple they declare.`,
|
|
Args: cobra.ExactArgs(0),
|
|
RunE: func(*cobra.Command, []string) error {
|
|
reg, err := network.Discover()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
for _, ref := range reg.Refs() {
|
|
fmt.Println(ref)
|
|
}
|
|
return nil
|
|
},
|
|
SilenceUsage: true,
|
|
}
|
|
}
|