application

package
v1.2.2-rc.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: BSD-3-Clause Imports: 17 Imported by: 10

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

View Source
const (
	WriteReadReadPerms = 0o644
)

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) ConfigFileExists added in v1.2.2

func (app *Avalanche) ConfigFileExists() bool

func (*Avalanche) CopyGenesisFile

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

func (*Avalanche) CopyKeyFile added in v0.2.0

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

func (*Avalanche) CopyVMBinary added in v0.2.1

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

func (*Avalanche) CreateElasticSubnetConfig added in v1.2.0

func (app *Avalanche) CreateElasticSubnetConfig(subnetName string, es *models.ElasticSubnetConfig) 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 added in v0.2.3

func (app *Avalanche) GetAPMBaseDir() string

func (*Avalanche) GetAPMLog added in v0.2.3

func (app *Avalanche) GetAPMLog() string

func (*Avalanche) GetAPMPluginDir added in v0.2.3

func (app *Avalanche) GetAPMPluginDir() string

func (*Avalanche) GetAPMVMPath added in v0.2.3

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

func (*Avalanche) GetAvalanchegoBinDir added in v0.2.2

func (app *Avalanche) GetAvalanchegoBinDir() string

func (*Avalanche) GetAvalanchegoCompatibilityURL added in v1.0.3

func (*Avalanche) GetAvalanchegoCompatibilityURL() string

func (*Avalanche) GetBaseDir

func (app *Avalanche) GetBaseDir() string

func (*Avalanche) GetConfigPath added in v1.2.2

func (app *Avalanche) GetConfigPath() string

func (*Avalanche) GetCustomVMDir added in v0.2.1

func (app *Avalanche) GetCustomVMDir() string

func (*Avalanche) GetCustomVMPath added in v0.2.1

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

func (*Avalanche) GetDownloader added in v1.0.3

func (app *Avalanche) GetDownloader() Downloader

func (*Avalanche) GetElasticSubnetConfigPath added in v1.2.0

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

func (*Avalanche) GetGenesisPath

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

func (*Avalanche) GetKeyDir added in v0.2.0

func (app *Avalanche) GetKeyDir() string

func (*Avalanche) GetKeyPath added in v0.2.0

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

func (*Avalanche) GetPluginsDir added in v1.1.0

func (app *Avalanche) GetPluginsDir() string

func (*Avalanche) GetReposDir added in v0.2.3

func (app *Avalanche) GetReposDir() string

func (*Avalanche) GetRunDir

func (app *Avalanche) GetRunDir() string

func (*Avalanche) GetRunFile

func (app *Avalanche) GetRunFile() string

func (*Avalanche) GetSidecarNames added in v0.2.0

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

func (app *Avalanche) GetSubnetDir() string

func (*Avalanche) GetSubnetEVMBinDir added in v0.2.2

func (app *Avalanche) GetSubnetEVMBinDir() string

func (*Avalanche) GetTmpPluginDir added in v0.2.0

func (*Avalanche) GetTmpPluginDir() string

func (*Avalanche) GetTokenName

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

func (*Avalanche) GetUpgradeBytesFilePath added in v1.1.0

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

func (*Avalanche) GetUpgradeBytesFilepath added in v1.1.0

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

func (*Avalanche) KeyExists added in v0.2.0

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

func (*Avalanche) LoadConfig added in v1.2.2

func (app *Avalanche) LoadConfig() (models.Config, error)

func (*Avalanche) LoadElasticSubnetConfig added in v1.2.1

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

func (*Avalanche) LoadEvmGenesis

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

func (*Avalanche) LoadRawGenesis added in v0.2.0

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

func (*Avalanche) LoadSidecar

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

func (*Avalanche) ReadLastActionsFile added in v1.2.0

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

func (*Avalanche) ReadLockUpgradeFile added in v1.1.0

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

func (*Avalanche) ReadUpgradeFile added in v1.1.0

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

func (*Avalanche) Setup

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

func (*Avalanche) SidecarExists added in v1.1.0

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

func (*Avalanche) SubnetConfigExists added in v1.1.0

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

func (*Avalanche) UpdateSidecar added in v0.2.0

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

func (*Avalanche) UpdateSidecarElasticSubnet added in v1.2.0

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

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

func (*Avalanche) UpdateSidecarNetworks added in v1.0.0

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

func (*Avalanche) UpdateSidecarPermissionlessValidator added in v1.2.1

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

func (*Avalanche) WriteConfigFile added in v1.2.2

func (app *Avalanche) WriteConfigFile(bytes []byte) error

func (*Avalanche) WriteGenesisFile

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

func (*Avalanche) WriteLastActionsFile added in v1.2.0

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

func (*Avalanche) WriteLockUpgradeFile added in v1.1.0

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

func (*Avalanche) WriteUpgradeFile added in v1.1.0

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

type Downloader added in v1.0.1

type Downloader interface {
	Download(url string) ([]byte, error)
	GetLatestReleaseVersion(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 added in v1.0.1

func NewDownloader() Downloader

type LastActions added in v1.2.0

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

Jump to

Keyboard shortcuts

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