testing

package
v0.2.0-rc Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 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, 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 NewLocalNetwork

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

NewLocalNetwork 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