Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 03 11:56
    Emad-salah commented #1170
  • Dec 03 11:50
    Emad-salah synchronize #1170
  • Dec 03 03:20
    aethiop closed #1163
  • Dec 03 02:39
    amark commented #1167
  • Dec 03 02:39

    amark on master

    make change to lib/unset.js (#1… (compare)

  • Dec 03 02:39
    amark closed #1167
  • Dec 03 02:37
    amark commented #1163
  • Dec 03 02:35
    amark commented #1167
  • Dec 03 02:20
    amark commented #1170
  • Dec 02 16:48
    u007 commented #1173
  • Dec 02 16:47
    u007 commented #1173
  • Dec 02 16:47
    u007 closed #1173
  • Dec 02 16:44
    u007 commented #1173
  • Dec 02 16:29
    u007 opened #1173
  • Dec 02 12:39
    fsvieira opened #1172
  • Dec 01 23:00
    amark commented #1167
  • Dec 01 21:21
    Oxey405 opened #1171
  • Nov 30 15:07
    Emad-salah opened #1170
  • Nov 29 22:49
    fsvieira edited #1168
  • Nov 29 22:47
    fsvieira commented #1168
Radu
@rococtz

@connor-davis According to this https://gun.eco/docs/User#user-auth

user.auth(alias, pass, cb, opt)

or also

user.auth(pair, cb, opt)
Jay Leimer
@CodingJinxx
How can I accept a parameter of type gun instance, using gun with typescript
libensveto
@libensveto_twitter
sorting out user flows for era pay... did register product on dash -> then when you want to sell something link to us and we handle the code & sale, then send a confirmation email to client, and log data to your dash(? seems user friendly, criticism very welcome). This is done in the clip. There was an issue with editing data in another browser, however this holds not permanence and reverts. Dont mind all the red in console, peers being peers.
1 reply
RilDev
@RilDev
Is it possible to make Gun GDPR compliant? I'm referring to the fact that under the GDPR law in Europe, it is mandatory to be able to erase personal data. Fines can go up to 20 millions, I think.
Lorenzo Mangani @qxip
@lmangani:matrix.org
[m]
the only way is through absolute encryption to reduce the probability of a breach and thus avoid fines, as there's no 100% safe distributed delete in a decentralized graph by definition.
This said, even encrypted or pseudonymised data can be used to re-identify a person under the scope of GDPR so we're talking obscurity
RilDev
@RilDev
Got it, I'll make sure I understand the legal part before releasing my next "hit" app ^__^
Connor Davis
@connor-davis
@rococtz:matrix.org I have tried the second one and it didnt log me back in even though I provided the keypair hence why I hopped in here :)
Connor Davis
@connor-davis
Here is however a super secret project Im working on :P
rogowski
@rogowski
Very cool! @connor-davis
RilDev
@RilDev
@connor-davis No idea what it's for but it sure looks nice!
Oscar Hilton
@oscarhilton
Hello :wave:

I'm trying to write a little peer to peer program using Gun, React and Konva, the general idea being able to see the mouse of the other users on your screen, I can get gun to update using

swarm.map().on(({ name, x, y }: SwarmPeer) => {
    console.log(name, x, y);
});

but the problem is its super slow at updating. I'm console logging out the x, y of the mouse and I can see that firing rapidly. The console log inside that map.on function is however extremely slow and lags behind by several seconds. I have done the tutorials and managed to successfully get a live update of a textbox (like google docs) which seemed instantaneous and inspired this idea. Is there anything super obvious I might be getting wrong? Thanks in advance :)

Connor Davis
@connor-davis
How are you rendering the other mouse @oscarhilton
That can make a huge impact on performance
Adam
@adam-12:matrix.org
[m]
I'm deleting items under a node by setting their values to null. This is working but I don't like how I'm still see the nulled items the next time I query their parent node. Is there something else I need to do along with setting their values to null?
rococtz
@rococtz:matrix.org
[m]
@oscarhilton: it's hard to believe the slowness is coming from gun, are you sure it's not coming from the rendering part? Also, if you want to show someone's mouse position, I wouldn't use map (because I assume you keep pushing positions to a list of positions). Why not just keep overwriting the same item?
// John's computer
onMouseMove(() => {
   gun.get('John').get('position').put({ x,y  })
})

// Mike's computer
gun.get('John').get('position').on(renderThePosition)
if you record every single position update it will be useful if you want to do playback animation at a later time, but I assume you don't want that?
Adam: You can do .map( x => !!x || undefined)
If you return undefined from map, the callback won't be called.
Adam
@adam-12:matrix.org
[m]
👍
sua yoo
@SuaYoo

