service

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: BSD-3-Clause Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const RapidRelayerVersionFallback = "v1.0.7"

RapidRelayerVersionFallback is the fallback docker image tag used for the rapid relayer when fetching the latest version from GitHub fails.

Variables

View Source
var (
	LinuxTemplateMap = map[CommandName]Template{
		UpgradableInitia:    LinuxRunUpgradableCosmovisorTemplate,
		NonUpgradableInitia: LinuxRunNonUpgradableCosmovisorTemplate,
		Minitia:             LinuxRunMinitiaBinaryTemplate,
		OPinitExecutor:      LinuxOPinitBotTemplate,
		OPinitChallenger:    LinuxOPinitBotTemplate,
		Relayer:             LinuxRelayerTemplate,
	}
	DarwinTemplateMap = map[CommandName]Template{
		UpgradableInitia:    DarwinRunUpgradableCosmovisorTemplate,
		NonUpgradableInitia: DarwinRunNonUpgradableCosmovisorTemplate,
		Minitia:             DarwinRunBinaryTemplate,
		OPinitExecutor:      DarwinOPinitBotTemplate,
		OPinitChallenger:    DarwinOPinitBotTemplate,
		Relayer:             DarwinRelayerTemplate,
	}
)

Functions

func GetRapidRelayerVersion added in v0.3.4

func GetRapidRelayerVersion() string

GetRapidRelayerVersion fetches the latest rapid relayer version from GitHub. Falls back to RapidRelayerVersionFallback if the fetch fails.

func NonDetachStart

func NonDetachStart(s Service, optionalArgs ...string) error

Types

type CommandName

type CommandName string
const (
	UpgradableInitia    CommandName = "upgradable_initia"
	NonUpgradableInitia CommandName = "non_upgradable_initia"
	Minitia             CommandName = "minitia"
	OPinitExecutor      CommandName = "executor"
	OPinitChallenger    CommandName = "challenger"
	Relayer             CommandName = "relayer"
	Rollytics           CommandName = "rollytics"
)

func (CommandName) GetBinaryName

func (cmd CommandName) GetBinaryName() (string, error)

func (CommandName) GetInitCommand added in v0.1.2

func (cmd CommandName) GetInitCommand() (string, error)

func (CommandName) GetPrettyName added in v0.1.2

func (cmd CommandName) GetPrettyName() (string, error)

func (CommandName) GetServiceSlug

func (cmd CommandName) GetServiceSlug() (string, error)

type Docker added in v0.3.4

type Docker struct {
	// contains filtered or unexported fields
}

func NewDocker added in v0.3.4

func NewDocker(commandName CommandName, vmType string) *Docker

func (*Docker) Create added in v0.3.4

func (d *Docker) Create(version, appHome string) error

func (*Docker) GetServiceBinaryAndHome added in v0.3.4

func (d *Docker) GetServiceBinaryAndHome() (string, string, error)

func (*Docker) GetServiceFile added in v0.3.4

func (d *Docker) GetServiceFile() (string, error)

func (*Docker) GetServiceName added in v0.3.4

func (d *Docker) GetServiceName() (string, error)

func (*Docker) Log added in v0.3.4

func (d *Docker) Log(n int) error

func (*Docker) PruneLogs added in v0.3.4

func (d *Docker) PruneLogs() error

func (*Docker) RemoveVolume added in v0.3.4

func (d *Docker) RemoveVolume() error

RemoveVolume removes the Docker volume associated with this service This is useful for complete cleanup and should be called separately from Stop

func (*Docker) Restart added in v0.3.4

func (d *Docker) Restart() error

func (*Docker) Start added in v0.3.4

func (d *Docker) Start(optionalArgs ...string) error

func (*Docker) Stop added in v0.3.4

func (d *Docker) Stop() error

type Launchd

type Launchd struct {
	// contains filtered or unexported fields
}

func NewLaunchd

func NewLaunchd(commandName CommandName) *Launchd

func (*Launchd) Create

func (j *Launchd) Create(binaryVersion, appHome string) error

func (*Launchd) GetCommandName

func (j *Launchd) GetCommandName() string

func (*Launchd) GetServiceBinaryAndHome added in v0.1.2

func (j *Launchd) GetServiceBinaryAndHome() (string, string, error)

func (*Launchd) GetServiceFile added in v0.1.2

func (j *Launchd) GetServiceFile() (string, error)

func (*Launchd) GetServiceName

func (j *Launchd) GetServiceName() (string, error)

func (*Launchd) Log

func (j *Launchd) Log(n int) error

func (*Launchd) PruneLogs

