nodeutils

package
v1.38.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UpgradeScheduled = "scheduled"

	ManualUpgrade  UpgradeSource = "manual"
	OnChainUpgrade UpgradeSource = "on-chain"

	UpgradeInfoFile = "upgrade-info.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(host string) *Client

func (*Client) GetDataSize

func (c *Client) GetDataSize() (int64, error)

func (*Client) GetLatestHeight

func (c *Client) GetLatestHeight() (int64, error)

func (*Client) ListSnapshots

func (c *Client) ListSnapshots() ([]int64, error)

func (*Client) RequiresUpgrade

func (c *Client) RequiresUpgrade() (bool, error)

func (*Client) ShutdownNodeUtilsServer

func (c *Client) ShutdownNodeUtilsServer() error

type NodeUtils

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

func New

func New(nodeBinaryName string, opts ...Option) (*NodeUtils, error)

func (*NodeUtils) Start

func (s *NodeUtils) Start() error

func (*NodeUtils) Stop

func (s *NodeUtils) Stop(force bool) error

func (*NodeUtils) StopNode

func (s *NodeUtils) StopNode() error

type Option

type Option func(*Options)

func CreateFifo

func CreateFifo(create bool) Option

func WithBlockThreshold

func WithBlockThreshold(n time.Duration) Option

func WithDataPath

func WithDataPath(path string) Option

func WithHost

func WithHost(s string) Option

func WithPort

func WithPort(v int) Option

func WithTmkmsProxy

func WithTmkmsProxy(enable bool) Option

func WithTraceStore

func WithTraceStore(path string) Option

func WithUpgradesConfig

func WithUpgradesConfig(path string) Option

type Options

type Options struct {
	Host           string
	Port           int
	DataPath       string
	BlockThreshold time.Duration
	UpgradesConfig string
	TraceStore     string
	CreateFifo     bool
	TmkmsProxy     bool
}

type Upgrade

type Upgrade struct {
	Height int64         `json:"height"`
	Status string        `json:"status"`
	Image  string        `json:"image"`
	Source UpgradeSource `json:"source"`
}

type UpgradeChecker

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

func NewUpgradeChecker

func NewUpgradeChecker(configFile string) (*UpgradeChecker, error)

func (*UpgradeChecker) GetUpgrade

func (u *UpgradeChecker) GetUpgrade(height int64) (*Upgrade, error)

func (*UpgradeChecker) ShouldUpgrade

func (u *UpgradeChecker) ShouldUpgrade(height int64) bool

func (*UpgradeChecker) WatchConfigFile

func (u *UpgradeChecker) WatchConfigFile() error

type UpgradeSource

type UpgradeSource string

type UpgradesConfig

type UpgradesConfig struct {
	Upgrades []Upgrade `json:"upgrades"`
}

Jump to

Keyboard shortcuts

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