hi there, anyone using the expiry option with SEA.certify? got certs working but they don't seem to expire.

to test, i created a cert set to expire at 100ms from now (Date.now() + 100), copied the resulting certificate, and hardcoded it into { opt: { cert } } when doing a put.

error on my part, or?

sua yoo
@SuaYoo

heres my code: https://github.com/SuaYoo/gundb-react-express-auth-example/blob/main/server/server.js#L42

in general, would be great to get feedback on what i have so far: https://github.com/SuaYoo/gundb-react-express-auth-example

react + express app with:

  • sign up
  • sign in
  • change password
  • update user profile
  • multi-tab session syncing
  • access control--only allow logged in users to update areas
Mark Nadal
@amark
@deathg0d so the query is getting sent out - which peer is it sending it to? I wanna now debug the info on that peer.
@webprismdevin :+1:
@smarthug wooooooooah awesome, what graphics are you using? Raw WebGL? Unreal? ThreeJS/Babylon? https://github.com/amark/gun/blob/master/examples/game/space.html is a janky 200LOC multiplayer asteroid-like game. But check out @estebanrfp 's work he has a full metaverse running and syncing on GUN.
@connor-davis :clap: :fire: @rococtz . It should ahve just worked, are you sure? The keypair must be all 4, not just public parts.
@RilDev YAAAAAY its working?? :)
@libensveto_twitter :fire: tweeted!!!
@RilDev I'd argue GUN is more compliant @lmangani:matrix.org because if you do user.get('name').put(null) it not only overwrites the bytes it synchronizes it on the network, other dweb/blockchain can't do this (its a new log entry) and centralized systems have duplicate copies of the data in different systems not connected by a sync protocol.
@connor-davis :clap: :clap: ! :) congrats.
@oscarhilton :wave: !!! what is Konva? :)
Interesting, text editing should be harder to render than mouse movements. Maybe the peer you got connected to was slowing down? Is it slow if you run your own localhost peer?
@adam-12:matrix.org the null are needed to tombstone the data (so they don't resync), the technique most people use is to "start a fresh new piece of paper" so like having the name of the node hold its year/month/day, then each day (or whatever timeframe) starting a new node by copying the previous values over (but not the nulls).
@SuaYoo :wave: :wave: :wave: :) we just did a massive update last month, so it is possible expiry regressed in that time, there is a bug out that I need to fix around multiple pubkeys that maybe relates to it.
Neeeeeeat! Will you add it to https://github.com/amark/gun/wiki/awesome-gun for others to find too? And publish a demo on vercel or github pages or something!! Exciting to see solid profile controls managed!
Tom Howard
@thoward27

Hey there everyone! Hope you are all doing well :)

I am currently looking to build a sveltekit app running on netlify using gun.js as an information store. Unfortunately, something isn't quite clicking for me. I cannot seem to get beyond this specific error: https://deploy-preview-2--laughing-austin-64bcf3.netlify.app/

My first thought was that this had something to do with SSR, so I tried disabling that, and it changed nothing. I tried creating the radata folder, also no dice.

Apologies if this is a dumb question, but I am just getting my feet underneath me with frontend development/svelte/gun; any tips or tricks would be greatly appreciated!

All of my code can be seen here: thoward27/thor#2

