Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 (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.
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 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 ¶
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.