application

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Overview

Copyright (C) 2022, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2023, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Avalanche

type Avalanche struct {
	Log logging.Logger

	Conf       *config.Config
	Prompt     prompts.Prompter
	Apm        *apm.APM
	ApmDir     string
	Downloader Downloader
	// contains filtered or unexported fields
}

func New

func New() *Avalanche

func (*Avalanche) AvagoNodeConfigExists

func (app *Avalanche) AvagoNodeConfigExists(subnetName string) bool

func (*Avalanche) AvagoSubnetConfigExists

func (app *Avalanche) AvagoSubnetConfigExists(subnetName string) bool

func (*Avalanche) ChainConfigExists

func (app *Avalanche) ChainConfigExists(subnetName string) bool

func (*Avalanche) CheckCertInSSHDir

func (app *Avalanche) CheckCertInSSHDir(certName string) (bool, error)

func (*Avalanche) ClusterExists

func (app *Avalanche) ClusterExists(clusterName string) (bool, error)

func (*Avalanche) ClustersConfigExists

func (app *Avalanche) ClustersConfigExists() bool

func (*Avalanche) CopyGenesisFile

func (app *Avalanche) CopyGenesisFile(inputFilename string, subnetName string) error

func (*Avalanche) CopyKeyFile

func (app *Avalanche) CopyKeyFile(inputFilename string, keyName string) error

func (*Avalanche) CopyVMBinary

func (app *Avalanche) CopyVMBinary(inputFilename string, subnetName string) error

func (*Avalanche) CreateAnsibleDir

func (app *Avalanche) CreateAnsibleDir() error

func (*Avalanche) CreateAnsibleInventoryDir

func (app *Avalanche) CreateAnsibleInventoryDir() error

func (*Avalanche) CreateAnsibleNodeConfigDir

func (app *Avalanche) CreateAnsibleNodeConfigDir(nodeID string) error

CreateAnsibleNodeConfigDir creates the ansible node config directory specific for nodeID inside .avalanche-cli

func (*Avalanche) CreateElasticSubnetConfig

func (app *Avalanche) CreateElasticSubnetConfig(subnetName string, es *models.ElasticSubnetConfig) error

func (*Avalanche) CreateMonitoringDashboardDir

func (app *Avalanche) CreateMonitoringDashboardDir() error

func (*Avalanche) CreateMonitoringDir

func (app *Avalanche) CreateMonitoringDir() error

func (*Avalanche) CreateNodeCloudConfigFile

func (app *Avalanche) CreateNodeCloudConfigFile(nodeName string, nodeConfig *models.NodeConfig) error

func (*Avalanche) CreateSidecar

func (app *Avalanche) CreateSidecar(sc *models.Sidecar) error

func (*Avalanche) GenesisExists

func (app *Avalanche) GenesisExists(subnetName string) bool

func (*Avalanche) GetAPMBaseDir

func (app *Avalanche) GetAPMBaseDir() string

func (*Avalanche) GetAPMLog

func (app *Avalanche) GetAPMLog() string

func (*Avalanche) GetAPMPluginDir

func (app *Avalanche) GetAPMPluginDir() string

func (*Avalanche) GetAPMVMPath

func (app *Avalanche) GetAPMVMPath(vmid string) string

func (*Avalanche) GetAWMRelayerBinDir

func (app *Avalanche) GetAWMRelayerBinDir() string

func (*Avalanche) GetAWMRelayerConfigPath

func (app *Avalanche) GetAWMRelayerConfigPath() string

func (*Avalanche) GetAWMRelayerLogPath

func (app *Avalanche) GetAWMRelayerLogPath() string

func (*Avalanche) GetAWMRelayerRunPath

func (app *Avalanche) GetAWMRelayerRunPath() string

func (*Avalanche) GetAWMRelayerServiceConfigPath

func (app *Avalanche) GetAWMRelayerServiceConfigPath(baseDir string) string

func (*Avalanche) GetAWMRelayerServiceDir

func (app *Avalanche) GetAWMRelayerServiceDir(baseDir string) string

func (*Avalanche) GetAWMRelayerServiceStorageDir

func (app *Avalanche) GetAWMRelayerServiceStorageDir(baseDir string) string

