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.
Index ¶
- func DownloadReleaseVersion(log logging.Logger, repo, version, binDir string) (string, error)
- func GetAsyncContext() context.Context
- func GetLatestReleaseVersion(releaseURL string) (string, error)
- func GetServerPID(app *application.Avalanche) (int, error)
- func InstallArchive(ext string, archive []byte, binDir string) error
- func KillgRPCServerProcess(app *application.Avalanche) error
- func NewGRPCClient() (client.Client, error)
- func NewGRPCServer(snapshotsDir string) (server.Server, error)
- func StartServerProcess(app *application.Avalanche) error
- func WatchServerProcess(serverCancel context.CancelFunc, errc chan error, log logging.Logger)
- type BinaryChecker
- type PluginBinaryDownloader
- type ProcessChecker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadReleaseVersion ¶
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
func GetAsyncContext ¶
GetAsyncContext returns a timeout context with the cancel function suppressed
func GetLatestReleaseVersion ¶
GetLatestReleaseVersion returns the latest available version from github
func GetServerPID ¶
func GetServerPID(app *application.Avalanche) (int, error)
func InstallArchive ¶
InstallArchive installs the binary archive downloaded
func KillgRPCServerProcess ¶
func KillgRPCServerProcess(app *application.Avalanche) error
func NewGRPCClient ¶
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 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 WatchServerProcess ¶
func WatchServerProcess(serverCancel context.CancelFunc, errc chan error, log logging.Logger)
Types ¶
type BinaryChecker ¶
type BinaryChecker interface {
ExistsWithLatestVersion(name, binaryPrefix string) (bool, string, error)
}
func NewBinaryChecker ¶
func NewBinaryChecker() BinaryChecker
type PluginBinaryDownloader ¶
type PluginBinaryDownloader interface { Download(vmIDs map[string]struct{}, pluginDir, binDir string) error DownloadVM(vmID string, pluginDir, binDir string) error }
func NewPluginBinaryDownloader ¶
func NewPluginBinaryDownloader(log logging.Logger) 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