testing

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 11 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 keys.OperatorPrivateKey
}

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