but its decentralization features are not all too clear to me (have to dive deeper). things like peer discovery, nat traversal, gossiping, etc.
does that come with the package?
- NAT Traversal sucks and WebRTC is still very glitchy. To get around this, it is easier/better to just run gun on your machine directly (not via a browser) and connect directly to other gun peers with their IP addresses. Then browsers can connect via websocket fallback, but as WebRTC gets better that will work too.
- Peer discovery is not built in by default, but should be trivial to do by starting with some bootstrapping peers, which as other peers connect to them everybody saves the new IP addresses to a common `gun.get('peers').set(IP)` table. So yes, it is easily possible, just not built in (I'm sure in the future we'll have a full fledged extension for it).
- re:"gossip" GUN automatically daisy chains updates through peers of peers, in an ad-hoc mesh-network manner.
Would love to chat more! What is your email? Mine is mark [atatatat] gunDB [dotdotdot] io !
- You only store the data you are subscribed to, which if it is your data, it is automatically stored in localStorage and if you run a Electron/React-Native app, is also backed up on your harddrive, and optionally you can have it backup to any server you run. This is particularly true with the P2P identity system: https://hackernoon.com/so-you-want-to-build-a-p2p-twitter-wi...
- This data can only be decrypted by the app if the user happens to use that app. The app doesn't have any special server, it is just some front-end logic, for instance, see this 4min interactive tutorial: https://scrimba.com/c/c2gBgt4
- The interface literally is just query, where that query is represented in HTML (or GraphQL at https://github.com/brysgo/graphql-gun ) with automatic 2-way binding based off of `name` attributes, like so: https://github.com/amark/gun/blob/master/examples/contact/in...
Ruben, if you happen to see this shoot me an email (check my HN profile)! I also know Dmitri as well! Great article! :)