Over the last few years, due in large part to the hype surrounding blockchain and cryptocurrencies, decentralized applications have gained quite a bit of momentum. Another factor behind the surging interest in decentralization is greater awareness around the downsides of putting most of the web in the hands of a small cadre of companies in terms of data privacy and monopolization.

In any case, there have been some very interesting developments in the decentralized software scene recently, even aside from all the crypto and blockchain technology.

Notable examples include IPFS; the brand new, distributed coding platform Radicle; the decentralized social network Scuttlebutt; and many more applications within the Fediverse, such as Mastodon.

In this tutorial, we’ll show you how to build a very simple peer-to-peer application using Rust and the fantastic libp2p library, which exists in different stages of maturity for a wide range of languages.

We’re going to build a cooking recipe app with a simple command-line interface that enables us to:

  • Create recipes
  • Publish recipes
  • List local recipes
  • List other peers we discovered on the network
  • List published recipes of a given peer
  • List all recipes of all peers we know

We’ll do this all in around 300 lines of Rust. Let’s get started!

#rust #programming #developer #web-development

libp2p Tutorial: Build a peer-to-peer app in Rust
9.10 GEEK