integrationTests

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var P2pBootstrapDelay = 5 * time.Second

P2pBootstrapDelay is used so that nodes have enough time to bootstrap

View Source
var TestMarshaller = &marshal.GogoProtoMarshalizer{}

TestMarshaller GogoProtoMarshalizer used for tests

Functions

func ClosePeers added in v1.0.1

func ClosePeers(peers []p2p.Messenger)

ClosePeers calls Messenger.Close on the provided peers

func CreateFixedNetworkOf8Peers added in v1.0.1

func CreateFixedNetworkOf8Peers() ([]p2p.Messenger, error)

CreateFixedNetworkOf8Peers assembles a network as following:

                     0------------------- 1
                     |                    |
2 ------------------ 3 ------------------ 4
|                    |                    |
5                    6                    7

func CreateMessengerFromConfig added in v1.0.1

func CreateMessengerFromConfig(p2pConfig config.P2PConfig) p2p.Messenger

CreateMessengerFromConfig creates a new libp2p messenger with provided configuration

func CreateMessengerWithKadDht

func CreateMessengerWithKadDht(initialAddr string) p2p.Messenger

CreateMessengerWithKadDht creates a new libp2p messenger with kad-dht peer discovery

func CreateMessengerWithKadDhtAndProtocolID added in v1.0.1

func CreateMessengerWithKadDhtAndProtocolID(initialAddr string, protocolID string) p2p.Messenger

CreateMessengerWithKadDhtAndProtocolID creates a new libp2p messenger with kad-dht peer discovery and peer ID

func CreateMessengerWithNoDiscovery added in v1.0.1

func CreateMessengerWithNoDiscovery() p2p.Messenger

CreateMessengerWithNoDiscovery creates a new libp2p messenger with no peer discovery

func GetConnectableAddress

func GetConnectableAddress(mes p2p.Messenger) string

GetConnectableAddress returns a non circuit, non windows default connectable address for provided messenger

func IsIntInSlice added in v1.0.1

func IsIntInSlice(idx int, slice []int) bool

IsIntInSlice returns true if idx is found on any position in the provided slice

func WaitForBootstrapAndShowConnected

func WaitForBootstrapAndShowConnected(peers []p2p.Messenger, durationBootstrapingTime time.Duration)

WaitForBootstrapAndShowConnected will delay a given duration in order to wait for bootstraping and print the number of peers that each node is connected to

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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