Documentation ¶
Overview ¶
Package appkit is a wrapper around the App Client and Cosmos's Server cmds
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 AppKit. 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
Other functionality in appkit is an easy-to-modify values in .toml(e.g. config.toml) This can help the test user to modify what is needed for a scenario without a boilerplate code from viper
Last but not least is the REST API calls. Appkit takes care of all boilerplate code for doing simple http requests
wrappedCmd := appkit.New() output, err := wrappedCmd.InitChain("moniker", "test-chain", "/path/to/store") err = appkit.ChangeNodeMode("/path/to/config.toml", "seed") hash, err = appkit.GetBlockByHeight(net.Parse("127.0.0.1"), 10)
Index ¶
- func AddPersistentPeers(path string, peers []string) error
- func AddSeedPeers(path string, peers []string) error
- func ChangeConfigParam(path, section, mode string, value interface{}) error
- func ChangeRPCServerAddress(path string, ip net.IP) error
- func GetBlockHashByHeight(ip net.IP, height int) (string, error)
- func GetLatestsBlockSize(ip net.IP) (int, error)
- type AppKit
- func (ak *AppKit) AddGenAccount(addr, amount string) (string, error)
- func (ak *AppKit) CollectGenTxs() (string, error)
- func (ak *AppKit) CreateKey(name, krbackend, krpath string) (string, error)
- func (ak *AppKit) FundAccounts(accAdr, amount, krbackend, krpath string, accAddrs ...string) error
- func (ak *AppKit) GetHomePath() string
- func (ak *AppKit) GetNodeId() (string, error)
- func (ak *AppKit) InitChain(moniker string) (string, error)
- func (ak *AppKit) PayForData(accAdr string, msg int, krbackend, krpath string) error
- func (ak *AppKit) SignGenTx(accName, amount, krbackend, krpath string) (string, error)
- func (ak *AppKit) StartNode(loglvl string) error
- type ValidatorNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddPersistentPeers ¶
AddPersistentPeers modifies the respective field in the config.toml to allow the peer to always connect to a set of defined peers
func AddSeedPeers ¶
func ChangeConfigParam ¶
Types ¶
type AppKit ¶
type AppKit struct { AccountAddress string ChainId string Cmd *cobra.Command // contains filtered or unexported fields }