commands

package
v1.9.13 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: 18 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.

Index

Constants

View Source
const (
	CLIBinary           = "./bin/lux"
	SubnetCmd           = "subnet"
	NetworkCmd          = "network"
	KeyCmd              = "key"
	UpgradeCmd          = "upgrade"
	ElasticTransformCmd = "elastic"
	JoinCmd             = "join"
	RemoveValidatorCmd  = "removeValidator"
)
View Source
const (
	PoSString = "proof-of-stake"
	PoAString = "proof-of-authority"
)
View Source
const (
	ExpectFail    = false
	ExpectSuccess = true
)
View Source
const (
	ContractCMD = "contract"
)
View Source
const (
	InterchainCMD = "interchain"
)
View Source
const (
	WarpCmd = "warp"
)

Variables

This section is empty.

Functions

func AddEtnaSubnetValidatorToCluster

func AddEtnaSubnetValidatorToCluster(
	clusterName string,
	subnetName string,
	nodeEndpoint string,
	ewoqPChainAddress string,
	balance int,
	createLocalValidator bool,
) (string, error)

func AddPermissionlessValidator

func AddPermissionlessValidator(subnetName string, nodeID string, stakeAmount string, stakingPeriod string) (string, error)

func ApplyUpgradeLocal

func ApplyUpgradeLocal(subnetName string) (string, error)

#nosec G204

func ApplyUpgradeToPublicNode

func ApplyUpgradeToPublicNode(subnetName, luxChainConfDir string) (string, error)

#nosec G204

func BlockchainStatus added in v1.9.5

func BlockchainStatus(blockchainName string) (string, error)

BlockchainStatus gets the status of a blockchain

func CleanNetwork

func CleanNetwork()

#nosec G204

func CleanNetworkHard

func CleanNetworkHard()

#nosec G204

func ConfigMetrics

func ConfigMetrics()

func ConfigureBlockchain added in v1.9.5

func ConfigureBlockchain(blockchainName string, flags utils.TestFlags) (string, error)

ConfigureBlockchain configures a blockchain with the given flags

func ConfigureChainConfig

func ConfigureChainConfig(subnetName string, genesisPath string)

#nosec G204

func ConfigurePerNodeChainConfig

func ConfigurePerNodeChainConfig(subnetName string, perNodeChainConfigPath string)

#nosec G204

func CreateBlockchain added in v1.9.5

func CreateBlockchain(blockchainName string, vmType string, version string) (string, error)

CreateBlockchain creates a blockchain with the given VM type and version

func CreateCustomVMConfig

func CreateCustomVMConfig(subnetName string, genesisPath string, vmPath string)

#nosec G204

func CreateCustomVMConfigNonSOV added in v1.9.5

func CreateCustomVMConfigNonSOV(subnetName string, genesisPath string, vmPath string)

CreateCustomVMConfigNonSOV creates a non-sovereign custom VM config

#nosec G204

func CreateCustomVMConfigSOV added in v1.9.5

func CreateCustomVMConfigSOV(subnetName string, genesisPath string, vmPath string)

CreateCustomVMConfigSOV creates a sovereign custom VM config

#nosec G204

func CreateEtnaSubnetEvmConfig

func CreateEtnaSubnetEvmConfig(
	subnetName string,
	ewoqEVMAddress string,
	subnetManagementType SubnetManagementType,
) (string, string)

func CreateKey

func CreateKey(keyName string) (string, error)

#nosec G204

func CreateKeyForce

func CreateKeyForce(keyName string) (string, error)

#nosec G204

func CreateKeyFromPath

func CreateKeyFromPath(keyName string, keyPath string) (string, error)

#nosec G204

func CreateLocalEtnaNode

func CreateLocalEtnaNode(
	luxdVersion string,
	clusterName string,
	numNodes int,
) (string, error)

func CreateSubnetEvmConfig

func CreateSubnetEvmConfig(subnetName string, genesisPath string) (string, string)

#nosec G204

