application

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: BSD-3-Clause Imports: 18 Imported by: 0

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

View Source
const (
	WriteReadReadPerms = 0o644
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Downloader

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

func NewDownloader() Downloader

type LastActions

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

type Lux

type Lux struct {
	Log luxlog.Logger

	Conf       *config.Config
	Prompt     prompts.Prompter
	Lpm        *lpm.Client
	LpmDir     string
	Downloader Downloader
	// contains filtered or unexported fields
}

func New

func New() *Lux

func (*Lux) CaptureYesNo added in v1.8.15

func (app *Lux) CaptureYesNo(prompt string) (bool, error)

CaptureYesNo delegates to the internal prompt

func (*Lux) ConfigFileExists

func (app *Lux) ConfigFileExists() bool

func (*Lux) CopyGenesisFile added in v1.7.9

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

func (*Lux) CopyKeyFile added in v1.7.9

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

func (*Lux) CopyVMBinary added in v1.7.9

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

func (*Lux) CreateElasticSubnetConfig added in v1.7.9

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

func (*Lux) CreateSidecar added in v1.7.9

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

func (*Lux) GenesisExists added in v1.7.9

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

func (*Lux) GetBaseDir added in v1.7.9

func (app *Lux) GetBaseDir() string

func (*Lux) GetConfigPath added in v1.7.9

func (app *Lux) GetConfigPath() string

func (*Lux) GetCustomVMDir added in v1.7.9

func (app *Lux) GetCustomVMDir() string

func (*Lux) GetCustomVMPath added in v1.7.9

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

func (*Lux) GetDownloader added in v1.7.9

func (app *Lux) GetDownloader() Downloader

func (*Lux) GetEVMBinDir

func (app *Lux) GetEVMBinDir() string

func (*Lux) GetElasticSubnetConfigPath added in v1.7.9

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

func (*Lux) GetGenesisPath added in v1.7.9

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

func (*Lux) GetKeyDir added in v1.7.9

func (app *Lux) GetKeyDir() string

func (*Lux) GetKeyPath added in v1.7.9

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

func (*Lux) GetLPMBaseDir added in v1.7.9

func (app *Lux) GetLPMBaseDir() string

func (*Lux) GetLPMLog added in v1.7.9

func (app *Lux) GetLPMLog() string

func (*Lux) GetLPMPluginDir added in v1.7.9

func (app *Lux) GetLPMPluginDir() string

func (*Lux) GetLPMVMPath added in v1.7.9

func (app *Lux) GetLPMVMPath(vmid string) string

func (*Lux) GetLuxBinDir

func (app *Lux) GetLuxBinDir() string

func (*Lux) GetLuxCompatibilityURL

func (*Lux) GetLuxCompatibilityURL() string

func (*Lux) GetPluginsDir added in v1.7.9

func (app *Lux) GetPluginsDir() string

func (*Lux) GetReposDir

func (app *Lux) GetReposDir() string

func (*Lux) GetRunDir added in v1.7.9

func (app *Lux) GetRunDir() string

func (*Lux) GetRunFile added in v1.7.9

func (app *Lux) GetRunFile() string

func (*Lux) GetSidecarNames added in v1.7.9

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

func (*Lux) GetSidecarPath added in v1.7.9

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

func (*Lux) GetSnapshotsDir added in v1.7.9

func (app *Lux) GetSnapshotsDir() string

func (*Lux) GetSubnetDir added in v1.7.9

func (app *Lux) GetSubnetDir() string

func (*Lux) GetTmpPluginDir added in v1.7.9

func (*Lux) GetTmpPluginDir() string

func (*Lux) GetTokenName added in v1.7.9

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

func (*Lux) GetUpgradeBytesFilePath added in v1.7.9

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

func (*Lux) GetUpgradeBytesFilepath

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

func (*Lux) IsLocalNetworkRunning added in v1.7.9

func (app *Lux) IsLocalNetworkRunning() bool

func (*Lux) KeyExists added in v1.7.9

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

func (*Lux) LoadConfig

func (app *Lux) LoadConfig() (types.Config, error)

func (*Lux) LoadElasticSubnetConfig added in v1.7.9

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

func (*Lux) LoadEvmGenesis

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

func (*Lux) LoadRawGenesis added in v1.7.9

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

func (*Lux) LoadSidecar added in v1.7.9

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

func (*Lux) ReadLastActionsFile

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

func (*Lux) ReadLockUpgradeFile added in v1.7.9

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

func (*Lux) ReadUpgradeFile added in v1.7.9

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

func (*Lux) Setup

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

func (*Lux) SidecarExists added in v1.7.9

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

func (*Lux) SubnetConfigExists added in v1.7.9

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

func (*Lux) UpdateSidecar added in v1.7.9

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

func (*Lux) UpdateSidecarElasticSubnet added in v1.7.9

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

func (*Lux) UpdateSidecarElasticSubnetPartialTx added in v1.7.9

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

func (*Lux) UpdateSidecarNetworks added in v1.7.9

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

func (*Lux) UpdateSidecarPermissionlessValidator added in v1.7.9

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

func (*Lux) WriteConfigFile

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

func (*Lux) WriteGenesisFile added in v1.7.9

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

func (*Lux) WriteLastActionsFile

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

func (*Lux) WriteLockUpgradeFile added in v1.7.9

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

func (*Lux) WriteSidecarFile added in v1.7.9

func (app *Lux) WriteSidecarFile(sc *models.Sidecar) error

func (*Lux) WriteUpgradeFile added in v1.7.9

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

Jump to

Keyboard shortcuts

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