networkcmd

package
v1.9.10 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: BSD-3-Clause Imports: 112 Imported by: 0

Documentation

Overview

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries, Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

/ Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

/ Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMutuallyExlusiveKeyLedger = errors.New("key source flags --key, --ledger/--ledger-addrs are mutually exclusive")
	ErrStoredKeyOnMainnet        = errors.New("key --key is not available for mainnet operations")
)
View Source
var (
	ErrNotPermissionedSubnet = errors.New("subnet is not permissioned")
)

Functions

func AddStateFlags added in v1.9.7

func AddStateFlags(cmd *cobra.Command)

AddStateFlags adds the state-related flags to the command

func CallAddValidator added in v1.9.5

func CallAddValidator(
	deployer *net.PublicDeployer,
	network models.Network,
	kc *keychain.Keychain,
	blockchainName string,
	subnetID ids.ID,
	nodeIDStr string,
	publicKey string,
	pop string,
	weight uint64,
	balanceLUX float64,
	remainingBalanceOwnerAddr string,
	disableOwnerAddr string,
	sc models.Sidecar,
	rpcURL string,
) error

func CallAddValidatorNonSOV added in v1.9.5

func CallAddValidatorNonSOV(
	deployer *net.PublicDeployer,
	network models.Network,
	kc *keychain.Keychain,
	useLedgerSetting bool,
	blockchainName string,
	nodeIDStr string,
	defaultValidatorParamsSetting bool,
	waitForTxAcceptanceSetting bool,
) error

func CallConfigure added in v1.9.5

func CallConfigure(
	cmd *cobra.Command,
	blockchainName string,
	chainConfParam string,
	subnetConfParam string,
	nodeConfParam string,
) error

func CallCreate added in v1.9.5

func CallCreate(
	cmd *cobra.Command,
	blockchainName string,
	forceCreateParam bool,
	genesisPathParam string,
	useSubnetEvmParam bool,
	useCustomParam bool,
	vmVersionParam string,
	evmChainIDParam uint64,
	tokenSymbolParam string,
	useProductionDefaultsParam bool,
	useTestDefaultsParam bool,
	useLatestReleasedVMVersionParam bool,
	useLatestPreReleasedVMVersionParam bool,
	customVMRepoURLParam string,
	customVMBranchParam string,
	customVMBuildScriptParam string,
) error

func CallDeleteBlockchain added in v1.9.5

func CallDeleteBlockchain(blockchainName string) error

func CallDeploy added in v1.9.5

func CallDeploy(
	cmd *cobra.Command,
	subnetOnlyParam bool,
	blockchainName string,
	networkFlags networkoptions.NetworkFlags,
	keyNameParam string,
	useLedgerParam bool,
	useEwoqParam bool,
	sameControlKeyParam bool,
) error

func ConvertToLuxdSubnetValidator added in v1.9.5

func ConvertToLuxdSubnetValidator(subnetValidators []models.SubnetValidator) ([]*txs.ConvertNetToL1Validator, error)

ConvertToLuxdSubnetValidator converts subnet validators to L1 validator format Deactivation owner is handled through the validator management contract

func ConvertURIToPeers added in v1.9.5

func ConvertURIToPeers(uris []string) ([]info.Peer, error)

func CreateBlockchainFirst added in v1.9.5

func CreateBlockchainFirst(cmd *cobra.Command, blockchainName string, skipPrompt bool) error

func DeployBlockchainFirst added in v1.9.5

func DeployBlockchainFirst(cmd *cobra.Command, blockchainName string, skipPrompt bool) error

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)

func InitializeValidatorManager added in v1.9.5

func InitializeValidatorManager(
	blockchainName,
	validatorManagerOwner string,
	subnetID ids.ID,
	blockchainID ids.ID,
	network models.Network,
	luxdBootstrapValidators []*txs.ConvertNetToL1Validator,
	pos bool,
	managerAddress string,
	proxyContractOwner string,
	useACP99 bool,
	useLocalMachine bool,
	signatureAggregatorFlags flags.SignatureAggregatorFlags,
	proofOfStakeFlags flags.POSFlags,
) (bool, error)

func LoadBootstrapValidator added in v1.9.5

func LoadBootstrapValidator(bootstrapValidatorFlags flags.BootstrapValidatorFlags) ([]models.SubnetValidator, error)

func LoadExistingSubnetState added in v1.9.7

func LoadExistingSubnetState(networkDir string) error

LoadExistingSubnetState loads an existing subnet database into the network

func NewCmd

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

lux network (alias: blockchain, net)

func PrintDeployResults added in v1.9.5

func PrintDeployResults(blockchainName string, subnetID ids.ID, blockchainID ids.ID) error

func PrintReadyToSignMsg added in v1.9.5

func PrintReadyToSignMsg(
	blockchainName string,
	outputTxPath string,
)