func CreateSubnetEvmConfigNonSOV added in v1.9.5

func CreateSubnetEvmConfigNonSOV(subnetName string, genesisPath string, bootstrapped bool) (string, string)

CreateSubnetEvmConfigNonSOV creates a non-sovereign subnet EVM config

#nosec G204

func CreateSubnetEvmConfigSOV added in v1.9.5

func CreateSubnetEvmConfigSOV(subnetName string, genesisPath string) (string, string)

CreateSubnetEvmConfigSOV creates a sovereign subnet EVM config

#nosec G204

func CreateSubnetEvmConfigWithVersion

func CreateSubnetEvmConfigWithVersion(subnetName string, genesisPath string, version string)

#nosec G204

func CreateSubnetEvmConfigWithVersionNonSOV added in v1.9.5

func CreateSubnetEvmConfigWithVersionNonSOV(subnetName string, genesisPath string, version string, bootstrapped bool)

CreateSubnetEvmConfigWithVersionNonSOV creates a non-sovereign subnet EVM config with specific version

#nosec G204

func CreateSubnetEvmConfigWithVersionSOV added in v1.9.5

func CreateSubnetEvmConfigWithVersionSOV(subnetName string, genesisPath string, version string)

CreateSubnetEvmConfigWithVersionSOV creates a sovereign subnet EVM config with specific version

#nosec G204

func DeleteBlockchain added in v1.9.5

func DeleteBlockchain(blockchainName string) error

DeleteBlockchain deletes a blockchain

func DeleteE2ECluster added in v1.9.5

func DeleteE2ECluster()

DeleteE2ECluster deletes the E2E test cluster

#nosec G204

func DeleteE2EInventory added in v1.9.5

func DeleteE2EInventory()

DeleteE2EInventory deletes the E2E test inventory

#nosec G204

func DeleteElasticSubnetConfig

func DeleteElasticSubnetConfig(subnetName string)

func DeleteKey

func DeleteKey(keyName string) (string, error)

#nosec G204

func DeleteNode added in v1.9.5

func DeleteNode(hostName string)

DeleteNode deletes a node

#nosec G204

func DeleteSubnetConfig

func DeleteSubnetConfig(subnetName string)

#nosec G204

func DeployBlockchain added in v1.9.5

func DeployBlockchain(blockchainName string, flags utils.TestFlags) (string, error)

DeployBlockchain deploys a blockchain with the given flags

func DeployERC20Contract

func DeployERC20Contract(network, key, symbol, supply, receiver, blockchain string) string

#nosec G204

func DeployEtnaBlockchain

func DeployEtnaBlockchain(
	subnetName string,
	clusterName string,
	bootstrapEndpoints []string,
	ewoqPChainAddress string,
	convertOnly bool,
) (string, error)

func DeployInterchainTokenTransferrer

func DeployInterchainTokenTransferrer(args []string) string

#nosec G204

func DeployRelayer

func DeployRelayer(args []string, testFlags utils.TestFlags) (string, error)

#nosec G204

func DeploySubnetLocally

func DeploySubnetLocally(subnetName string) string

Returns the deploy output

#nosec G204

func DeploySubnetLocallyExpectError

func DeploySubnetLocallyExpectError(subnetName string)

#nosec G204

func DeploySubnetLocallyExpectErrorNonSOV added in v1.9.5

func DeploySubnetLocallyExpectErrorNonSOV(subnetName string)

DeploySubnetLocallyExpectErrorNonSOV deploys a non-sovereign subnet locally expecting an error

#nosec G204

func DeploySubnetLocallyExpectErrorSOV added in v1.9.5

func DeploySubnetLocallyExpectErrorSOV(subnetName string)

DeploySubnetLocallyExpectErrorSOV deploys a sovereign subnet locally expecting an error

#nosec G204

func DeploySubnetLocallyNonSOV added in v1.9.5

func DeploySubnetLocallyNonSOV(subnetName string) string

DeploySubnetLocallyNonSOV deploys a non-sovereign subnet locally

