commands

package
v1.22.9 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Overview

Package commands provides CLI command wrappers for e2e testing. These are test utilities that invoke the CLI binary and verify outputs.

Index

Constants

View Source
const (
	CLIBinary           = "./bin/lux"
	ChainCmd            = "chain"
	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 AddEtnaChainValidatorToCluster added in v1.22.9

func AddEtnaChainValidatorToCluster(
	clusterName string,
	chainName string,
	nodeEndpoint string,
	ewoqPChainAddress string,
	balance int,
	createLocalValidator bool,
) (string, error)

func AddPermissionlessValidator

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

func ApplyUpgradeLocal

func ApplyUpgradeLocal(chainName string) (string, error)

#nosec G204

func ApplyUpgradeToPublicNode

func ApplyUpgradeToPublicNode(chainName, 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(chainName string, genesisPath string)

func ConfigurePerNodeChainConfig

func ConfigurePerNodeChainConfig(chainName string, perNodeChainConfigPath string)

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(chainName string, genesisPath string, vmPath string)

#nosec G204

func CreateCustomVMConfigNonSOV added in v1.9.5

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

CreateCustomVMConfigNonSOV creates a non-sovereign custom VM config

#nosec G204

func CreateCustomVMConfigSOV added in v1.9.5

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

CreateCustomVMConfigSOV creates a sovereign custom VM config

#nosec G204

func CreateEVMConfig added in v1.21.40

func CreateEVMConfig(chainName string, genesisPath string) (string, string)

#nosec G204

func CreateEVMConfigNonSOV added in v1.21.40

func CreateEVMConfigNonSOV(chainName string, genesisPath string, _ bool) (string, string)

CreateEVMConfigNonSOV creates a non-sovereign chain EVM config

#nosec G204

func CreateEVMConfigSOV added in v1.21.40

func CreateEVMConfigSOV(chainName string, genesisPath string) (string, string)

CreateEVMConfigSOV creates a sovereign chain EVM config

#nosec G204

func CreateEVMConfigWithVersion added in v1.21.40

func CreateEVMConfigWithVersion(chainName string, genesisPath string, version string)

#nosec G204

func CreateEVMConfigWithVersionNonSOV added in v1.21.40

func CreateEVMConfigWithVersionNonSOV(chainName string, genesisPath string, version string, _ bool)

CreateEVMConfigWithVersionNonSOV creates a non-sovereign chain EVM config with specific version

#nosec G204

func CreateEVMConfigWithVersionSOV added in v1.21.40

func CreateEVMConfigWithVersionSOV(chainName string, genesisPath string, version string)

CreateEVMConfigWithVersionSOV creates a sovereign chain EVM config with specific version

#nosec G204

func CreateEtnaEVMConfig added in v1.21.40

func CreateEtnaEVMConfig(
	chainName string,
	ewoqEVMAddress string,
	chainManagementType ChainManagementType,
) (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 DeleteBlockchain added in v1.9.5

func DeleteBlockchain(blockchainName string) error

DeleteBlockchain deletes a blockchain

func DeleteChainConfig added in v1.22.9

func DeleteChainConfig(chainName string)

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 DeleteElasticChainConfig added in v1.21.41

func DeleteElasticChainConfig(chainName 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 DeployBlockchain added in v1.9.5

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

DeployBlockchain deploys a blockchain with the given flags

func DeployChainLocally added in v1.22.9

func DeployChainLocally(chainName string) string

Returns the deploy output

#nosec G204

func DeployChainLocallyExpectError added in v1.22.9

func DeployChainLocallyExpectError(chainName string)

#nosec G204

func DeployChainLocallyExpectErrorNonSOV added in v1.22.9

func DeployChainLocallyExpectErrorNonSOV(chainName string)

DeployChainLocallyExpectErrorNonSOV deploys a non-sovereign chain locally expecting an error

#nosec G204

func DeployChainLocallyExpectErrorSOV added in v1.22.9

func DeployChainLocallyExpectErrorSOV(chainName string)

DeployChainLocallyExpectErrorSOV deploys a sovereign chain locally expecting an error

#nosec G204

func DeployChainLocallyNonSOV added in v1.22.9

func DeployChainLocallyNonSOV(chainName string) string

DeployChainLocallyNonSOV deploys a non-sovereign chain locally

#nosec G204

func DeployChainLocallySOV added in v1.22.9

func DeployChainLocallySOV(chainName string) string

DeployChainLocallySOV deploys a sovereign chain locally

#nosec G204

func DeployChainLocallyWithArgs added in v1.22.9

func DeployChainLocallyWithArgs(chainName string, version string, confPath string) string

Returns the deploy output

#nosec G204

func DeployChainLocallyWithArgsAndOutput added in v1.22.9

func DeployChainLocallyWithArgsAndOutput(chainName string, version string, confPath string) ([]byte, error)

func DeployChainLocallyWithArgsAndOutputNonSOV added in v1.22.9

func DeployChainLocallyWithArgsAndOutputNonSOV(chainName string, version string, confPath string) ([]byte, error)

DeployChainLocallyWithArgsAndOutputNonSOV deploys a non-sovereign chain locally and returns output

#nosec G204

func DeployChainLocallyWithArgsAndOutputSOV added in v1.22.9

func DeployChainLocallyWithArgsAndOutputSOV(chainName string, version string, confPath string) ([]byte, error)

DeployChainLocallyWithArgsAndOutputSOV deploys a sovereign chain locally and returns output

#nosec G204

func DeployChainLocallyWithArgsExpectError added in v1.22.9

func DeployChainLocallyWithArgsExpectError(chainName string, version string, confPath string)

func DeployChainLocallyWithVersion added in v1.22.9

func DeployChainLocallyWithVersion(chainName string, version string) string

Returns the deploy output

#nosec G204

func DeployChainLocallyWithVersionNonSOV added in v1.22.9

func DeployChainLocallyWithVersionNonSOV(chainName string, version string) string

DeployChainLocallyWithVersionNonSOV deploys a non-sovereign chain locally with specific version

#nosec G204

func DeployChainLocallyWithVersionSOV added in v1.22.9

func DeployChainLocallyWithVersionSOV(chainName string, version string) string

DeployChainLocallyWithVersionSOV deploys a sovereign chain locally with specific version

#nosec G204

func DeployChainLocallyWithViperConf added in v1.22.9

func DeployChainLocallyWithViperConf(chainName string, confPath string) string

Returns the deploy output

#nosec G204

func DeployChainLocallyWithViperConfNonSOV added in v1.22.9

func DeployChainLocallyWithViperConfNonSOV(chainName string, confPath string) string

DeployChainLocallyWithViperConfNonSOV deploys a non-sovereign chain locally with viper config

#nosec G204

func DeployChainLocallyWithViperConfSOV added in v1.22.9

func DeployChainLocallyWithViperConfSOV(chainName string, confPath string) string

DeployChainLocallyWithViperConfSOV deploys a sovereign chain locally with viper config

#nosec G204

func DeployERC20Contract

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

#nosec G204

func DeployEtnaBlockchain

func DeployEtnaBlockchain(
	chainName 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 DeployWarpContracts

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

#nosec G204

func DescribeChain added in v1.22.9

func DescribeChain(chainName 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 ImportChainConfig added in v1.22.9

func ImportChainConfig(repoAlias string, chainName string)

#nosec G204

func ImportChainConfigFromURL added in v1.22.9

func ImportChainConfigFromURL(repoURL string, branch string, chainName string)

#nosec G204

func ImportUpgradeBytes

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

#nosec G204

func InitValidatorManager

func InitValidatorManager(
	chainName 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(chainName 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 RemoveEtnaChainValidatorFromCluster added in v1.22.9

func RemoveEtnaChainValidatorFromCluster(
	clusterName string,
	chainName string,
	nodeEndpoint string,
	keyName string,
	uptimeSec uint64,
) (string, error)

func RemoveValidator

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

func SendWarpMessage

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

#nosec G204

func SimulateGetChainStatsTestnet added in v1.22.9

func SimulateGetChainStatsTestnet(chainName, chainID string) string

#nosec G204

func SimulateMainnetAddValidator

func SimulateMainnetAddValidator(
	chainName 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(
	chainName string,
) string

simulates mainnet deploy execution path on a local network

#nosec G204

func SimulateMainnetDeployNonSOV added in v1.9.5

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

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

#nosec G204

func SimulateMainnetDeploySOV added in v1.9.5

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

SimulateMainnetDeploySOV simulates sovereign chain deployment on mainnet

#nosec G204

func SimulateMainnetJoin

func SimulateMainnetJoin(
	chainName 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(
	chainName string,
	controlKeys []string,
	chainAuthKeys []string,
	txPath string,
	expectError bool,
) string

SimulateMultisigMainnetDeployNonSOV simulates multisig non-sovereign chain deployment on mainnet

#nosec G204

func SimulateMultisigMainnetDeploySOV added in v1.9.5

func SimulateMultisigMainnetDeploySOV(
	chainName string,
	controlKeys []string,
	chainAuthKeys []string,
	txPath string,
	expectError bool,
) string

SimulateMultisigMainnetDeploySOV simulates multisig sovereign chain deployment on mainnet

#nosec G204

func SimulateTestnetAddValidator

func SimulateTestnetAddValidator(
	chainName 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(
	chainName 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(chainName string, key string, controlKeys string) string

SimulateTestnetDeployNonSOV simulates non-sovereign chain deployment on testnet

#nosec G204

func SimulateTestnetDeploySOV added in v1.9.5

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

SimulateTestnetDeploySOV simulates sovereign chain deployment on testnet

#nosec G204

func SimulateTestnetJoin

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

simulates testnet join execution path on a local network

#nosec G204

func SimulateTestnetRemoveValidator

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

simulates testnet add validator execution path on a local network

func SimulateTestnetTransformChain added in v1.22.9

func SimulateTestnetTransformChain(
	chainName 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 TrackLocalEtnaChain added in v1.22.9

func TrackLocalEtnaChain(
	clusterName string,
	chainName string,
) (string, error)

func TransactionCommit added in v1.9.5

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

TransactionCommit commits a transaction from a file

#nosec G204

func TransactionSignWithLedger added in v1.9.5

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

TransactionSignWithLedger signs a transaction with a ledger

#nosec G204

func TransformElasticChainLocally added in v1.21.41

func TransformElasticChainLocally(chainName string) (string, error)

func TransformElasticChainLocallyandTransformValidators added in v1.21.41

func TransformElasticChainLocallyandTransformValidators(chainName string, stakeAmount string) (string, error)

func UpgradeCustomVM

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

#nosec G204

func UpgradeCustomVMLocal

func UpgradeCustomVMLocal(chainName string, binaryPath string) string

#nosec G204

func UpgradeVMConfig

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

#nosec G204

func UpgradeVMLocal

func UpgradeVMLocal(chainName string, targetVersion string) string

#nosec G204

func UpgradeVMPublic

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

#nosec G204

Types

type ChainManagementType added in v1.22.9

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

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"`
}

Jump to

Keyboard shortcuts

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