3 ms·
Wow, point for point this is what we've built at gun ( https://github.com/amark/gun https://github.com/amark/gun ). - You only store the data you are subscribe
by marknadal 9y ago
Wow, point for point this is what we've built at gun ( https://github.com/amark/gun https://github.com/amark/gun ).
- 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-with-e2e-encryption-f90505b2ff8 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 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 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/index.html#L111-L130 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! :)
- rapnie 9y agothx! i have been following gun for a while.. very interesting project! 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?
- marknadal 9y agoI'm honored!!! Thanks. Yes, the architecture is P2P/decentralized (see this talk https://youtu.be/5fCPRY-9hkc https://youtu.be/5fCPRY-9hkc ), however: - 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 !
- rapnie 9y agogreat! enlightening.. (a mail has been dispatched :)
- rubenverborgh 9y agoJust saw this, and by total coincidence just met with Dmitri this morning. Sending you an email!