#nosec G204

func DeploySubnetLocallySOV added in v1.9.5

func DeploySubnetLocallySOV(subnetName string) string

DeploySubnetLocallySOV deploys a sovereign subnet locally

#nosec G204

func DeploySubnetLocallyWithArgs

func DeploySubnetLocallyWithArgs(subnetName string, version string, confPath string) string

Returns the deploy output

#nosec G204

func DeploySubnetLocallyWithArgsAndOutput

func DeploySubnetLocallyWithArgsAndOutput(subnetName string, version string, confPath string) ([]byte, error)

func DeploySubnetLocallyWithArgsAndOutputNonSOV added in v1.9.5

func DeploySubnetLocallyWithArgsAndOutputNonSOV(subnetName string, version string, confPath string) ([]byte, error)

DeploySubnetLocallyWithArgsAndOutputNonSOV deploys a non-sovereign subnet locally and returns output

#nosec G204

func DeploySubnetLocallyWithArgsAndOutputSOV added in v1.9.5

func DeploySubnetLocallyWithArgsAndOutputSOV(subnetName string, version string, confPath string) ([]byte, error)

DeploySubnetLocallyWithArgsAndOutputSOV deploys a sovereign subnet locally and returns output

#nosec G204

func DeploySubnetLocallyWithArgsExpectError

func DeploySubnetLocallyWithArgsExpectError(subnetName string, version string, confPath string)

#nosec G204

func DeploySubnetLocallyWithVersion

func DeploySubnetLocallyWithVersion(subnetName string, version string) string

Returns the deploy output

#nosec G204

func DeploySubnetLocallyWithVersionNonSOV added in v1.9.5

func DeploySubnetLocallyWithVersionNonSOV(subnetName string, version string) string

DeploySubnetLocallyWithVersionNonSOV deploys a non-sovereign subnet locally with specific version

#nosec G204

func DeploySubnetLocallyWithVersionSOV added in v1.9.5

func DeploySubnetLocallyWithVersionSOV(subnetName string, version string) string

DeploySubnetLocallyWithVersionSOV deploys a sovereign subnet locally with specific version

#nosec G204

func DeploySubnetLocallyWithViperConf

func DeploySubnetLocallyWithViperConf(subnetName string, confPath string) string

Returns the deploy output

#nosec G204

func DeploySubnetLocallyWithViperConfNonSOV added in v1.9.5

func DeploySubnetLocallyWithViperConfNonSOV(subnetName string, confPath string) string

DeploySubnetLocallyWithViperConfNonSOV deploys a non-sovereign subnet locally with viper config

#nosec G204

func DeploySubnetLocallyWithViperConfSOV added in v1.9.5

func DeploySubnetLocallyWithViperConfSOV(subnetName string, confPath string) string

DeploySubnetLocallyWithViperConfSOV deploys a sovereign subnet locally with viper config

#nosec G204

func DeployWarpContracts

func DeployWarpContracts(args []string, testFlags utils.TestFlags) (string, error)

#nosec G204

func DescribeSubnet

func DescribeSubnet(subnetName string) (string, error)

#nosec G204

func DestroyLocalNode

func DestroyLocalNode(
	clusterName string,
) (string, error)

func ExportKey

func ExportKey(keyName string) (string, error)

#nosec G204

func ExportKeyToFile

func ExportKeyToFile(keyName string, outputPath string) (string, error)

#nosec G204

func GetLatestLuxdVersionFromGithub

func GetLatestLuxdVersionFromGithub() string

func GetLocalClusterStatus

func GetLocalClusterStatus(
	clusterName string,
	blockchainName string,
) (string, error)

func GetNetworkStatus added in v1.9.5

func GetNetworkStatus() (string, error)

#nosec G204

func GetVersion

func GetVersion() string

func ImportSubnetConfig

func ImportSubnetConfig(repoAlias string, subnetName string)

#nosec G204

func ImportSubnetConfigFromURL

func ImportSubnetConfigFromURL(repoURL string, branch string, subnetName string)

