Documentation
¶
Overview ¶
Copyright (C) 2022, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2023, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.
Index ¶
- Constants
- type Downloader
- type LastActions
- type Lux
- func (app *Lux) AddDefaultBlockchainRPCsToSidecar(blockchainName string, network models.Network, nodeURIs []string) (bool, error)
- func (app *Lux) BlockchainConfigExists(blockchainName string) bool
- func (app *Lux) CaptureYesNo(prompt string) (bool, error)
- func (app *Lux) ChainConfigExists(subnetName string) bool
- func (app *Lux) ClustersConfigExists() bool
- func (app *Lux) ConfigFileExists() bool
- func (app *Lux) CopyGenesisFile(inputFilename string, subnetName string) error
- func (app *Lux) CopyKeyFile(inputFilename string, keyName string) error
- func (app *Lux) CopyVMBinary(inputFilename string, subnetName string) error
- func (app *Lux) CreateElasticSubnetConfig(subnetName string, es *models.ElasticSubnetConfig) error
- func (app *Lux) CreateSidecar(sc *models.Sidecar) error
- func (app *Lux) GenesisExists(subnetName string) bool
- func (app *Lux) GetAnsibleInventoryDirPath(clusterName string) string
- func (app *Lux) GetBaseDir() string
- func (app *Lux) GetBasePath() string
- func (app *Lux) GetBlockchainNamesOnNetwork(network models.Network, onlySOV bool) ([]string, error)
- func (app *Lux) GetChainConfigPath(subnetName string) string
- func (app *Lux) GetClusterConfig(clusterName string) (map[string]interface{}, error)
- func (app *Lux) GetClusterNetwork(clusterName string) (models.Network, error)
- func (app *Lux) GetConfigPath() string
- func (app *Lux) GetCustomVMDir() string
- func (app *Lux) GetCustomVMPath(subnetName string) string
- func (app *Lux) GetDownloader() Downloader
- func (app *Lux) GetEVMBinDir() string
- func (app *Lux) GetElasticSubnetConfigPath(subnetName string) string
- func (app *Lux) GetGenesisPath(subnetName string) string
- func (app *Lux) GetKey(keyName string) (string, error)
- func (app *Lux) GetKeyDir() string
- func (app *Lux) GetKeyPath(keyName string) string
- func (app *Lux) GetLPMBaseDir() string
- func (app *Lux) GetLPMLog() string
- func (app *Lux) GetLPMPluginDir() string
- func (app *Lux) GetLPMVMPath(vmid string) string
- func (app *Lux) GetLocalClusterDir(clusterName string) string
- func (app *Lux) GetLocalClustersDir() string
- func (app *Lux) GetLocalRelayerConfigPath() string
- func (app *Lux) GetLocalRelayerLogPath(network models.Network) string
- func (app *Lux) GetLocalRelayerRunPath(network models.Network) string
- func (app *Lux) GetLocalRelayerStorageDir(network models.Network) string
- func (app *Lux) GetLogDir() string
- func (app *Lux) GetLuxBinDir() string
- func (*Lux) GetLuxCompatibilityURL() string
- func (app *Lux) GetLuxdNodeConfigPath(subnetName string) string
- func (app *Lux) GetLuxdSubnetConfigPath(subnetName string) string
- func (app *Lux) GetLuxgoBinDir() string
- func (app *Lux) GetMonitoringInventoryDir(clusterName string) string
- func (app *Lux) GetNetworkFromSidecarNetworkName(name string) (models.Network, error)
- func (app *Lux) GetNodesDir() string
- func (app *Lux) GetPerNodeBlockchainConfig(subnetName string) map[string]interface{}
- func (app *Lux) GetPluginsDir() string
- func (app *Lux) GetReposDir() string
- func (app *Lux) GetRunDir() string
- func (app *Lux) GetRunFile() string
- func (app *Lux) GetSidecarNames() ([]string, error)
- func (app *Lux) GetSidecarPath(subnetName string) string
- func (app *Lux) GetSnapshotPath(snapshotName string) string
- func (app *Lux) GetSnapshotsDir() string
- func (app *Lux) GetSubnetDir() string
- func (*Lux) GetTmpPluginDir() string
- func (app *Lux) GetTokenName(subnetName string) string
- func (app *Lux) GetUpgradeBytesFilePath(subnetName string) string
- func (app *Lux) GetUpgradeBytesFilepath(subnetName string) string
- func (app *Lux) GetVersion() string
- func (app *Lux) IsLocalNetworkRunning() bool
- func (app *Lux) KeyExists(keyName string) bool
- func (app *Lux) ListClusterNames() ([]string, error)
- func (app *Lux) LoadClusterNodeConfig(clusterName string, nodeID string) (map[string]interface{}, error)
- func (app *Lux) LoadClustersConfig() (map[string]interface{}, error)
- func (app *Lux) LoadConfig() (types.Config, error)
- func (app *Lux) LoadElasticSubnetConfig(subnetName string) (models.ElasticSubnetConfig, error)
- func (app *Lux) LoadEvmGenesis(subnetName string) (core.Genesis, error)
- func (app *Lux) LoadRawChainConfig(subnetName string) ([]byte, error)
- func (app *Lux) LoadRawGenesis(subnetName string) ([]byte, error)
- func (app *Lux) LoadRawLuxdSubnetConfig(subnetName string) ([]byte, error)
- func (app *Lux) LoadRawNetworkUpgrades(subnetName string) ([]byte, error)
- func (app *Lux) LoadSidecar(subnetName string) (models.Sidecar, error)
- func (app *Lux) LuxdNodeConfigExists(subnetName string) bool
- func (app *Lux) LuxdSubnetConfigExists(subnetName string) bool
- func (app *Lux) NetworkUpgradeExists(subnetName string) bool
- func (app *Lux) ReadLastActionsFile() (*LastActions, error)
- func (app *Lux) ReadLockUpgradeFile(subnetName string) ([]byte, error)
- func (app *Lux) ReadUpgradeFile(subnetName string) ([]byte, error)
- func (app *Lux) ResetPluginsDir() error
- func (app *Lux) Setup(baseDir string, log luxlog.Logger, conf *config.Config, ...)
- func (app *Lux) SidecarExists(subnetName string) bool
- func (app *Lux) SubnetConfigExists(subnetName string) bool
- func (app *Lux) UpdateSidecar(sc *models.Sidecar) error
- func (app *Lux) UpdateSidecarElasticSubnet(sc *models.Sidecar, network models.Network, subnetID ids.ID, assetID ids.ID, ...) error
- func (app *Lux) UpdateSidecarElasticSubnetPartialTx(sc *models.Sidecar, network models.Network, txName string, txID ids.ID) error
- func (app *Lux) UpdateSidecarNetworks(sc *models.Sidecar, network models.Network, subnetID ids.ID, ...) error
- func (app *Lux) UpdateSidecarPermissionlessValidator(sc *models.Sidecar, network models.Network, nodeID string, txID ids.ID) error
- func (app *Lux) WriteConfigFile(data []byte) error
- func (app *Lux) WriteGenesisFile(subnetName string, genesisBytes []byte) error
- func (app *Lux) WriteLastActionsFile(acts *LastActions)
- func (app *Lux) WriteLockUpgradeFile(subnetName string, bytes []byte) error
- func (app *Lux) WriteSidecarFile(sc *models.Sidecar) error
- func (app *Lux) WriteUpgradeFile(subnetName string, bytes []byte) error
Constants ¶
const (
WriteReadReadPerms = 0o644
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Downloader ¶
type Downloader interface {
Download(url string) ([]byte, error)
DownloadWithTee(url string, filePath string) ([]byte, error)
GetLatestReleaseVersion(releaseURL string) (string, error)
GetLatestPreReleaseVersion(releaseURL string) (string, error)
GetAllReleasesForRepo(org, repo string) ([]string, error)
}
This is a generic interface for performing highly testable downloads. All methods here involve external http requests. To write tests using these functions, provide a mocked version of this interface to your application object.
func NewDownloader ¶
func NewDownloader() Downloader
type Lux ¶
type Lux struct {
Log luxlog.Logger
Conf *config.Config
Prompt prompts.Prompter
Lpm *lpm.Client
LpmDir string
Apm *lpm.Client // APM is similar to LPM
ApmDir func() string
Downloader Downloader
Cmd interface{} // Current command being executed (cobra.Command)
// contains filtered or unexported fields
}
func (*Lux) AddDefaultBlockchainRPCsToSidecar ¶
func (app *Lux) AddDefaultBlockchainRPCsToSidecar( blockchainName string, network models.Network, nodeURIs []string, ) (bool, error)
AddDefaultBlockchainRPCsToSidecar adds default RPC endpoints to sidecar
func (*Lux) BlockchainConfigExists ¶
BlockchainConfigExists checks if blockchain config exists
func (*Lux) CaptureYesNo ¶ added in v1.8.15
CaptureYesNo delegates to the internal prompt
func (*Lux) ChainConfigExists ¶
ChainConfigExists checks if chain config exists
func (*Lux) ClustersConfigExists ¶
ClustersConfigExists checks if clusters config exists
func (*Lux) ConfigFileExists ¶
func (*Lux) CopyGenesisFile ¶ added in v1.7.9
func (*Lux) CopyKeyFile ¶ added in v1.7.9
func (*Lux) CopyVMBinary ¶ added in v1.7.9
func (*Lux) CreateElasticSubnetConfig ¶ added in v1.7.9
func (app *Lux) CreateElasticSubnetConfig(subnetName string, es *models.ElasticSubnetConfig) error
func (*Lux) GenesisExists ¶ added in v1.7.9
func (*Lux) GetAnsibleInventoryDirPath ¶
GetAnsibleInventoryDirPath returns the ansible inventory directory path
func (*Lux) GetBaseDir ¶ added in v1.7.9
func (*Lux) GetBasePath ¶
GetBasePath returns the base directory path for the CLI
func (*Lux) GetBlockchainNamesOnNetwork ¶
GetBlockchainNamesOnNetwork returns blockchain names deployed on a network
func (*Lux) GetChainConfigPath ¶
GetChainConfigPath returns the chain config path for a subnet
func (*Lux) GetClusterConfig ¶
GetClusterConfig returns cluster configuration
func (*Lux) GetClusterNetwork ¶
GetClusterNetwork returns the network for a given cluster
func (*Lux) GetConfigPath ¶ added in v1.7.9
func (*Lux) GetCustomVMDir ¶ added in v1.7.9
func (*Lux) GetCustomVMPath ¶ added in v1.7.9
func (*Lux) GetDownloader ¶ added in v1.7.9
func (app *Lux) GetDownloader() Downloader
func (*Lux) GetEVMBinDir ¶
func (*Lux) GetElasticSubnetConfigPath ¶ added in v1.7.9
func (*Lux) GetGenesisPath ¶ added in v1.7.9
func (*Lux) GetKeyPath ¶ added in v1.7.9
func (*Lux) GetLPMBaseDir ¶ added in v1.7.9
func (*Lux) GetLPMPluginDir ¶ added in v1.7.9
func (*Lux) GetLPMVMPath ¶ added in v1.7.9
func (*Lux) GetLocalClusterDir ¶
GetLocalClusterDir returns the directory for a specific local cluster
func (*Lux) GetLocalClustersDir ¶
GetLocalClustersDir returns the directory for local clusters
func (*Lux) GetLocalRelayerConfigPath ¶
GetLocalRelayerConfigPath returns the path for local relayer config
func (*Lux) GetLocalRelayerLogPath ¶
GetLocalRelayerLogPath returns the path to the relayer log file
func (*Lux) GetLocalRelayerRunPath ¶
GetLocalRelayerRunPath returns the path to the relayer run file
func (*Lux) GetLocalRelayerStorageDir ¶
GetLocalRelayerStorageDir returns the path to the relayer storage directory
func (*Lux) GetLuxBinDir ¶
func (*Lux) GetLuxCompatibilityURL ¶
func (*Lux) GetLuxdNodeConfigPath ¶
GetLuxdNodeConfigPath returns the node config path for a subnet
func (*Lux) GetLuxdSubnetConfigPath ¶
GetLuxdSubnetConfigPath returns the luxd subnet config path for a subnet
func (*Lux) GetLuxgoBinDir ¶
func (*Lux) GetMonitoringInventoryDir ¶
GetMonitoringInventoryDir returns the monitoring inventory directory path
func (*Lux) GetNetworkFromSidecarNetworkName ¶
GetNetworkFromSidecarNetworkName returns the network from sidecar network name
func (*Lux) GetNodesDir ¶
GetNodesDir returns the nodes directory path
func (*Lux) GetPerNodeBlockchainConfig ¶
GetPerNodeBlockchainConfig returns per-node blockchain config
func (*Lux) GetPluginsDir ¶ added in v1.7.9
func (*Lux) GetReposDir ¶
func (*Lux) GetRunFile ¶ added in v1.7.9
func (*Lux) GetSidecarNames ¶ added in v1.7.9
func (*Lux) GetSidecarPath ¶ added in v1.7.9
func (*Lux) GetSnapshotPath ¶
GetSnapshotPath returns the path to a snapshot
func (*Lux) GetSnapshotsDir ¶ added in v1.7.9
func (*Lux) GetSubnetDir ¶ added in v1.7.9
func (*Lux) GetTmpPluginDir ¶ added in v1.7.9
func (*Lux) GetTokenName ¶ added in v1.7.9
func (*Lux) GetUpgradeBytesFilePath ¶ added in v1.7.9
func (*Lux) GetUpgradeBytesFilepath ¶
func (*Lux) GetVersion ¶ added in v1.8.15
func (*Lux) IsLocalNetworkRunning ¶ added in v1.7.9
func (*Lux) ListClusterNames ¶
ListClusterNames returns a list of cluster names
func (*Lux) LoadClusterNodeConfig ¶
func (app *Lux) LoadClusterNodeConfig(clusterName string, nodeID string) (map[string]interface{}, error)
LoadClusterNodeConfig loads node configuration for a cluster
func (*Lux) LoadClustersConfig ¶
LoadClustersConfig loads the clusters configuration
func (*Lux) LoadElasticSubnetConfig ¶ added in v1.7.9
func (app *Lux) LoadElasticSubnetConfig(subnetName string) (models.ElasticSubnetConfig, error)
func (*Lux) LoadEvmGenesis ¶
func (*Lux) LoadRawChainConfig ¶
LoadRawChainConfig loads raw chain config
func (*Lux) LoadRawGenesis ¶ added in v1.7.9
func (*Lux) LoadRawLuxdSubnetConfig ¶
LoadRawLuxdSubnetConfig loads raw subnet config
func (*Lux) LoadRawNetworkUpgrades ¶
LoadRawNetworkUpgrades loads raw network upgrades
func (*Lux) LoadSidecar ¶ added in v1.7.9
func (*Lux) LuxdNodeConfigExists ¶
LuxdNodeConfigExists checks if luxd node config exists
func (*Lux) LuxdSubnetConfigExists ¶
LuxdSubnetConfigExists checks if subnet config exists
func (*Lux) NetworkUpgradeExists ¶
NetworkUpgradeExists checks if network upgrade file exists
func (*Lux) ReadLastActionsFile ¶
func (app *Lux) ReadLastActionsFile() (*LastActions, error)
func (*Lux) ReadLockUpgradeFile ¶ added in v1.7.9
func (*Lux) ReadUpgradeFile ¶ added in v1.7.9
func (*Lux) ResetPluginsDir ¶
ResetPluginsDir resets the plugins directory
func (*Lux) SidecarExists ¶ added in v1.7.9
func (*Lux) SubnetConfigExists ¶ added in v1.7.9
func (*Lux) UpdateSidecarElasticSubnet ¶ added in v1.7.9
func (*Lux) UpdateSidecarElasticSubnetPartialTx ¶ added in v1.7.9
func (*Lux) UpdateSidecarNetworks ¶ added in v1.7.9
func (*Lux) UpdateSidecarPermissionlessValidator ¶ added in v1.7.9
func (*Lux) WriteConfigFile ¶
func (*Lux) WriteGenesisFile ¶ added in v1.7.9
func (*Lux) WriteLastActionsFile ¶
func (app *Lux) WriteLastActionsFile(acts *LastActions)