networkcmd

package
v1.99.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2026 License: BSD-3-Clause Imports: 48 Imported by: 0

Documentation

Overview

Package networkcmd provides commands for managing local network operations.

Index

Constants

View Source
const (
	// MainnetChainBlockchainID is the known blockchain ID for the mainnet chain
	MainnetChainBlockchainID = "2G8mK7VCZX1dV8iPjkkTDMpYGZDCNLLVdTJVLmMsG5ZV7zKVmB"
)

Known blockchain IDs

Variables

This section is empty.

Functions

func AddStateFlags added in v1.9.7

func AddStateFlags(cmd *cobra.Command)

AddStateFlags adds the state-related flags to the command

func GetProxyOwnerPrivateKey added in v1.9.5

func GetProxyOwnerPrivateKey(
	app *application.Lux,
	network models.Network,
	proxyContractOwner string,
	printFunc func(msg string, args ...interface{}),
) (string, error)

GetProxyOwnerPrivateKey retrieves the private key for a proxy contract owner. If not found in managed keys, prompts the user.

func LoadExistingChainState added in v1.13.7

func LoadExistingChainState(networkDir string) error

LoadExistingChainState loads an existing chain database into the network

func NewCmd

func NewCmd(injectedApp *application.Lux) *cobra.Command

NewCmd creates the network command for managing local network runtime.

func NewMonitorCmd added in v1.13.7

func NewMonitorCmd() *cobra.Command

NewMonitorCmd returns the monitor command

func NewStatusCmd added in v1.13.7

func NewStatusCmd() *cobra.Command

NewStatusCmd returns the improved status command.

func NewStatusCmdOld added in v1.13.7

func NewStatusCmdOld() *cobra.Command

NewStatusCmdOld returns the old status command. Deprecated: Use the new status command instead.

func PromptNodeID added in v1.9.5

func PromptNodeID(goal string) (ids.NodeID, error)

PromptNodeID prompts the user to enter a node ID for the specified goal.

func Start

func Start(_ StartFlags, _ bool) error

Start starts the local network with the given flags.

func StartDevMode added in v1.13.7

func StartDevMode() error

StartDevMode starts a single-node development network with K=1 consensus This runs luxd directly (not through netrunner) for maximum simplicity luxd's built-in --dev flag enables: single-node consensus, no sybil protection, instant blocks

func StartDevNetwork added in v1.13.7

func StartDevNetwork() error

StartDevNetwork starts a multi-node development network with turbo profile This is the hybrid mode: multiple validators with fast consensus (K=3, 2/3 quorum) Use this when you need to test multi-validator scenarios with fast finality The network uses MNEMONIC to fund derived accounts automatically

func StartDevnet added in v1.13.7

func StartDevnet() error

StartDevnet starts a devnet network with configurable validator nodes

func StartK8sDevnet added in v1.13.7

func StartK8sDevnet() error

StartK8sDevnet deploys devnet to Kubernetes via Helm.

func StartK8sMainnet added in v1.13.7

func StartK8sMainnet() error

StartK8sMainnet deploys mainnet to Kubernetes via Helm.

func StartK8sNetwork added in v1.13.7

func StartK8sNetwork(cfg K8sNetworkConfig) error

StartK8sNetwork deploys a Lux network to Kubernetes using the canonical Helm chart. This delegates to `helm upgrade --install` to ensure a single source of truth.

func StartK8sTestnet added in v1.13.7

func StartK8sTestnet() error

StartK8sTestnet deploys testnet to Kubernetes via Helm.

func StartLocal added in v1.99.8

func StartLocal() error

StartLocal starts a 3-node localnet on K8s via the operator. No netrunner — the operator manages StatefulSets, subnet creation, chain deployment.

lux network start --local
lux network start --local --k8s colima

func StartMainnet

func StartMainnet() error

StartMainnet starts a mainnet network with configurable validator nodes

func StartNetwork

func StartNetwork(*cobra.Command, []string) error

StartNetwork starts the local network.

func StartTestnet

func StartTestnet() error

StartTestnet starts a testnet network with configurable validator nodes

func StopNetwork

func StopNetwork(*cobra.Command, []string) error

StopNetwork stops the local network.

Types

type CChainGenesis added in v1.13.7

type CChainGenesis struct {
	Config struct {
		ChainID uint64 `json:"chainId"`
	} `json:"config"`
	Alloc map[string]struct {
		Balance string `json:"balance"`
		Nonce   string `json:"nonce,omitempty"`
		Code    string `json:"code,omitempty"`
	} `json:"alloc"`
}

type GenesisAllocation added in v1.13.7

type GenesisAllocation struct {
	EthAddr        string `json:"ethAddr"`
	LuxAddr        string `json:"luxAddr"`
	InitialAmount  uint64 `json:"initialAmount"`
	UnlockSchedule []struct {
		Amount   uint64 `json:"amount"`
		Locktime uint64 `json:"locktime"`
	} `json:"unlockSchedule"`
}

Genesis structures

type InitialStaker added in v1.13.7

type InitialStaker struct {
	NodeID        string `json:"nodeID"`
	RewardAddress string `json:"rewardAddress"`
	DelegationFee uint64 `json:"delegationFee"`
	Weight        uint64 `json:"weight"`
	Signer        struct {
		PublicKey         string `json:"publicKey"`
		ProofOfPossession string `json:"proofOfPossession"`
	} `json:"signer"`
}

type K8sNetworkConfig added in v1.13.7

type K8sNetworkConfig struct {
	NetworkName string
	Namespace   string
	Image       string
}

K8sNetworkConfig holds configuration for K8s network deployment via Helm.

type MainGenesis added in v1.13.7

type MainGenesis struct {
	NetworkID   uint32              `json:"networkID"`
	Allocations []GenesisAllocation `json:"allocations"`
}

type PChainGenesis added in v1.13.7

type PChainGenesis struct {
	NetworkID      uint32          `json:"networkID"`
	InitialStakers []InitialStaker `json:"initialStakers"`
}

type StartFlags

type StartFlags struct {
	UserProvidedLuxdVersion string
	LuxdBinaryPath          string
	NumNodes                uint32
}

StartFlags contains configuration for starting a network

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL