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.
Index ¶
- Constants
- type Downloader
- type LastActions
- type Lux
- func (app *Lux) CheckCertInSSHDir(certName string) bool
- func (app *Lux) ClearNetworkState() error
- func (app *Lux) ClusterExists(clusterName string) (bool, error)
- func (app *Lux) ConfigFileExists() bool
- func (app *Lux) CreateNodeCloudConfigFile(clusterName string, nodeConfig interface{}) error
- func (app *Lux) GetAggregatorLogDir(clusterName string) string
- func (app *Lux) GetBasePath() string
- func (app *Lux) GetClusterConfig(clusterName string) (map[string]interface{}, error)
- func (app *Lux) GetClusterYAMLFilePath(clusterName string) string
- func (app *Lux) GetClustersConfig() (map[string]interface{}, error)
- func (app *Lux) GetEVMBinDir() string
- func (app *Lux) GetLoadTestInventoryDir(clusterName string) string
- func (app *Lux) GetLuxBinDir() string
- func (*Lux) GetLuxCompatibilityURL() string
- func (app *Lux) GetLuxNodeBinDir() string
- func (app *Lux) GetLuxgoBinDir() string
- func (app *Lux) GetMonitoringDashboardDir() string
- func (app *Lux) GetNetworkStateFile() string
- func (app *Lux) GetNodeConfigPath(nodeName string) string
- func (app *Lux) GetNodeInstanceDirPath(nodeName string) string
- func (app *Lux) GetNodeStakingDir(nodeName string) string
- func (app *Lux) GetReposDir() string
- func (app *Lux) GetRunFileForNetwork(networkType string) string
- func (app *Lux) GetRunningNetworkEndpoint() string
- func (app *Lux) GetRunningNetworkType() string
- func (app *Lux) GetSDKApp() *sdkapp.Lux
- func (app *Lux) GetSSHCertFilePath(certName string) (string, error)
- func (app *Lux) GetUpgradeBytesFilepath(subnetName string) string
- func (app *Lux) GetWarpRelayerBinDir() string
- func (a *Lux) GetWarpRelayerServiceConfigPath(blockchainName string) string
- func (app *Lux) GetWarpRelayerServiceStorageDir() string
- func (app *Lux) HasEVMGenesis(blockchainName string) (bool, string, error)
- func (app *Lux) IsNetworkRunning() bool
- func (app *Lux) LoadClusterNodeConfig(clusterName string, nodeName string) (map[string]interface{}, error)
- func (app *Lux) LoadConfig() (types.Config, error)
- func (app *Lux) LoadEvmGenesis(blockchainName string) (*types.EvmGenesis, error)
- func (app *Lux) LoadNetworkState() (*NetworkState, error)
- func (app *Lux) ReadLastActionsFile() (*LastActions, error)
- func (app *Lux) SaveClustersConfig(config map[string]interface{}) error
- func (app *Lux) SaveNetworkState(state *NetworkState) error
- func (app *Lux) SetClusterConfig(clusterName string, config map[string]interface{}) error
- func (app *Lux) Setup(baseDir string, log luxlog.Logger, conf *config.Config, ...)
- func (app *Lux) SetupMonitoringEnv(clusterName string) error
- func (app *Lux) WriteConfigFile(data []byte) error
- func (app *Lux) WriteLastActionsFile(acts *LastActions)
- type NetworkState
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 ¶
Lux extends the SDK's application.Lux type with CLI-specific functionality
func (*Lux) CheckCertInSSHDir ¶
CheckCertInSSHDir checks if a certificate exists in the SSH directory
func (*Lux) ClearNetworkState ¶ added in v1.21.42
ClearNetworkState removes the network state file
func (*Lux) ClusterExists ¶
ClusterExists checks if a cluster exists
func (*Lux) ConfigFileExists ¶
func (*Lux) CreateNodeCloudConfigFile ¶
func (*Lux) GetAggregatorLogDir ¶
GetAggregatorLogDir returns the signature aggregator log directory
func (*Lux) GetBasePath ¶
GetBasePath returns the base directory path for the CLI
func (*Lux) GetClusterConfig ¶
GetClusterConfig loads cluster configuration from disk
func (*Lux) GetClusterYAMLFilePath ¶
GetClusterYAMLFilePath returns the path to a cluster's YAML config file
func (*Lux) GetClustersConfig ¶
func (*Lux) GetEVMBinDir ¶
func (*Lux) GetLoadTestInventoryDir ¶
GetLoadTestInventoryDir returns the load test inventory directory
func (*Lux) GetLuxBinDir ¶
func (*Lux) GetLuxCompatibilityURL ¶
func (*Lux) GetLuxNodeBinDir ¶ added in v1.21.23
func (*Lux) GetLuxgoBinDir ¶
GetLuxgoBinDir is deprecated, use GetLuxNodeBinDir instead
func (*Lux) GetMonitoringDashboardDir ¶
func (*Lux) GetNetworkStateFile ¶ added in v1.21.42
GetNetworkStateFile returns the path to the network state file
func (*Lux) GetNodeConfigPath ¶
GetNodeConfigPath returns the path to a node's config file
func (*Lux) GetNodeInstanceDirPath ¶
func (*Lux) GetNodeStakingDir ¶
GetNodeStakingDir returns the staking directory for a node
func (*Lux) GetReposDir ¶
func (*Lux) GetRunFileForNetwork ¶ added in v1.21.42
GetRunFileForNetwork returns the path to the run file for a specific network type. Each network type (mainnet, testnet, local) has its own run file to allow running multiple networks simultaneously.
func (*Lux) GetRunningNetworkEndpoint ¶ added in v1.21.42
GetRunningNetworkEndpoint returns the API endpoint of the running network Returns the default LocalAPIEndpoint if no network state is found
func (*Lux) GetRunningNetworkType ¶ added in v1.21.42
GetRunningNetworkType returns the type of the running network Returns "" if no network is running
func (*Lux) GetSDKApp ¶
GetSDKApp returns the embedded SDK application for compatibility with SDK-based functions
func (*Lux) GetSSHCertFilePath ¶
func (*Lux) GetUpgradeBytesFilepath ¶
func (*Lux) GetWarpRelayerBinDir ¶
func (*Lux) GetWarpRelayerServiceConfigPath ¶
GetWarpRelayerServiceConfigPath returns the path to the warp relayer service config
func (*Lux) GetWarpRelayerServiceStorageDir ¶ added in v1.9.4
func (*Lux) HasEVMGenesis ¶ added in v1.21.40
HasEVMGenesis checks if the blockchain has a EVM genesis
func (*Lux) IsNetworkRunning ¶ added in v1.21.42
IsNetworkRunning checks if a network is currently running
func (*Lux) LoadClusterNodeConfig ¶
func (app *Lux) LoadClusterNodeConfig(clusterName string, nodeName string) (map[string]interface{}, error)
LoadClusterNodeConfig loads node configuration for a cluster
func (*Lux) LoadEvmGenesis ¶
func (app *Lux) LoadEvmGenesis(blockchainName string) (*types.EvmGenesis, error)
LoadEvmGenesis loads EVM genesis for a blockchain
func (*Lux) LoadNetworkState ¶ added in v1.21.42
func (app *Lux) LoadNetworkState() (*NetworkState, error)
LoadNetworkState loads the network state from disk
func (*Lux) ReadLastActionsFile ¶
func (app *Lux) ReadLastActionsFile() (*LastActions, error)
func (*Lux) SaveClustersConfig ¶
SaveClustersConfig saves the clusters configuration
func (*Lux) SaveNetworkState ¶ added in v1.21.42
func (app *Lux) SaveNetworkState(state *NetworkState) error
SaveNetworkState saves the current network state to disk
func (*Lux) SetClusterConfig ¶
SetClusterConfig saves cluster configuration to disk
func (*Lux) SetupMonitoringEnv ¶
SetupMonitoringEnv sets up monitoring environment
func (*Lux) WriteConfigFile ¶
CLI-specific config methods
func (*Lux) WriteLastActionsFile ¶
func (app *Lux) WriteLastActionsFile(acts *LastActions)
type NetworkState ¶ added in v1.21.42
type NetworkState struct {
NetworkType string `json:"network_type"` // "local", "testnet", "mainnet"
NetworkID uint32 `json:"network_id"`
PortBase int `json:"port_base"`
GRPCPort int `json:"grpc_port"` // gRPC server port for this network
GatewayPort int `json:"gateway_port"` // gRPC gateway port for this network
APIEndpoint string `json:"api_endpoint"`
Running bool `json:"running"`
}
NetworkState tracks the state of a running local network
func CreateNetworkState ¶ added in v1.21.42
func CreateNetworkState(netType string, networkID uint32, portBase int) *NetworkState
CreateNetworkState creates a new network state for the given parameters
func CreateNetworkStateWithGRPC ¶ added in v1.21.42
func CreateNetworkStateWithGRPC(netType string, networkID uint32, portBase, grpcPort, gatewayPort int) *NetworkState
CreateNetworkStateWithGRPC creates a new network state with gRPC port configuration
func (*NetworkState) GetGRPCEndpoint ¶ added in v1.21.42
func (s *NetworkState) GetGRPCEndpoint() string
GetGRPCEndpoint returns the gRPC endpoint for connecting to this network's server