runner

package
v0.1.4-202309124022-mf... Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrChainAlreadyExists = errors.New("chain already exists")
)

Functions

This section is empty.

Types

type ChainDetails

type ChainDetails struct {
	RpcUrl    string
	GrpcUrl   string
	EvmRpcUrl string

	ChainId      string
	StakingDenom string
}

ChainDetails wraps information about the properties & endpoints of a chain.

func (ChainDetails) EvmClient

func (c ChainDetails) EvmClient() (*ethclient.Client, error)

EvmClient dials the underlying EVM RPC url and returns an ethclient.

func (ChainDetails) GrpcConn

func (c ChainDetails) GrpcConn() (*grpc.ClientConn, error)

GrpcConn creates a new connection to the underlying Grpc url.

type Chains

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

Chains wraps a map of name -> details about how to connect to a chain. It prevents registering multiple chains with the same name & encapsulates panicking if attempting to access a chain that does not exist.

func NewChains

func NewChains() Chains

NewChains creates an empty Chains map.

func (Chains) MustGetChain

func (c Chains) MustGetChain(name string) *ChainDetails

MustGetChain returns the chain of a given name, or panics if a chain with that name has not been registered.

func (*Chains) Register

func (c *Chains) Register(name string, chain *ChainDetails) error

Register adds a chain to the map. It returns an error if a ChainDetails with that name has already been registered.

type FutoolRunner

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

FutoolRunner implements a NodeRunner that spins up local chains with futool. It has support for the following: - running a Fury node - optionally, running an IBC node with a channel opened to the Fury node - optionally, start the Fury node on one version and upgrade to another

func NewFutoolRunner

func NewFutoolRunner(config FutoolRunnerConfig) *FutoolRunner

NewFutoolRunner creates a new FutoolRunner.

func (*FutoolRunner) Shutdown

func (k *FutoolRunner) Shutdown()

Shutdown implements NodeRunner. For FutoolRunner, it shuts down the local futool network. To prevent shutting down the chain (eg. to preserve logs or examine post-test state) use the `SkipShutdown` option on the config.

func (*FutoolRunner) StartChains

func (k *FutoolRunner) StartChains() Chains

StartChains implements NodeRunner. For FutoolRunner, it sets up, runs, and connects to a local chain via futool.

type FutoolRunnerConfig

type FutoolRunnerConfig struct {
	FuryConfigTemplate string

	ImageTag   string
	IncludeIBC bool

	EnableAutomatedUpgrade  bool
	FuryUpgradeName         string
	FuryUpgradeHeight       int64
	FuryUpgradeBaseImageTag string

	SkipShutdown bool
}

type LiveNodeRunner

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

LiveNodeRunner implements NodeRunner for an already-running chain. If a LiveNodeRunner is used, end-to-end tests are run against a live chain.

func NewLiveNodeRunner

func NewLiveNodeRunner(config LiveNodeRunnerConfig) *LiveNodeRunner

NewLiveNodeRunner creates a new LiveNodeRunner.

func (LiveNodeRunner) Shutdown

func (LiveNodeRunner) Shutdown()

Shutdown implements NodeRunner. As the chains are externally operated, this is a no-op.

func (LiveNodeRunner) StartChains

func (r LiveNodeRunner) StartChains() Chains

StartChains implements NodeRunner. It initializes connections to the chain based on parameters. It attempts to ping the necessary endpoints and panics if they cannot be reached.

type LiveNodeRunnerConfig

type LiveNodeRunnerConfig struct {
	FuryRpcUrl    string
	FuryGrpcUrl   string
	FuryEvmRpcUrl string
}

LiveNodeRunnerConfig implements NodeRunner. It connects to a running network via the RPC, GRPC, and EVM urls.

type NodeRunner

type NodeRunner interface {
	StartChains() Chains
	Shutdown()
}

NodeRunner is responsible for starting and managing docker containers to run a node.

Jump to

Keyboard shortcuts

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