Documentation ¶
Index ¶
- Variables
- func ClosePeers(peers []p2p.Messenger)
- func CreateFixedNetworkOf8Peers() ([]p2p.Messenger, error)
- func CreateMessengerFromConfig(p2pConfig config.P2PConfig) p2p.Messenger
- func CreateMessengerWithKadDht(initialAddr string) p2p.Messenger
- func CreateMessengerWithKadDhtAndProtocolID(initialAddr string, protocolID string) p2p.Messenger
- func CreateMessengerWithNoDiscovery() p2p.Messenger
- func GetConnectableAddress(mes p2p.Messenger) string
- func IsIntInSlice(idx int, slice []int) bool
- func WaitForBootstrapAndShowConnected(peers []p2p.Messenger, durationBootstrapingTime time.Duration)
Constants ¶
This section is empty.
Variables ¶
var P2pBootstrapDelay = 5 * time.Second
P2pBootstrapDelay is used so that nodes have enough time to bootstrap
var TestMarshaller = &marshal.GogoProtoMarshalizer{}
TestMarshaller GogoProtoMarshalizer used for tests
Functions ¶
func ClosePeers ¶
ClosePeers calls Messenger.Close on the provided peers
func CreateFixedNetworkOf8Peers ¶
CreateFixedNetworkOf8Peers assembles a network as following:
0------------------- 1 | | 2 ------------------ 3 ------------------ 4 | | | 5 6 7
func CreateMessengerFromConfig ¶
CreateMessengerFromConfig creates a new libp2p messenger with provided configuration
func CreateMessengerWithKadDht ¶
CreateMessengerWithKadDht creates a new libp2p messenger with kad-dht peer discovery
func CreateMessengerWithKadDhtAndProtocolID ¶
CreateMessengerWithKadDhtAndProtocolID creates a new libp2p messenger with kad-dht peer discovery and peer ID
func CreateMessengerWithNoDiscovery ¶
CreateMessengerWithNoDiscovery creates a new libp2p messenger with no peer discovery
func GetConnectableAddress ¶
GetConnectableAddress returns a non circuit, non windows default connectable address for provided messenger
func IsIntInSlice ¶
IsIntInSlice returns true if idx is found on any position in the provided slice
Types ¶
This section is empty.