Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Direct p2p online sync with WebRTC #296

Open
sgwilym opened this issue Jan 6, 2023 · 1 comment
Open

Direct p2p online sync with WebRTC #296

sgwilym opened this issue Jan 6, 2023 · 1 comment
Labels
completeness enhancement New feature or request figure out help wanted Extra attention is needed

Comments

@sgwilym
Copy link
Contributor

sgwilym commented Jan 6, 2023

What's the problem you want solved?

Earthstar uses servers for syncing over the internet. The servers act as always-online peers which keep a replica of all data themselves. This can be very useful for cases where peers aren't online at the same time, or when the server uses their replica to provide other services.

However, this ties servers to specific shares, and makes it necessary for them to be able to host (possibly large amounts of) data. It also means that users have to host their own servers, which can be difficult.

Is there a solution you'd like to recommend?

I think we should make it possible for servers to act as signalling servers to help peers connect directly to one another. Such servers would not have to host any data, and would be able to serve any Earthstar peers regardless of which shares they're interested in.

This would be conceptually similar to SSB room servers.

This would require at least two components OTOH:

  • A new ISyncPartner implementation which would use WebRTC
  • A new server extension which would help peers connect directly with each other.

I've never done anything with WebRTC or TURN/STUN servers so there's a lot to be figured out, but I think the broad strokes are right.

@sgwilym sgwilym added enhancement New feature or request help wanted Extra attention is needed figure out completeness labels Jan 6, 2023
@sgwilym sgwilym changed the title Direct p2p online sync with room-style servers Direct p2p online sync with WebRTC Jan 18, 2023
@sgwilym
Copy link
Contributor Author

sgwilym commented Jan 18, 2023

This would even be complementary with the existing model of servers as 'always online peers': those servers would also be able to connect to signalling servers and sync over WebRTC.

Then it would be possible to have the best of both worlds:

  • Where users who wanted to sync over the internet wouldn't need to run their own Earthstar servers
  • But also make it possible to have a peer that is always online to sync with.

And a kind of wishlist for the signalling server:

  • Peers should only be connected with other peers interested with at least one share in common.
  • Peers should not have to disclose which shares they are interested in to the server.

Not sure how that'd be achieved just yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completeness enhancement New feature or request figure out help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant