Documentation
¶
Index ¶
- Constants
- func LoadConfigFromFile(path string) (*config.HyperdriveConfig, error)
- func SaveConfig(cfg *config.HyperdriveConfig, directory, filename string) error
- func SyncRatioToPercent(in float64) float64
- type Client
- func (c *Client) DeleteVolume(volume string) (string, error)
- func (c *Client) GetClientVolumeName(container string, volumeTarget string) (string, error)
- func (c *Client) GetClientVolumeSource(container string, volumeTarget string) (string, error)
- func (c *Client) GetDirSizeViaEcMigrator(container string, targetDir string, image string) (uint64, error)
- func (c *Client) GetDockerContainerShutdownTime(container string) (time.Time, error)
- func (c *Client) GetDockerImage(container string) (string, error)
- func (c *Client) GetDockerStatus(container string) (string, error)
- func (c *Client) GetServiceVersion() (string, error)
- func (c *Client) GetVolumeSize(volumeName string) (string, error)
- func (c *Client) InstallService(verbose, noDeps bool, version, path string) error
- func (c *Client) LoadBackupConfig() (*config.HyperdriveConfig, error)
- func (c *Client) LoadConfig() (*config.HyperdriveConfig, bool, error)
- func (c *Client) PauseService(composeFiles []string) error
- func (c *Client) PrintServiceCompose(composeFiles []string) error
- func (c *Client) PrintServiceLogs(composeFiles []string, tail string, serviceNames ...string) error
- func (c *Client) PrintServiceStats(composeFiles []string) error
- func (c *Client) PrintServiceStatus(composeFiles []string) error
- func (c *Client) PurgeData(composeFiles []string) error
- func (c *Client) RemoveContainer(container string) (string, error)
- func (c *Client) RestartContainer(container string) (string, error)
- func (c *Client) RunEcMigrator(container string, volume string, targetDir string, mode string, image string) error
- func (c *Client) RunNethermindPruneStarter(container string) error
- func (c *Client) RunPruneProvisioner(container string, volume string, image string) error
- func (c *Client) SaveConfig(cfg *config.HyperdriveConfig) error
- func (c *Client) StartContainer(container string) (string, error)
- func (c *Client) StartService(composeFiles []string) error
- func (c *Client) StopContainer(container string) (string, error)
- func (c *Client) StopService(composeFiles []string) error
- func (c *Client) TerminateService(composeFiles []string, configPath string) error
- func (c *Client) UpdateGrafanaDatabaseConfiguration(config *config.HyperdriveConfig) error
- func (c *Client) UpdatePrometheusConfiguration(config *config.HyperdriveConfig) error
- func (c *Client) WithReady() (*Client, error)
- func (c *Client) WithStatus() (*Client, bool, error)
Constants ¶
const ( InstallerURL string = "https://github.com/nodeset-org/hyperdrive/releases/download/%s/install.sh" SettingsFile string = "user-settings.yml" BackupSettingsFile string = "user-settings-backup.yml" )
Config
Variables ¶
This section is empty.
Functions ¶
func LoadConfigFromFile ¶
func LoadConfigFromFile(path string) (*config.HyperdriveConfig, error)
Loads a config without updating it if it exists
func SaveConfig ¶
func SaveConfig(cfg *config.HyperdriveConfig, directory, filename string) error
Saves a config and removes the upgrade flag file
func SyncRatioToPercent ¶
When printing sync percents, we should avoid printing 100%. This function is only called if we're still syncing, and the `%0.2f` token will round up if we're above 99.99%.
Types ¶
type Client ¶
type Client struct {
Api *api.ApiRequester
Context *context.HyperdriveContext
}
Hyperdrive client
func NewClientFromCtx ¶
Create new Hyperdrive client from CLI context without checking for sync status Only use this function from commands that may work if the Daemon service doesn't exist Most users should call NewClientFromCtx(c).WithStatus() or NewClientFromCtx(c).WithReady()
func (*Client) DeleteVolume ¶
Deletes a container
func (*Client) GetClientVolumeName ¶
Gets the name of the client volume
func (*Client) GetClientVolumeSource ¶
Gets the absolute file path of the client volume
func (*Client) GetDirSizeViaEcMigrator ¶
func (c *Client) GetDirSizeViaEcMigrator(container string, targetDir string, image string) (uint64, error)
Gets the size of the target directory via the EC migrator for importing, which should have the same permissions as exporting
func (*Client) GetDockerContainerShutdownTime ¶
Get the time that the given container shut down
func (*Client) GetDockerImage ¶
Get the current Docker image used by the given container
func (*Client) GetDockerStatus ¶
Get the current Docker image used by the given container
func (*Client) GetServiceVersion ¶
Get the Hyperdrive service version
func (*Client) GetVolumeSize ¶
Gets the disk usage of the given volume
func (*Client) InstallService ¶
Install Hyperdrive
func (*Client) LoadBackupConfig ¶
func (c *Client) LoadBackupConfig() (*config.HyperdriveConfig, error)
Load the backup config
func (*Client) LoadConfig ¶
func (c *Client) LoadConfig() (*config.HyperdriveConfig, bool, error)
Load the config Returns the RocketPoolConfig and whether or not it was newly generated
func (*Client) PauseService ¶
Pause the Hyperdrive service
func (*Client) PrintServiceCompose ¶
Print the Hyperdrive service compose config
func (*Client) PrintServiceLogs ¶
Print the Hyperdrive service logs
func (*Client) PrintServiceStats ¶
Print the Hyperdrive service stats
func (*Client) PrintServiceStatus ¶
Print the Hyperdrive service status
func (*Client) PurgeData ¶
Deletes the data directory, including the node wallet and all validator keys, and restarts the Docker containers
func (*Client) RemoveContainer ¶
Deletes a container
func (*Client) RestartContainer ¶
Restart a container
func (*Client) RunEcMigrator ¶
func (c *Client) RunEcMigrator(container string, volume string, targetDir string, mode string, image string) error
Runs the EC migrator
func (*Client) RunNethermindPruneStarter ¶
Runs the prune provisioner
func (*Client) RunPruneProvisioner ¶
Runs the prune provisioner
func (*Client) SaveConfig ¶
func (c *Client) SaveConfig(cfg *config.HyperdriveConfig) error
Save the config
func (*Client) StartContainer ¶
Start a container
func (*Client) StartService ¶
Start the Hyperdrive service
func (*Client) StopContainer ¶
Shut down a container
func (*Client) StopService ¶
Stop the Hyperdrive service
func (*Client) TerminateService ¶
Stop Hyperdrive and remove the config folder
func (*Client) UpdateGrafanaDatabaseConfiguration ¶
func (c *Client) UpdateGrafanaDatabaseConfiguration(config *config.HyperdriveConfig) error
Load the Grafana config template, do a template variable substitution, and save it
func (*Client) UpdatePrometheusConfiguration ¶
func (c *Client) UpdatePrometheusConfiguration(config *config.HyperdriveConfig) error
Load the Prometheus config template, do a template variable substitution, and save it