func (j *Launchd) PruneLogs() error

func (*Launchd) Restart

func (j *Launchd) Restart() error

func (*Launchd) Start

func (j *Launchd) Start(optionalArgs ...string) error

func (*Launchd) Stop

func (j *Launchd) Stop() error

type Plist added in v0.1.2

type Plist struct {
	ProgramArguments           []string `xml:"dict>array>string"`
	EnvironmentVariablesKeys   []string `xml:"dict>dict>key"`
	EnvironmentVariablesValues []string `xml:"dict>dict>string"`
}

type Service

type Service interface {
	Create(binaryVersion, appHome string) error
	Log(n int) error
	Start(optionalArgs ...string) error
	Stop() error
	Restart() error
	PruneLogs() error

	GetServiceFile() (string, error)
	GetServiceBinaryAndHome() (string, string, error)
}

func NewService

func NewService(commandName CommandName, vmType string) (Service, error)

type Systemd

type Systemd struct {
	// contains filtered or unexported fields
}

func NewSystemd

func NewSystemd(commandName CommandName) *Systemd

func (*Systemd) Create

func (j *Systemd) Create(binaryVersion, appHome string) error

func (*Systemd) GetCommandName

func (j *Systemd) GetCommandName() string

func (*Systemd) GetServiceBinaryAndHome added in v0.1.2

func (j *Systemd) GetServiceBinaryAndHome() (string, string, error)

func (*Systemd) GetServiceFile added in v0.1.2

func (j *Systemd) GetServiceFile() (string, error)

func (*Systemd) GetServiceName

func (j *Systemd) GetServiceName() (string, error)

func (*Systemd) Log

func (j *Systemd) Log(n int) error

func (*Systemd) PruneLogs

func (j *Systemd) PruneLogs() error

func (*Systemd) Restart

func (j *Systemd) Restart() error

func (*Systemd) Start

func (j *Systemd) Start(optionalArgs ...string) error

func (*Systemd) Stop

func (j *Systemd) Stop() error

type Template

type Template string
const DarwinOPinitBotTemplate Template = `` /* 958-byte string literal not displayed */

DarwinOPinitBotTemplate should inject the arguments as follows: [binaryName, binaryPath, appHome, userHome, weaveLogPath, serviceName]

const DarwinRelayerTemplate Template = `` /* 883-byte string literal not displayed */

DarwinRelayerTemplate should inject the arguments as follows: [binaryName, binaryPath, appHome, userHome, weaveLogPath, serviceName]

const DarwinRunBinaryTemplate Template = `` /* 989-byte string literal not displayed */

DarwinRunBinaryTemplate should inject the arguments as follows: [1:binaryName, 2:binaryPath, 3:appHome, 4:userHome, 5:weaveLogPath, 6:serviceName]

const DarwinRunNonUpgradableCosmovisorTemplate Template = `` /* 1286-byte string literal not displayed */

DarwinRunNonUpgradableCosmovisorTemplate should inject the arguments as follows: [1:binaryName, 2:binaryPath, 3:appHome, 4:userHome, 5:weaveLogPath, 6:serviceName]

const DarwinRunUpgradableCosmovisorTemplate Template = `` /* 1284-byte string literal not displayed */

DarwinRunUpgradableCosmovisorTemplate should inject the arguments as follows: [1:binaryName, 2:binaryPath, 3:appHome, 4:userHome, 5:weaveLogPath, 6:serviceName]

const LinuxOPinitBotTemplate Template = `` /* 236-byte string literal not displayed */

LinuxOPinitBotTemplate should inject the arguments as follows: [binaryName, binaryPath, serviceName, appHome]

const LinuxRelayerTemplate Template = `` /* 175-byte string literal not displayed */

LinuxRelayerTemplate should inject the arguments as follows: [binaryName, binaryPath, serviceName, appHome]

const LinuxRunMinitiaBinaryTemplate Template = `` /* 224-byte string literal not displayed */

LinuxRunMinitiaBinaryTemplate should inject the arguments as follows: [binaryName, binaryPath, serviceName, appHome]

const LinuxRunNonUpgradableCosmovisorTemplate Template = `` /* 401-byte string literal not displayed */

LinuxRunNonUpgradableCosmovisorTemplate should inject the arguments as follows: [binaryName, binaryPath, serviceName, appHome]

const LinuxRunUpgradableCosmovisorTemplate Template = `` /* 399-byte string literal not displayed */

LinuxRunUpgradableCosmovisorTemplate should inject the arguments as follows: [binaryName, binaryPath, serviceName, appHome, UserField]

Jump to

Keyboard shortcuts

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