#nosec G204

func ImportUpgradeBytes

func ImportUpgradeBytes(subnetName, filepath string) (string, error)

#nosec G204

func InitValidatorManager

func InitValidatorManager(
	subnetName string,
	clusterName string,
	endpoint string,
	blockchainID string,
) (string, error)

func KeyTransferSend added in v1.9.5

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

#nosec G204

func ListKeys

func ListKeys(network string, allBalances bool, chains string, tokens string) (string, error)

#nosec G204

func ListValidators

func ListValidators(subnetName string, network string) (string, error)

#nosec G204

func NodeCreate

func NodeCreate(network, version string, numNodes int, separateMonitoring bool, numAPINodes int, expectSuccess bool) string

func NodeDevnet

func NodeDevnet(version string, numNodes int, numAPINodes int) string

func NodeExport

func NodeExport(filename string, withSecrets bool) string

func NodeImport

func NodeImport(filename string, clusterName string) string

func NodeList

func NodeList() string

func NodeSSH

func NodeSSH(name, command string) string

func NodeStatus

func NodeStatus() string

func NodeUpgrade

func NodeUpgrade() string

func NodeWhitelistSSH

func NodeWhitelistSSH(sshPubKey string) string

func RemoveEtnaSubnetValidatorFromCluster

func RemoveEtnaSubnetValidatorFromCluster(
	clusterName string,
	subnetName string,
	nodeEndpoint string,
	keyName string,
	uptimeSec uint64,
) (string, error)

func RemoveValidator

func RemoveValidator(subnetName string, nodeID string) (string, error)

func SendWarpMessage

func SendWarpMessage(args []string, testFlags utils.TestFlags) (string, error)

#nosec G204

func SimulateGetSubnetStatsTestnet

func SimulateGetSubnetStatsTestnet(subnetName, subnetID string) string

#nosec G204

func SimulateMainnetAddValidator

func SimulateMainnetAddValidator(
	subnetName string,
	nodeID string,
	start string,
	period string,
	weight string,
) string

simulates mainnet add validator execution path on a local network

#nosec G204

func SimulateMainnetDeploy

func SimulateMainnetDeploy(
	subnetName string,
) string

simulates mainnet deploy execution path on a local network

#nosec G204

func SimulateMainnetDeployNonSOV added in v1.9.5

func SimulateMainnetDeployNonSOV(subnetName string, chainID int, skipPrompt bool) string

SimulateMainnetDeployNonSOV simulates non-sovereign subnet deployment on mainnet Updated to accept chainID and skipPrompt parameters to match usage

#nosec G204

func SimulateMainnetDeploySOV added in v1.9.5

func SimulateMainnetDeploySOV(subnetName string, chainID int, skipPrompt bool) string

SimulateMainnetDeploySOV simulates sovereign subnet deployment on mainnet

#nosec G204

func SimulateMainnetJoin

func SimulateMainnetJoin(
	subnetName string,
	nodeConfig string,
	pluginDir string,
	nodeID string,
) string

simulates mainnet join execution path on a local network

#nosec G204

func SimulateMultisigMainnetDeployNonSOV added in v1.9.5

func SimulateMultisigMainnetDeployNonSOV(
	subnetName string,
	controlKeys []string,
	subnetAuthKeys []string,
	txPath string,
	expectError bool,
) string

SimulateMultisigMainnetDeployNonSOV simulates multisig non-sovereign subnet deployment on mainnet

#nosec G204

func SimulateMultisigMainnetDeploySOV added in v1.9.5

func SimulateMultisigMainnetDeploySOV(
	subnetName string,
	controlKeys []string,
	subnetAuthKeys []string,
	txPath string,
	expectError bool,
) string

SimulateMultisigMainnetDeploySOV simulates multisig sovereign subnet deployment on mainnet

#nosec G204

func SimulateTestnetAddValidator

func SimulateTestnetAddValidator(
	subnetName string,
	key string,
	nodeID string,
	start string,
	period string,
	weight string,
) string

