common

package
v0.0.0-...-e111e73 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 18 Imported by: 4

Documentation

Overview

Package common is a helper around redundant creation of Network, App and Node part

As testground doesn't have native support of uint64 conversion from .toml files, GetBandwidthValue in network.go is used to adjust the bandwidth per instance for each of the test-case

In order to eliminate the boilerplate code of creating a validators' set, please use `common.BuildValidator`. This Func does: - InitChain - Add-Gen-Account - Collect-GenTxs - Add-Persistent-Peers In addition, the func returns initialized cobra cmd, so you can continue operating with the validator

Default: network.LinkShape{
	Bandwidth: common.GetBandwidthValue(runenv.StringParam("bandwidth")),
}

appcmd, err := common.BuildValidator(ctx, runenv, initCtx) appcmd.PayForData(...)

In order to eliminate the boilerplate code of creating a bridge node, please use `common.BuildBridge`. This Func does: - Listens to all available validators - Connects to the validator (match is done using group sequence) - Sends the genesis hash to the topic - - As well as it's multiaddress - Returns the node pointer itself

nd, err := common.BuildBridge(ctx, runenv, initCtx) nd.Stop()

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildBridge

func BuildBridge(ctx context.Context, runenv *runtime.RunEnv, initCtx *run.InitContext) (*nodebuilder.Node, error)

func BuildValidator

func BuildValidator(ctx context.Context, runenv *runtime.RunEnv, initCtx *run.InitContext) (*appkit.AppKit, error)

func GetBandwidthValue

func GetBandwidthValue(v string) uint64

func GetBridgeNode

func GetBridgeNode(ctx context.Context, syncclient sync.Client, id int64, amountOfBridges int) (*testkit.BridgeNodeInfo, error)

func GetValidatorInfo

func GetValidatorInfo(ctx context.Context, syncclient sync.Client, valAmount, id int) (*testkit.AppNodeInfo, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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