Gerardo Enrique Arriaga Rendon 2c75fbe812
examples/*: Migrate to async await (#2356)
* Adapt examples to async style loop
* Adapt async style loop for chat.rs
* Adapt async style loop for distributed-key-value-store.rs
* Adapt async style loop for gossibsub-chat.rs
* Adapt async style loop for ipfs-private.rs
* Adapt ping to use async
* Update tutorial crate to reflect new changes

Co-authored-by: Max Inden <mail@max-inden.de>
2021-12-06 17:32:58 +01:00
..
2021-08-11 13:12:12 +02:00

Examples

A set of examples showcasing how to use rust-libp2p.

Getting started

  • Ping

    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

  • Chat

    A basic chat application demonstrating libp2p and the mDNS and floodsub protocols.

    • Gossipsub chat

      Same as the chat example but using the Gossipsub protocol.

    • Tokio based chat

      Same as the chat example but using tokio for all asynchronous tasks and I/O.

  • Distributed key-value store

    A basic key value store demonstrating libp2p and the mDNS and Kademlia protocol.

  • IPFS Kademlia

    Demonstrates how to perform Kademlia queries on the IPFS network.

  • IPFS Private

    Implementation using the gossipsub, ping and identify protocols to implement the ipfs private swarms feature.

  • Passive Discovery via MDNS

    Discover peers on the same network via the MDNS protocol.

Integration into a larger application

  • File sharing 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.