func (*Avalanche) GetAWMRelayerSnapshotConfsDir

func (app *Avalanche) GetAWMRelayerSnapshotConfsDir() string

func (*Avalanche) GetAWMRelayerStorageDir

func (app *Avalanche) GetAWMRelayerStorageDir() string

func (*Avalanche) GetAnsibleDir

func (app *Avalanche) GetAnsibleDir() string

func (*Avalanche) GetAnsibleInventoryDirPath

func (app *Avalanche) GetAnsibleInventoryDirPath(clusterName string) string

func (*Avalanche) GetAvagoNodeConfigPath

func (app *Avalanche) GetAvagoNodeConfigPath(subnetName string) string

func (*Avalanche) GetAvagoSubnetConfigPath

func (app *Avalanche) GetAvagoSubnetConfigPath(subnetName string) string

func (*Avalanche) GetAvalanchegoBinDir

func (app *Avalanche) GetAvalanchegoBinDir() string

func (*Avalanche) GetAvalanchegoCompatibilityURL

func (*Avalanche) GetAvalanchegoCompatibilityURL() string

func (*Avalanche) GetBaseDir

func (app *Avalanche) GetBaseDir() string

func (*Avalanche) GetChainConfigPath

func (app *Avalanche) GetChainConfigPath(subnetName string) string

func (*Avalanche) GetClusterConfig

func (app *Avalanche) GetClusterConfig(clusterName string) (models.ClusterConfig, error)

func (*Avalanche) GetClusterNetwork

func (app *Avalanche) GetClusterNetwork(clusterName string) (models.Network, error)

func (*Avalanche) GetClusterYAMLFilePath

func (app *Avalanche) GetClusterYAMLFilePath(clusterName string) string

func (*Avalanche) GetClustersConfigPath

func (app *Avalanche) GetClustersConfigPath() string

func (*Avalanche) GetCustomVMDir

func (app *Avalanche) GetCustomVMDir() string

func (*Avalanche) GetCustomVMPath

func (app *Avalanche) GetCustomVMPath(subnetName string) string

func (*Avalanche) GetDownloader

func (app *Avalanche) GetDownloader() Downloader

func (*Avalanche) GetElasticSubnetConfigPath

func (app *Avalanche) GetElasticSubnetConfigPath(subnetName string) string

func (*Avalanche) GetExtraLocalNetworkDataPath

func (app *Avalanche) GetExtraLocalNetworkDataPath() string

func (*Avalanche) GetExtraLocalNetworkSnapshotsDir

func (app *Avalanche) GetExtraLocalNetworkSnapshotsDir() string

func (*Avalanche) GetGenesisPath

func (app *Avalanche) GetGenesisPath(subnetName string) string

func (*Avalanche) GetKeyDir

func (app *Avalanche) GetKeyDir() string

func (*Avalanche) GetKeyPath

func (app *Avalanche) GetKeyPath(keyName string) string

func (*Avalanche) GetLoadTestInventoryDir

func (app *Avalanche) GetLoadTestInventoryDir(clusterName string) string

func (*Avalanche) GetMonitoringDashboardDir

func (app *Avalanche) GetMonitoringDashboardDir() string

func (*Avalanche) GetMonitoringDir

func (app *Avalanche) GetMonitoringDir() string

func (*Avalanche) GetMonitoringInventoryDir

func (app *Avalanche) GetMonitoringInventoryDir(clusterName string) string

func (*Avalanche) GetNodeBLSSecretKeyPath

func (app *Avalanche) GetNodeBLSSecretKeyPath(instanceID string) string

func (*Avalanche) GetNodeConfigJSONFile

func (app *Avalanche) GetNodeConfigJSONFile(nodeID string) string

func (*Avalanche) GetNodeConfigPath

func (app *Avalanche) GetNodeConfigPath(nodeName string) string

func (*Avalanche) GetNodeInstanceAvaGoConfigDirPath

func (app *Avalanche) GetNodeInstanceAvaGoConfigDirPath(nodeName string) string

func (*Avalanche) GetNodeInstanceDirPath

func (app *Avalanche) GetNodeInstanceDirPath(nodeName string) string

