application

package
v1.9.2-lux.2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2025 License: BSD-3-Clause Imports: 15 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)
	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 LastActions

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

type Lux

type Lux struct {
	*sdkapp.Lux                // Embed SDK's Lux type
	Conf        *config.Config // CLI-specific config
}

Lux extends the SDK's application.Lux type with CLI-specific functionality

func New

func New() *Lux

func (*Lux) ConfigFileExists

func (app *Lux) ConfigFileExists() bool

func (*Lux) GetAggregatorLogDir

func (app *Lux) GetAggregatorLogDir(clusterName string) string

GetAggregatorLogDir returns the signature aggregator log directory

func (*Lux) GetBasePath

func (app *Lux) GetBasePath() string

GetBasePath returns the base directory path for the CLI

func (*Lux) GetEVMBinDir

func (app *Lux) GetEVMBinDir() string

func (*Lux) GetLuxBinDir

func (app *Lux) GetLuxBinDir() string

func (*Lux) GetLuxCompatibilityURL

func (*Lux) GetLuxCompatibilityURL() string

func (*Lux) GetLuxgoBinDir

func (app *Lux) GetLuxgoBinDir() string

func (*Lux) GetReposDir

func (app *Lux) GetReposDir() string

func (*Lux) GetSDKApp

func (app *Lux) GetSDKApp() *sdkapp.Lux

GetSDKApp returns the embedded SDK application for compatibility with SDK-based functions

func (*Lux) GetUpgradeBytesFilepath

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

func (*Lux) HasSubnetEVMGenesis

func (app *Lux) HasSubnetEVMGenesis(blockchainName string) (bool, string, error)

HasSubnetEVMGenesis checks if the blockchain has a Subnet-EVM genesis

func (*Lux) LoadConfig

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

func (*Lux) LoadEvmGenesis

func (app *Lux) LoadEvmGenesis(blockchainName string) (*types.EvmGenesis, error)

LoadEvmGenesis loads EVM genesis for a blockchain

func (*Lux) ReadLastActionsFile

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

func (*Lux) Setup

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

func (*Lux) WriteConfigFile

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

CLI-specific config methods

func (*Lux) WriteLastActionsFile

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

Jump to

Keyboard shortcuts

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