Concurrently dial address candidates within a single dial attempt. Main motivation for this feature is to increase success rate on hole punching (see https://github.com/libp2p/rust-libp2p/issues/1896#issuecomment-885894496 for details). Though, as a nice side effect, as one would expect, it does improve connection establishment time. Cleanups and fixes done along the way: - Merge `pool.rs` and `manager.rs`. - Instead of manually implementing state machines in `task.rs` use `async/await`. - Fix bug where `NetworkBehaviour::inject_connection_closed` is called without a previous `NetworkBehaviour::inject_connection_established` (see https://github.com/libp2p/rust-libp2p/issues/2242). - Return handler to behaviour on incoming connection limit error. Missed in https://github.com/libp2p/rust-libp2p/issues/2242.
Examples
A set of examples showcasing how to use rust-libp2p.
Getting started
-
Small
ping
clone, sending a ping to a peer, expecting a pong as a response. See tutorial for a step-by-step guide building the example.
Individual libp2p protocols
-
A basic chat application demonstrating libp2p and the mDNS and floodsub protocols.
-
Same as the chat example but using the Gossipsub protocol.
-
Same as the chat example but using tokio for all asynchronous tasks and I/O.
-
-
A basic key value store demonstrating libp2p and the mDNS and Kademlia protocol.
-
Demonstrates how to perform Kademlia queries on the IPFS network.
-
Implementation using the gossipsub, ping and identify protocols to implement the ipfs private swarms feature.
-
Discover peers on the same network via the MDNS protocol.
Integration into a larger application
-
Basic file sharing application with peers either providing or locating and getting files by name.
While obviously showcasing how to build a basic file sharing application with the Kademlia and Request-Response protocol, the actual goal of this example is to show how to integrate rust-libp2p into a larger application.