func (*Avalanche) GetNodesDir

func (app *Avalanche) GetNodesDir() string

func (*Avalanche) GetPluginsDir

func (app *Avalanche) GetPluginsDir() string

func (*Avalanche) GetReposDir

func (app *Avalanche) GetReposDir() string

func (*Avalanche) GetRunDir

func (app *Avalanche) GetRunDir() string

func (*Avalanche) GetRunFile

func (app *Avalanche) GetRunFile() string

func (*Avalanche) GetSSHCertFilePath

func (*Avalanche) GetSSHCertFilePath(certName string) (string, error)

func (*Avalanche) GetServicesDir

func (app *Avalanche) GetServicesDir(baseDir string) string

func (*Avalanche) GetSidecarNames

func (app *Avalanche) GetSidecarNames() ([]string, error)

func (*Avalanche) GetSidecarPath

func (app *Avalanche) GetSidecarPath(subnetName string) string

func (*Avalanche) GetSnapshotsDir

func (app *Avalanche) GetSnapshotsDir() string

func (*Avalanche) GetSubnetDir

func (app *Avalanche) GetSubnetDir() string

func (*Avalanche) GetSubnetEVMBinDir

func (app *Avalanche) GetSubnetEVMBinDir() string

func (*Avalanche) GetTeleporterBinDir

func (app *Avalanche) GetTeleporterBinDir() string

func (*Avalanche) GetTmpPluginDir

func (*Avalanche) GetTmpPluginDir() string

func (*Avalanche) GetTokenName

func (app *Avalanche) GetTokenName(subnetName string) string

func (*Avalanche) GetTokenSymbol

func (app *Avalanche) GetTokenSymbol(subnetName string) string

func (*Avalanche) GetUpgradeBytesFilePath

func (app *Avalanche) GetUpgradeBytesFilePath(subnetName string) string

func (*Avalanche) GetUpgradeBytesFilepath

func (app *Avalanche) GetUpgradeBytesFilepath(subnetName string) string

func (*Avalanche) KeyExists

func (app *Avalanche) KeyExists(keyName string) bool

func (*Avalanche) ListClusterNames

func (app *Avalanche) ListClusterNames() ([]string, error)

func (*Avalanche) LoadClusterNodeConfig

func (app *Avalanche) LoadClusterNodeConfig(nodeName string) (models.NodeConfig, error)

func (*Avalanche) LoadClustersConfig

func (app *Avalanche) LoadClustersConfig() (models.ClustersConfig, error)

func (*Avalanche) LoadElasticSubnetConfig

func (app *Avalanche) LoadElasticSubnetConfig(subnetName string) (models.ElasticSubnetConfig, error)

func (*Avalanche) LoadEvmGenesis

func (app *Avalanche) LoadEvmGenesis(subnetName string) (core.Genesis, error)

func (*Avalanche) LoadEvmGenesisFromJSON

func (*Avalanche) LoadEvmGenesisFromJSON(jsonBytes []byte) (core.Genesis, error)

func (*Avalanche) LoadRawAvagoNodeConfig

func (app *Avalanche) LoadRawAvagoNodeConfig(subnetName string) ([]byte, error)

func (*Avalanche) LoadRawAvagoSubnetConfig

func (app *Avalanche) LoadRawAvagoSubnetConfig(subnetName string) ([]byte, error)

func (*Avalanche) LoadRawChainConfig

func (app *Avalanche) LoadRawChainConfig(subnetName string) ([]byte, error)

func (*Avalanche) LoadRawGenesis

func (app *Avalanche) LoadRawGenesis(subnetName string) ([]byte, error)

func (*Avalanche) LoadRawNetworkUpgrades

func (app *Avalanche) LoadRawNetworkUpgrades(subnetName string) ([]byte, error)

func (*Avalanche) LoadSidecar

func (app *Avalanche) LoadSidecar(subnetName string) (models.Sidecar, error)

func (*Avalanche) NetworkUpgradeExists

func (app *Avalanche) NetworkUpgradeExists(subnetName string) bool

func (*Avalanche) ReadLastActionsFile

func (app *Avalanche) ReadLastActionsFile() (*LastActions, error)

