earthstar-project / earthstar

Storage for private, distributed, offline-first applications.
https://earthstar-project.org
GNU Lesser General Public License v3.0
623 stars 18 forks source link

Discovery APIs, LAN discovery service #320

Closed sgwilym closed 1 year ago

sgwilym commented 1 year ago

What's the problem you solved?

Earthstar has no way of discovering other peers automatically. You have to initiating syncing yourself, e.g. by connecting directly to a known server.

The consequence being that if you are physically present with someone you wish to sync with, you'd likely need a server to be running to do so.

What solution are you recommending?

The two major additions of this PR are:

Peers found with DiscoveryLAN sync using a new PartnerTCP driver. This driver is a little special in that it encrypts all its messages (as we cannot rely on HTTPS to do this for us).

TCP connectivity for both Deno and Node relies on a new TcpProvider class, where implementations have been provided for both runtimes.