# Functions
EnablePeerScoringWithOverride enables peer scoring for the GossipSub pubsub system with the given override.
EnsureNoPubsubExchangeBetweenGroups ensures that no pubsub message is exchanged between the given groups of nodes.
EnsureNoPubsubMessageExchange ensures that the no pubsub message is exchanged "from" the given nodes "to" the given nodes.
EnsureNotConnectedBetweenGroups ensures no connection exists between the given groups of nodes.
EnsurePubsubMessageExchange ensures that the given connected nodes exchange the given message on the given channel through pubsub.
EnsurePubsubMessageExchangeFromNode ensures that the given node exchanges the given message on the given channel through pubsub with the other nodes.
EnsureStreamCreationInBothDirections ensure that between each pair of nodes in the given list, a stream is created in both directions.
GossipSubCtrlFixture returns a ControlMessage with the given options.
GossipSubMessageFixture returns a random gossipSub message; this contains a single pubsub message that is exchanged between nodes.
GossipSubMessageIdsFixture returns a slice of random gossipSub message IDs of the given size.
GossipSubRpcFixture returns a random GossipSub RPC message.
GossipSubRpcFixtures returns a slice of random message IDs for testing.
GossipSubTopicIdFixture returns a random gossipSub topic ID.
LetNodesDiscoverEachOther connects all nodes to each other on the pubsub mesh.
NetworkingKeyFixtures is a test helper that generates a ECDSA flow key pair.
NewConnectionGater creates a new connection gater for testing with given allow listing filter.
No description provided by the author
No description provided by the author
NodeFixture is a test fixture that creates a single libp2p node with the given key, spork id, and options.
NodesFixture is a test fixture that creates a number of libp2p nodes with the given callback function for stream handling.
No description provided by the author
No description provided by the author
PeerIdSliceFixture returns a slice of random peer IDs for testing.
PeerManagerConfigFixture is a test fixture that sets the default config for the peer manager.
PubsubMessageFixture is a test helper that returns a random pubsub message with the given options applied.
RegisterPeerProviders registers the peer provider for all the nodes in the input slice.
RequireConnectedEventually ensures eventually that the given nodes are already connected to each other.
RequireEventuallyNotConnected ensures eventually that the given groups of nodes are not connected to each other.
StartNode start a single node using the provided context, timing out if nodes are not all Ready() before duration expires, (i.e., 2 seconds).
StartNodes start all nodes in the input slice using the provided context, timing out if nodes are not all Ready() before duration expires.
StopNode stops a single node using the provided cancel func, timing out if nodes are not all Done() before duration expires, (i.e., 2 seconds).
StopNodes stops all nodes in the input slice using the provided cancel func, timing out if nodes are not all Done() before duration expires (i.e., 5 seconds).
StreamHandlerFixture returns a stream handler that writes the received message to the given channel.
TryConnectionAndEnsureConnected tries connecting nodes to each other and ensures that the given nodes are connected to each other.
No description provided by the author
No description provided by the author
WithDefaultResourceManager sets the resource manager to nil, which will cause the node to use the default resource manager.
No description provided by the author
No description provided by the author
WithFrom is a test helper that returns a function that sets the from field of a pubsub message to the given peer id.
WithGraft adds GRAFT control messages with given topicID to the control message.
WithGrafts adds a GRAFT control message with each given topicID to the control message.
WithIHave adds iHave control messages of the given size and number to the control message.
WithIHaveMessageIDs adds iHave control messages with the given message IDs to the control message.
WithIWant adds iWant control messages of the given size and number to the control message.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
WithoutSignature is a test helper that returns a function that sets the signature of a pubsub message to nil, effectively removing the signature.
WithoutSignerId is a test helper that returns a function that sets the from field of a pubsub message to nil, effectively removing the signer id.
No description provided by the author
No description provided by the author
No description provided by the author
WithPrune adds PRUNE control messages with given topicID to the control message.
WithPrunes adds a PRUNE control message with each given topicID to the control message.
WithResourceManager sets the resource manager to the provided resource manager.
No description provided by the author
WithTopic is a test helper that returns a function that sets the topic of a pubsub message to the given topic.
No description provided by the author
No description provided by the author
WithZeroJitterAndZeroBackoff is a test fixture that sets the default config for the peer manager.
# Structs
MockStream is a mocked libp2p stream that is implemented as a pipe with a reader and writer.
No description provided by the author
UpdatableTopicProviderFixture is a mock implementation of the TopicProvider interface.
# Type aliases
No description provided by the author
No description provided by the author