func (*Avalanche) ReadLockUpgradeFile

func (app *Avalanche) ReadLockUpgradeFile(subnetName string) ([]byte, error)

func (*Avalanche) ReadUpgradeFile

func (app *Avalanche) ReadUpgradeFile(subnetName string) ([]byte, error)

func (*Avalanche) ResetPluginsDir

func (app *Avalanche) ResetPluginsDir() error

Remove all plugins from plugin dir

func (*Avalanche) SetClusterConfig

func (app *Avalanche) SetClusterConfig(clusterName string, clusterConfig models.ClusterConfig) error

func (*Avalanche) Setup

func (app *Avalanche) Setup(baseDir string, log logging.Logger, conf *config.Config, prompt prompts.Prompter, downloader Downloader)

func (*Avalanche) SetupMonitoringEnv

func (app *Avalanche) SetupMonitoringEnv() error

func (*Avalanche) SidecarExists

func (app *Avalanche) SidecarExists(subnetName string) bool

func (*Avalanche) SubnetConfigExists

func (app *Avalanche) SubnetConfigExists(subnetName string) bool

func (*Avalanche) UpdateSidecar

func (app *Avalanche) UpdateSidecar(sc *models.Sidecar) error

func (*Avalanche) UpdateSidecarElasticSubnet

func (app *Avalanche) UpdateSidecarElasticSubnet(
	sc *models.Sidecar,
	network models.Network,
	subnetID ids.ID,
	assetID ids.ID,
	pchainTXID ids.ID,
	tokenName string,
	tokenSymbol string,
) error

func (*Avalanche) UpdateSidecarElasticSubnetPartialTx

func (app *Avalanche) UpdateSidecarElasticSubnetPartialTx(
	sc *models.Sidecar,
	network models.Network,
	txName string,
	txID ids.ID,
) error

func (*Avalanche) UpdateSidecarNetworks

func (app *Avalanche) UpdateSidecarNetworks(
	sc *models.Sidecar,
	network models.Network,
	subnetID ids.ID,
	transferSubnetOwnershipTxID ids.ID,
	blockchainID ids.ID,
	teleporterMessengerAddress string,
	teleporterRegistryAddress string,
) error

func (*Avalanche) UpdateSidecarPermissionlessValidator

func (app *Avalanche) UpdateSidecarPermissionlessValidator(
	sc *models.Sidecar,
	network models.Network,
	nodeID string,
	txID ids.ID,
) error

func (*Avalanche) WriteAvagoNodeConfigFile

func (app *Avalanche) WriteAvagoNodeConfigFile(subnetName string, bs []byte) error

func (*Avalanche) WriteAvagoSubnetConfigFile

func (app *Avalanche) WriteAvagoSubnetConfigFile(subnetName string, bs []byte) error

func (*Avalanche) WriteChainConfigFile

func (app *Avalanche) WriteChainConfigFile(subnetName string, bs []byte) error

func (*Avalanche) WriteClustersConfigFile

func (app *Avalanche) WriteClustersConfigFile(clustersConfig *models.ClustersConfig) error

func (*Avalanche) WriteGenesisFile

func (app *Avalanche) WriteGenesisFile(subnetName string, genesisBytes []byte) error

func (*Avalanche) WriteLastActionsFile

func (app *Avalanche) WriteLastActionsFile(acts *LastActions)

func (*Avalanche) WriteLockUpgradeFile

func (app *Avalanche) WriteLockUpgradeFile(subnetName string, bytes []byte) error

func (*Avalanche) WriteNetworkUpgradesFile

func (app *Avalanche) WriteNetworkUpgradesFile(subnetName string, bs []byte) error

func (*Avalanche) WriteUpgradeFile

func (app *Avalanche) WriteUpgradeFile(subnetName string, bytes []byte) error

type Downloader

type Downloader interface {
	Download(url string) ([]byte, error)
	GetLatestReleaseVersion(releaseURL string) (string, error)
	GetLatestPreReleaseVersion(org, repo 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 LastActions

type LastActions struct {
	LastSkipCheck time.Time
	LastUpdated   time.Time
	LastCheckGit  time.Time
}

Jump to

Keyboard shortcuts

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