func PrintRemainingToSignMsg added in v1.9.5

func PrintRemainingToSignMsg(
	blockchainName string,
	remainingSubnetAuthKeys []string,
	outputTxPath string,
)

func PrintSubnetInfo added in v1.9.5

func PrintSubnetInfo(blockchainName string, onlyLocalnetInfo bool) error

func PromptDuration added in v1.9.5

func PromptDuration(start time.Time, network models.Network, isPos bool) (time.Duration, error)

func PromptNodeID added in v1.9.5

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

func SaveNotFullySignedTx added in v1.9.5

func SaveNotFullySignedTx(
	txName string,
	tx *txs.Tx,
	blockchainName string,
	subnetAuthKeys []string,
	remainingSubnetAuthKeys []string,
	outputTxPath string,
	forceOverwrite bool,
) error

func SetBlockchainConf added in v1.9.5

func SetBlockchainConf(
	blockchainName string,
	fileBytes []byte,
	configFilename string,
) error

func Start

func Start(flags StartFlags, printEndpoints bool) error

Start starts the local network with the given flags

func StartLocalMachine added in v1.9.5

func StartLocalMachine(
	network models.Network,
	sidecar models.Sidecar,
	blockchainName string,
	deployBalance,
	availableBalance uint64,
	localMachineFlags *flags.LocalMachineFlags,
	bootstrapValidatorFlags *flags.BootstrapValidatorFlags,
) (bool, error)

func StartMainnet

func StartMainnet() error

StartMainnet starts a mainnet network with configurable validator nodes Uses netrunner internally with genesis configuration from luxfi/genesis package

func StartNetwork

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

func StartTestnet

func StartTestnet() error

StartTestnet starts a testnet network with configurable validator nodes Uses netrunner internally with genesis configuration from luxfi/genesis package

func StopNetwork

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

func UpdateKeychainWithSubnetControlKeys added in v1.9.5

func UpdateKeychainWithSubnetControlKeys(
	kc *keychain.Keychain,
	network models.Network,
	blockchainName string,
) error

func ValidateSubnetNameAndGetChains added in v1.9.5

func ValidateSubnetNameAndGetChains(args []string) ([]string, error)

Types

type BlockchainAddValidatorFlags added in v1.9.5

type BlockchainAddValidatorFlags struct {
	RPC         string
	SigAggFlags flags.SignatureAggregatorFlags
}

type BlockchainChangeWeightFlags added in v1.9.5

type BlockchainChangeWeightFlags struct {
	RPC         string
	SigAggFlags flags.SignatureAggregatorFlags
}

type BlockchainConvertFlags added in v1.9.5

type BlockchainConvertFlags struct {
	SigAggFlags             flags.SignatureAggregatorFlags
	LocalMachineFlags       flags.LocalMachineFlags
	ProofOfStakeFlags       flags.POSFlags
	BootstrapValidatorFlags flags.BootstrapValidatorFlags
	ConvertOnly             bool
}

type BlockchainDeployFlags added in v1.9.5

type BlockchainDeployFlags struct {
	SigAggFlags             flags.SignatureAggregatorFlags
	LocalMachineFlags       flags.LocalMachineFlags
	ProofOfStakeFlags       flags.POSFlags
	BootstrapValidatorFlags flags.BootstrapValidatorFlags
	ConvertOnly             bool
}

type BlockchainRemoveValidatorFlags added in v1.9.5

type BlockchainRemoveValidatorFlags struct {
	RPC         string
	SigAggFlags flags.SignatureAggregatorFlags
}

type CreateFlags added in v1.9.5

type CreateFlags struct {
	// contains filtered or unexported fields
}

type StartFlags

type StartFlags struct {
	UserProvidedAvagoVersion string
	AvagoBinaryPath          string
	UserProvidedLuxdVersion  string
	LuxdBinaryPath           string
	NumNodes                 uint32
}

StartFlags contains configuration for starting a network

type SubnetValidator added in v1.9.5

type SubnetValidator struct {
	// Must be Ed25519 NodeID
	NodeID ids.NodeID `json:"nodeID"`
	// Weight of this validator used when sampling
	Weight uint64 `json:"weight"`
	// When this validator will stop validating the Subnet
	EndTime uint64 `json:"endTime"`
	// Initial balance for this validator
	Balance uint64 `json:"balance"`
	// [Signer] is the BLS key for this validator.
	// Note: We do not enforce that the BLS key is unique across all validators.
	//       This means that validators can share a key if they so choose.
	//       However, a NodeID + Subnet does uniquely map to a BLS key
	Signer signer.Signer `json:"signer"`
	// Leftover $LUX from the [Balance] will be issued to this
	// owner once it is removed from the validator set.
	ChangeOwner fx.Owner `json:"changeOwner"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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