Documentation ¶
Overview ¶
Copyright (C) 2022, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2022, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2022, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2022, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2022, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2022, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Index ¶
- Variables
- func CopyFile(src, dest string) error
- func DownloadReleaseVersion(log logging.Logger, repo, version, binDir string) (string, error)deprecated
- func GetAsyncContext() context.Context
- func GetBackendLogFile(app *application.Avalanche) (string, error)
- func GetGithubLatestReleaseURL(org, repo string) string
- func GetServerPID(app *application.Avalanche) (int, error)
- func InstallArchive(ext string, archive []byte, binDir string) error
- func InstallBinary(app *application.Avalanche, version string, baseBinDir string, ...) (string, error)
- func KillgRPCServerProcess(app *application.Avalanche) error
- func NewGRPCClient(opts ...GRPCClientOpOption) (client.Client, error)
- func NewGRPCServer(snapshotsDir string) (server.Server, error)
- func SetupAPMBin(app *application.Avalanche, vmid string) string
- func SetupAvalanchego(app *application.Avalanche, avagoVersion string) (string, error)
- func SetupCustomBin(app *application.Avalanche, subnetName string) string
- func SetupSubnetEVM(app *application.Avalanche, subnetEVMVersion string) (string, error)
- func StartServerProcess(app *application.Avalanche) error
- func UpdateLocalSidecarRPC(app *application.Avalanche, sc models.Sidecar, rpcVersion int) error
- func UpgradeVM(app *application.Avalanche, vmID string, vmBinPath string) error
- func WatchServerProcess(serverCancel context.CancelFunc, errc chan error, log logging.Logger)
- type BinaryChecker
- type GRPCClientOp
- type GRPCClientOpOption
- type GithubDownloader
- type Installer
- type PluginBinaryDownloader
- type ProcessChecker
Constants ¶
This section is empty.
Variables ¶
var ErrGRPCTimeout = errors.New("timed out trying to contact backend controller, it is most probably not running")
ErrGRPCTimeout is a common error message if the gRPC server can't be reached
Functions ¶
func DownloadReleaseVersion
deprecated
DownloadReleaseVersion returns the latest available version from github for the given repo and version, and installs it into the apps `bin` dir. NOTE: If any of the underlying URLs change (github changes, release file names, etc.) this fails The goal MUST be to have some sort of mature binary management
Deprecated: Use GetLatestReleaseVersion
func GetAsyncContext ¶
GetAsyncContext returns a timeout context with the cancel function suppressed
func GetBackendLogFile ¶ added in v1.1.3
func GetBackendLogFile(app *application.Avalanche) (string, error)
func GetGithubLatestReleaseURL ¶ added in v0.2.2
func GetServerPID ¶
func GetServerPID(app *application.Avalanche) (int, error)
func InstallArchive ¶
InstallArchive installs the binary archive downloaded
func InstallBinary ¶ added in v0.2.2
func InstallBinary( app *application.Avalanche, version string, baseBinDir string, installDir string, binPrefix, org, repo string, downloader GithubDownloader, installer Installer, ) (string, error)
func KillgRPCServerProcess ¶
func KillgRPCServerProcess(app *application.Avalanche) error
func NewGRPCClient ¶
func NewGRPCClient(opts ...GRPCClientOpOption) (client.Client, error)
NewGRPCClient hides away the details (params) of creating a gRPC server connection
func NewGRPCServer ¶
NewGRPCClient hides away the details (params) of creating a gRPC server
func SetupAPMBin ¶ added in v0.2.3
func SetupAPMBin(app *application.Avalanche, vmid string) string
func SetupAvalanchego ¶ added in v0.2.2
func SetupAvalanchego(app *application.Avalanche, avagoVersion string) (string, error)
func SetupCustomBin ¶ added in v0.2.2
func SetupCustomBin(app *application.Avalanche, subnetName string) string
func SetupSubnetEVM ¶ added in v0.2.2
func SetupSubnetEVM(app *application.Avalanche, subnetEVMVersion string) (string, error)
func StartServerProcess ¶
func StartServerProcess(app *application.Avalanche) error
StartServerProcess starts the gRPC server as a reentrant process of this binary it just executes `avalanche-cli backend start`
func UpdateLocalSidecarRPC ¶ added in v1.1.1
update the RPC version of the VM in the sidecar file
func UpgradeVM ¶ added in v1.1.0
func UpgradeVM(app *application.Avalanche, vmID string, vmBinPath string) error
func WatchServerProcess ¶
func WatchServerProcess(serverCancel context.CancelFunc, errc chan error, log logging.Logger)
Types ¶
type BinaryChecker ¶
type BinaryChecker interface {
ExistsWithVersion(name, binaryPrefix, version string) (bool, error)
}
func NewBinaryChecker ¶
func NewBinaryChecker() BinaryChecker
type GRPCClientOp ¶ added in v1.1.1
type GRPCClientOp struct {
// contains filtered or unexported fields
}
type GRPCClientOpOption ¶ added in v1.1.1
type GRPCClientOpOption func(*GRPCClientOp)
func WithAvoidRPCVersionCheck ¶ added in v1.1.1
func WithAvoidRPCVersionCheck(avoidRPCVersionCheck bool) GRPCClientOpOption
type GithubDownloader ¶ added in v0.2.2
type GithubDownloader interface {
GetDownloadURL(version string, installer Installer) (string, string, error)
}
func NewAvagoDownloader ¶ added in v0.2.2
func NewAvagoDownloader() GithubDownloader
func NewSubnetEVMDownloader ¶ added in v0.2.2
func NewSubnetEVMDownloader() GithubDownloader
type Installer ¶ added in v0.2.2
func NewInstaller ¶ added in v0.2.2
func NewInstaller() Installer
type PluginBinaryDownloader ¶
type PluginBinaryDownloader interface { InstallVM(vmID, vmBin string) error UpgradeVM(vmID, vmBin string) error RemoveVM(vmID string) error }
func NewPluginBinaryDownloader ¶
func NewPluginBinaryDownloader(app *application.Avalanche) PluginBinaryDownloader
type ProcessChecker ¶
type ProcessChecker interface { // IsServerProcessRunning returns true if the gRPC server is running, // or false if not IsServerProcessRunning(app *application.Avalanche) (bool, error) }
ProcessChecker is responsible for checking if the gRPC server is running
func NewProcessChecker ¶
func NewProcessChecker() ProcessChecker
NewProcessChecker creates a new process checker which can respond if the server is running