simulates testnet add validator execution path on a local network

#nosec G204

func SimulateTestnetDeploy

func SimulateTestnetDeploy(
	subnetName string,
	key string,
	controlKeys string,
) string

simulates testnet deploy execution path on a local network

#nosec G204

func SimulateTestnetDeployNonSOV added in v1.9.5

func SimulateTestnetDeployNonSOV(subnetName string, key string, controlKeys string) string

SimulateTestnetDeployNonSOV simulates non-sovereign subnet deployment on testnet

#nosec G204

func SimulateTestnetDeploySOV added in v1.9.5

func SimulateTestnetDeploySOV(subnetName string, key string, controlKeys string) string

SimulateTestnetDeploySOV simulates sovereign subnet deployment on testnet

#nosec G204

func SimulateTestnetJoin

func SimulateTestnetJoin(
	subnetName string,
	nodeConfig string,
	pluginDir string,
	nodeID string,
) string

simulates testnet join execution path on a local network

#nosec G204

func SimulateTestnetRemoveValidator

func SimulateTestnetRemoveValidator(
	subnetName string,
	key string,
	nodeID string,
) string

simulates testnet add validator execution path on a local network

func SimulateTestnetTransformSubnet

func SimulateTestnetTransformSubnet(
	subnetName string,
	key string,
) (string, error)

func StartNetwork

func StartNetwork() string

#nosec G204

func StartNetworkWithVersion

func StartNetworkWithVersion(version string) string

#nosec G204

func StopNetwork

func StopNetwork(args ...string) error

#nosec G204

func StopRelayer

func StopRelayer() (string, error)

#nosec G204

func TrackLocalEtnaSubnet

func TrackLocalEtnaSubnet(
	clusterName string,
	subnetName string,
) (string, error)

func TransactionCommit added in v1.9.5

func TransactionCommit(subnetName string, txPath string, expectError bool) string

TransactionCommit commits a transaction from a file

#nosec G204

func TransactionSignWithLedger added in v1.9.5

func TransactionSignWithLedger(subnetName string, txPath string, expectError bool) string

TransactionSignWithLedger signs a transaction with a ledger

#nosec G204

func TransformElasticSubnetLocally

func TransformElasticSubnetLocally(subnetName string) (string, error)

func TransformElasticSubnetLocallyandTransformValidators

func TransformElasticSubnetLocallyandTransformValidators(subnetName string, stakeAmount string) (string, error)

func UpgradeCustomVM

func UpgradeCustomVM(subnetName string, binaryPath string) (string, error)

#nosec G204

func UpgradeCustomVMLocal

func UpgradeCustomVMLocal(subnetName string, binaryPath string) string

#nosec G204

func UpgradeVMConfig

func UpgradeVMConfig(subnetName string, targetVersion string) (string, error)

#nosec G204

func UpgradeVMLocal

func UpgradeVMLocal(subnetName string, targetVersion string) string

#nosec G204

func UpgradeVMPublic

func UpgradeVMPublic(subnetName string, targetVersion string, pluginDir string) (string, error)

#nosec G204

Types

type PrometheusConfig

type PrometheusConfig struct {
	ScrapeConfigs []ScrapeConfig `yaml:"scrape_configs"`
}

func ParsePrometheusYamlConfig

func ParsePrometheusYamlConfig(filePath string) PrometheusConfig

ParsePrometheusYamlConfig parses prometheus config YAML file installed in separate monitoring host in /etc/prometheus/prometheus.yml

type ScrapeConfig

type ScrapeConfig struct {
	JobName       string         `yaml:"job_name"`
	StaticConfigs []StaticConfig `yaml:"static_configs"`
}

type StaticConfig

type StaticConfig struct {
	Targets []string `yaml:"targets"`
}

type SubnetManagementType

type SubnetManagementType uint
const (
	Unknown SubnetManagementType = iota
	PoA
	PoS
)

Jump to

Keyboard shortcuts

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