qgbkit

package
v0.0.0-...-2d42763 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package qgbKit is a wrapper around the QGB orchestrator-relayer implementation.

In order to ease the calling of commands like the end user does through CLI, this package is providing easy to use functions for more readability for the test scenario.

To start using the wrapped style CLI, you need to initialise the struct QGBKit. A returned cmd contains functions that returns an output from StdOut pipeline (e.g. like the end user will see in the terminal) as well as errors if something bad happened while executing a command

wrappedCmd := qgbkit.New()

Currently, the way it is used is via creating a validator then attaching an orchestrator to it as a side car. This is similar to how we expect validators to run orchestrators. However, we can opt for different design where we spin up a Celestia network. Then, the we orchestrators start via taking the IP address of a validator along with the private key to its EVM address.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BootstrapperNode

type BootstrapperNode struct {
	P2PID string
	IP    net.IP
}

type QGBKit

type QGBKit struct {
	Home          string
	Cmd           *cobra.Command
	P2PPrivateKey *crypto.PrivKey
	EVMPrivateKey *ecdsa.PrivateKey
	// contains filtered or unexported fields
}

func New

func New(qgbPath string, p2pPrivateKey *crypto.PrivKey, evmPrivateKey *ecdsa.PrivateKey) *QGBKit

New creates a new QGBKit for testground. Note: the provided private keys do not get added automatically to the store. Make sure to add them using the below import helpers before using them.

func (*QGBKit) DeployContract

func (ak *QGBKit) DeployContract(evmAddress, evmPassphrase, evmChainID, evmRPC string) (string, error)

DeployContract deploys the QGB contract and returns its address.

func (*QGBKit) GetHomePath

func (ak *QGBKit) GetHomePath() string

func (*QGBKit) ImportEVMKey

func (ak *QGBKit) ImportEVMKey(service, evmPrivateKey, passphrase string) (string, error)

ImportEVMKey Imports the specified private key to service keystore. A service is either orchestrator, relayer or deployer.

func (*QGBKit) ImportP2PKey

func (ak *QGBKit) ImportP2PKey(service, p2pPrivateKey, nickname string) (string, error)

ImportP2PKey imports a P2P private key to the service keystore. The nickname is the name given to the private key, and the service is the target service: orchestrator, relayer or deployer.

func (*QGBKit) InitService

func (ak *QGBKit) InitService(service string) (string, error)

InitService initializes the storage of a service. A service is either an orchestrator, relayer or deployer.

func (*QGBKit) ListEVMKeys

func (ak *QGBKit) ListEVMKeys(service string) (string, error)

ListEVMKeys Lists the EVM keys in store.

func (*QGBKit) StartOrchestrator

func (ak *QGBKit) StartOrchestrator(evmAddress, evmPassphrase, p2pNickname, bootstrappers string) error

StartOrchestrator starts the orchestrator Set the p2p nickname or the bootstrappers to an empty string not to pass them to the start command.

func (*QGBKit) StartRelayer

func (ak *QGBKit) StartRelayer(evmAddress, evmPassphrase, evmChainID, evmRPC, contractAddr, p2pNickname, bootstrappers string) error

StartRelayer starts the relayer Set the p2p nickname to an empty string not to pass them to the start command.

Jump to

Keyboard shortcuts

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