amark / gun

An open source cybersecurity protocol for syncing decentralized graph data.
https://gun.eco/docs
Other
18.03k stars 1.16k forks source link

how does the peer-2-peer networking works? #1273

Closed Michel-HEG closed 1 year ago

Michel-HEG commented 2 years ago

hello i'm a student from switzerland and i'm doing my final school thesis before graduation using gun.js. how does the p2p works with websocket and all, how the networking is done? thank you very much for your answer.

p.s: i love gun!

TerranFenrir commented 2 years ago

Hey there! Gun uses something known as "WebRTC", which ensures P2P data transfer using the UDP protocol. Hence, to understand the networking process, I would recommend learning more about WebRTC.

draeder commented 2 years ago

Gun relay servers use Multicast locally, followed by websockets to connect to other relay servers and browsers, then optionally WebRTC with and between browsers.

amark commented 1 year ago

👏 @Zevenstreity 👏 @draeder

@Michel-HEG there are 3 different layers, DAM, GUN, AXE - each evolve the networking algorithms a little bit, but are compatible with each other. Docs have a variety of explanations (mostly copied from answering Qs via chat), but I can probably give faster & more up-to-date explanation on a call, will you DM me on twitter and we'll schedule a podcast to discuss it? Some of the podcasts recorded in the last 6 months also explain pieces too, but I'd have to dig up their links...

Gonna close (as not a bug). DM me! Then when we're done, paste those old links, or the new one we record, here, so others can find it.