upgrade

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: LGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	CurrentNode *dockertest.Resource
	// contains filtered or unexported fields
}

Manager defines a docker pool instance, used to run and interact with evmos node containers. It enables run, query, execute cli commands and purge.

func NewManager

func NewManager(networkName string) (*Manager, error)

NewManager creates new docker pool and network returns Manager instance

func (*Manager) BuildImage

func (m *Manager) BuildImage(name, version, dockerFile, contextDir string, args map[string]string) error

BuildImage build docker image by provided path with <name>:<version> as name target

func (*Manager) Client

func (m *Manager) Client() *docker.Client

Docker client

func (*Manager) ContainerID

func (m *Manager) ContainerID() string

ContainerID returns current running container ID

func (*Manager) CreateDepositProposalExec

func (m *Manager) CreateDepositProposalExec(chainID string) (string, error)

CreateDepositProposalExec creates a gov tx to deposit for the current upgrade proposal

func (*Manager) CreateExec

func (m *Manager) CreateExec(cmd []string, containerID string) (string, error)

CreateExec creates docker exec command for specified container

func (*Manager) CreateSubmitProposalExec

func (m *Manager) CreateSubmitProposalExec(targetVersion, chainID string, upgradeHeight uint) (string, error)

CreateSubmitProposalExec creates a gov tx to submit an upgrade proposal to the chain

func (*Manager) CreateVoteProposalExec

func (m *Manager) CreateVoteProposalExec(chainID string) (string, error)

CreateVoteProposalExec creates gov tx to vote 'yes' on the current upgrade proposal

func (*Manager) ExportState

func (m *Manager) ExportState(targetDir string) error

ExportState executes the 'docker cp' command to copy container .evmosd dir to the specified target dir (local)

See https://docs.docker.com/engine/reference/commandline/cp/

func (*Manager) KillCurrentNode

func (m *Manager) KillCurrentNode() error

func (*Manager) RemoveNetwork

func (m *Manager) RemoveNetwork() error

func (*Manager) RetrieveUpgradesList

func (m *Manager) RetrieveUpgradesList() ([]string, error)

RetrieveUpgradeVersion parses app/upgrades folder and returns slice of semver upgrade versions ascending order, e.g ["v1.0.0", "v1.0.1", "v1.1.0", ... , "v10.0.0"]

func (*Manager) RunExec

func (m *Manager) RunExec(ctx context.Context, exec string) (outBuf bytes.Buffer, errBuf bytes.Buffer, err error)

RunExec runs the provided docker exec call

func (*Manager) RunNode

func (m *Manager) RunNode(node *Node) error

RunNode create docker container from provided node instance and run it. Retry to get node JRPC server for 60 seconds to make sure node started properly. On node start error returns container logs.

func (*Manager) WaitForHeight

func (m *Manager) WaitForHeight(ctx context.Context, height int) error

WaitForHeight query evmos node every second until node will reach specified height for 5 minutes, after time exceed returns error

type Node

type Node struct {
	RunOptions *dockertest.RunOptions
	// contains filtered or unexported fields
}

Node defines evmos node params for running container of specific version with custom docker run arguments

func NewNode

func NewNode(repository, version string) *Node

NewNode creates new instance of the node and setups default dockertest RunOptions

func (*Node) Mount

func (n *Node) Mount(mountPath string)

Mount sets the container mount point, which is used as the value for 'docker run --volume'

See https://docs.docker.com/engine/reference/builder/#volume

func (*Node) SetCmd

func (n *Node) SetCmd(cmd []string)

SetCmd sets the container entry command and overrides the image CMD instruction

See https://docs.docker.com/engine/reference/builder/#cmd

func (*Node) SetEnvVars

func (n *Node) SetEnvVars(vars []string)

SetEnvVars allows to set addition container environment variables in format []string{ "VAR_NAME=valaue" }

func (*Node) UseRunOptions

func (n *Node) UseRunOptions()

UseRunOptions sets a flag to allow the node Manager to run the container with additional run options

Jump to

Keyboard shortcuts

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