testing

package
v1.3.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateShares

func CreateShares(n int) []*bls.SecretKey

CreateShares creates n shares

func RandomTCPPort

func RandomTCPPort(from, to int) int

RandomTCPPort returns a new random tcp port

Types

type NetworkFactory

type NetworkFactory func(pctx context.Context, nodeIndex int, keys NodeKeys) network.P2PNetwork

NetworkFactory is a generic factory for network instances

type NodeKeys

type NodeKeys struct {
	NetKey      *ecdsa.PrivateKey
	OperatorKey *rsa.PrivateKey
}

NodeKeys holds node's keys

func CreateKeys

func CreateKeys(n int) ([]NodeKeys, error)

CreateKeys creates <n> random node keys

func NewLocalTestnet added in v1.1.0

func NewLocalTestnet(ctx context.Context, n int, factory NetworkFactory) ([]network.P2PNetwork, []NodeKeys, error)

NewLocalTestnet creates a new local network

type UDPPortsRandomizer

type UDPPortsRandomizer map[int]bool

UDPPortsRandomizer helps to generate random, available udp ports

func (UDPPortsRandomizer) Next

func (up UDPPortsRandomizer) Next(from, to int) int

Next generates a new random port that is available

Jump to

Keyboard shortcuts

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