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 ¶
- func BuildBridge(ctx context.Context, runenv *runtime.RunEnv, initCtx *run.InitContext) (*nodebuilder.Node, error)
- func BuildValidator(ctx context.Context, runenv *runtime.RunEnv, initCtx *run.InitContext) (*appkit.AppKit, error)
- func GetBandwidthValue(v string) uint64
- func GetBridgeNode(ctx context.Context, syncclient sync.Client, id int64, amountOfBridges int) (*testkit.BridgeNodeInfo, error)
- func GetValidatorInfo(ctx context.Context, syncclient sync.Client, valAmount, id int) (*testkit.AppNodeInfo, error)
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 GetBandwidthValue ¶
func GetBridgeNode ¶
func GetValidatorInfo ¶
Types ¶
This section is empty.