Mark Nadal
@amark
@thoward27 :wave: welcome! :) GUN uses RAD to save data to disk which static hosts probably do not support, so maybe try to do require('gun/gun') (in memory only) instead? I'm not entirely sure tho. Your app can be hosted on static sites, but WebRTC in browsers :( :( sadly still requires bootstrapping peers, which won't work on Netlify/static hosts.
Tom Howard
@thoward27
:wave: hello @amark! So, essentially, I'll want to ensure all my gun code only gets run on the client, and not on the static host. Is that the right interpretation?
Mark Nadal
@amark
@thoward27 gun can run anywhere, but static hosts don't allow saving data to file systems, so you'd need to only run gun in browser or turn storage off GUN({rad:false
Tom Howard
@thoward27
Hmm. I tried GUN({rad:false}) and GUN({radisk: false}), both resulted in the same error as before, failure to create the radata folder
{"errorType":"Error","errorMessage":"EROFS: read-only file system, mkdir 'radata'","trace":["Error: EROFS: read-only file system, mkdir 'radata'","    at Object.mkdirSync (fs.js:921:3)","    at Store (/var/task/.netlify/functions-internal/__render.js:9271:12)","    at Object.next (/var/task/.netlify/functions-internal/__render.js:9310:48)","    at Object.next (/var/task/.netlify/functions-internal/__render.js:9042:15)","    at Function.onto [as on] (/var/task/.netlify/functions-internal/__render.js:5219:17)","    at Function.Gun2.create (/var/task/.netlify/functions-internal/__render.js:5400:20)","    at new Gun2 (/var/task/.netlify/functions-internal/__render.js:5372:23)","    at Gun2 (/var/task/.netlify/functions-internal/__render.js:5370:20)","    at Object.<anonymous> (/var/task/.netlify/functions-internal/__render.js:15563:33)","    at Module._compile (internal/modules/cjs/loader.js:999:30)"]}
Wasis Haryo Sasoko
@yokowasis
@thoward27 when the system is read only. You don't initialize gun on the server side. Initialize it on the client side.
Although unless you add peer server, the data only reside on local client. And you can't create peer server on read only file system.
libensveto
@libensveto_twitter
listened to this, https://changelog.com/podcast/236 , trying to dig up "mark inspiration" while doing a coding sprint . Noticed the hosts trying to pick apart the long term viability of gun towards then end, but still standing here today, makes me v proud
Mark Nadal
@amark
@libensveto_twitter awwe, you're so kind. My most recent podcast was the dabit3 episode.
It had a nice summary of GUN in it.
sua yoo
@SuaYoo

added the example to the wiki, thanks!

is there a way to manually add/trigger an error from gun middleware? i'm using bullet-catcher to verify JWTs, but since it fails silently, i cant tell the client to ask for another JWT. hoping for something like this:

if (isValid(msg)) {
    to.next(msg)
} else {
    // context.err = 'expired token'
    // or
    // msg.err = 'expired token'
    // or...
    // context.throwError('expired token)
}
sua yoo
@SuaYoo
heres the code if anyones curious, pretty straightforward jwt implementation: https://github.com/SuaYoo/gundb-react-express-auth-example/pull/1/files pretty excited about the possibility of getting rid of auth0 in my apps if this works ;)

i suppose i can do something like

if (isValid(msg)) {
    to.next(msg)
} else {
    gun.get(`~${appPubKey}`)
        .get('errors')
        .get(msg.headers.userPubKey)
        .put('invalid token')
}

but that feels...weird? since anyone would be able to read this error? still wrapping my head around gun-space

YarnBall
@yarnball
@SuaYoo this looks great! Does your repo handle registering an already existing username?
sua yoo
@SuaYoo
yep the logic is in the client https://github.com/SuaYoo/gundb-react-express-auth-example/blob/main/client/src/Login.js#L62 but without bullet-catcher/access tokens i believe someone could peer using their own app and bypass the check, if thats a concern
YarnBall
@yarnball
Oh I see. And if they "register" their user while offline, it would still know to reject it being created?
1 reply
Mark Nadal
@amark
@SuaYoo context.on('in', {'@': msg['#'], err: "error!"})
1 reply
... # is message ID, @ is ack reply to message ID
BBL
deathg0d
@deathg0d

@amark It sends to a remote server that contains the following code:

import Gun from 'gun';
import "gun/nts";
import "gun/lib/radix";
import "gun/lib/radisk";
import "gun/lib/store";
import "gun/lib/rindexed";

const PORT = 8080;
const HOST = "0.0.0.0";
var http = require('http');
var server = http.createServer();
var gun = Gun({ web: server, axe: false });

server.listen(PORT, HOST, () => {
  console.log(`Server listening to localhost:${PORT}/gun`);
});

This is inside a docker container. The routing and ssl on the server is handled by nginx proxy manager (which runs in another docker container). And as we discussed, it is working fine for data that arrive in realtime. The client app is not able to fetch already existing data from this server.

1 reply
Monknow
@Monknow
Hi! I was doing the todo example on the docs, but the console is giving mae this warning whenever I type something: Warning: AXE alpha became super slow & laggy, now in testing only mode!. So I decided to not import AXE and that got rid of the problem. However, should I import AXE anyways or not? Thanks in advance(By the way, your hair is awesome!)
Connor Davis
@connor-davis
@amark I managed to get my auth working using keypairs no :)
I might like this method alot
rrmckinley
@rrmckinley:matrix.org
[m]
https://www.youtube.com/watch?v=KMtrY6lbjcY Smarter Every Day YouTube channel (10 million follows) is starting a zero knowledge app and they are looking to partner @amark
Nicolas Frati
@jnfrati
Hey guys! I was making a little research of GUN, and found this video of Mark talking about AXE a couple of years ago. Wanted to know what was the state of that and where I can learn a little bit more. I've found AXErunners.com but not sure if it's the same protocol. Sorry if it's an ignorant question