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 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 NmtoolRunner ¶ added in v0.1.3
type NmtoolRunner struct {
// contains filtered or unexported fields
}
NmtoolRunner implements a NodeRunner that spins up local chains with nmtool. It has support for the following: - running a Nemo node - optionally, running an IBC node with a channel opened to the Nemo node - optionally, start the Nemo node on one version and upgrade to another
func NewNmtoolRunner ¶ added in v0.1.3
func NewNmtoolRunner(config NmtoolRunnerConfig) *NmtoolRunner
NewNmtoolRunner creates a new NmtoolRunner.
func (*NmtoolRunner) Shutdown ¶ added in v0.1.3
func (k *NmtoolRunner) Shutdown()
Shutdown implements NodeRunner. For NmtoolRunner, it shuts down the local nmtool network. To prevent shutting down the chain (eg. to preserve logs or examine post-test state) use the `SkipShutdown` option on the config.
func (*NmtoolRunner) StartChains ¶ added in v0.1.3
func (k *NmtoolRunner) StartChains() Chains
StartChains implements NodeRunner. For NmtoolRunner, it sets up, runs, and connects to a local chain via nmtool.
type NmtoolRunnerConfig ¶ added in v0.1.3
type NodeRunner ¶
type NodeRunner interface { StartChains() Chains Shutdown() }
NodeRunner is responsible for starting and managing docker containers to run a node.