binutils

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: BSD-3-Clause Imports: 31 Imported by: 0

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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dest string) error

func DownloadReleaseVersion

func DownloadReleaseVersion(
	log logging.Logger,
	repo,
	version,
	binDir string,
) (string, error)

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

func GetAsyncContext() context.Context

GetAsyncContext returns a timeout context with the cancel function suppressed

func GetGithubLatestReleaseURL

func GetGithubLatestReleaseURL(org, repo string) string

func GetLatestReleaseVersion

func GetLatestReleaseVersion(releaseURL string) (string, error)

GetLatestReleaseVersion returns the latest available version from github

func GetServerPID

func GetServerPID(app *application.Avalanche) (int, error)

func InstallArchive

func InstallArchive(ext string, archive []byte, binDir string) error

InstallArchive installs the binary archive downloaded

func InstallBinary

func InstallBinary(
	app *application.Avalanche,
	version string,
	binDir 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() (client.Client, error)

NewGRPCClient hides away the details (params) of creating a gRPC server connection

func NewGRPCServer

func NewGRPCServer(snapshotsDir string) (server.Server, error)

NewGRPCClient hides away the details (params) of creating a gRPC server

func SetupAPMBin

func SetupAPMBin(app *application.Avalanche, vmid string) string

func SetupAvalanchego

func SetupAvalanchego(app *application.Avalanche, avagoVersion string) (string, error)

func SetupCustomBin

func SetupCustomBin(app *application.Avalanche, subnetName string) string

func SetupSpacesVM

func SetupSpacesVM(app *application.Avalanche, spacesVMVersion string) (string, error)

func SetupSubnetEVM

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 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 GithubDownloader

type GithubDownloader interface {
	GetDownloadURL(version string, installer Installer) (string, string, error)
}

func NewAvagoDownloader

func NewAvagoDownloader() GithubDownloader

func NewSpacesVMDownloader

func NewSpacesVMDownloader() GithubDownloader

func NewSubnetEVMDownloader

func NewSubnetEVMDownloader() GithubDownloader

type Installer

type Installer interface {
	GetArch() (string, string)
	DownloadRelease(releaseURL string) ([]byte, error)
}

func NewInstaller

func NewInstaller() Installer

type PluginBinaryDownloader

type PluginBinaryDownloader interface {
	InstallVM(vmID, vmBin, pluginDir 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

Jump to

Keyboard shortcuts

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