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
rococtz
@rococtz:matrix.org
[m]
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
sua yoo
@SuaYoo

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

@SuaYoo context.on('in', {'@': msg['#'], err: "error!"})

updated the example here to implement marks suggestion if anyones curious: https://github.com/SuaYoo/gundb-react-express-auth-example/pull/1/files

Connor Davis
@connor-davis
https://youtu.be/LDG9T2hN7i0 As you all know I have been working on an app, Here is the Demo Video
Mark Nadal
@amark
@deathg0d will you do me a favor and... in NodeJS gun will try to pull all the NodeJS modules automatically, try dropping the extra import statements, and see if that changes anything? (If not, then try turning AXE back on). If these last checks don't work then I don't know what is going on, and maybe would need to screenshare or something.
@Monknow <3 thanks :) :) :) . AXE in browser is experimental and not necessary, if you remove it tho, you need to add/specify peers GUN([peer1, peer2, etc.
@connor-davis :fire: yay
@rrmckinley:matrix.org nice tip off! Have any connections to him?
@jnfrati we announced before them and are not related to them. AXE is like 40% complete, if you want to help build the last 60% we have quite a few "PANIC" tests we simulate it under to test against. Curious?
@SuaYoo :pray: thank you! Did it work for you too?
@connor-davis Nice, can I tweet about this?
rrmckinley
@rrmckinley:matrix.org
[m]
@amark: no connection no. It is left-field for them and makes me think there may be a tipping point in interest in decentralization and zero knowledge
achilles
@achilldotes_twitter
Hey folks, I have a couple questions about gun. When I use sessionStorage: true with gun.user, I notice that my alias is now encrypted when I revisit the page. Which now means I have to use SEA to decrypt it. If this is false, feel free to let me know. However, what should I decrypt it with? User.is only has 3 options, alias, epub, and pub. Thanks for your help.
libensveto
@libensveto_twitter
any one in genz mafia? cant find it in my discord anymore and can only guess i got kicked for shilling
Manuel Etchegaray
@Manuel-777
@amark hey man! Im having a problem with users, maybe you found a better way of doing this, but, what is the defacto, best and proper way of making user accounts recoverable using Gun? The passphrase/hint method is quite bad to be honest, people forget just details of their passwords like a number or an uppercase, and the hint unless it contains the whole password, does not help in those situations. I have had a LOT of complaints with this particular issue.. Have you found a solution for that, or rather, an alternative?
mimiza
@mimiza
@amark Do you have some time? Can you please fix the issue #1137 ?
Mark Nadal
@amark
@achilldotes_twitter interesting that also seems like a bug.
@libensveto_twitter I was there a long time ago. What were you "shilling"?
@Manuel-777 the problem is no other system even comes comparably close to any method, at all :( so something is better than nothing. Luckily, @aethiop built a 3FA method too! https://twitter.com/marknadal/status/1427715775838572545
@mimiza agreeeeeeed, after being gone on legal stuff for the few weeks, I've back been in docs world and then Brave said they'd review my SecureRender proposal. I need to fix this for you, can it be done after SecureRender or no?
mimiza
@mimiza
@amark if it is possible I want it to be fixed soon, but it's up to you to arrange your time. There are certify unit tests and some bus delayed for weeks now. I just want to finish them.
libensveto
@libensveto_twitter
@amark myself mainly, they get abit uptight if you do it in the wrong channel or start asking for help
Oscar Hilton
@oscarhilton
Major breakthrough in my understanding of GUN! Thank you everyone to helped me out!
@amark Konva is a canvas library that makes developing UIs in the canvas super simple! :)
mochic
@mochic
Hey so I’ve made a lot of progress since my last question. I have each gun instance listening to nodes and waiting for changes on certain nodes but I’m worried about the network being flooded with malicious “put” operations, making it hard to get data we actually want to see. I suppose I could maintain a blacklist for each client but I feel like that might spiral out of control since creating a new user is so easy that the blacklist would become untenable in size even via a complex implementation. Any suggestions? Is there any clever way for me to embed metadata in property names to use lex to filter out data from “bad” sources or is implementing an adapter more helpful for me here?
Barłomiej Bąk
@dweorh_twitter

hey guys, I have a pretty weird issue with .map()

gun.get('dict').map((data, key) => {
  if (data == 1) 
    return { data, key, status: 1}
else 
  return {data, key, status: 2}
}).once({ data, key, status } => {
  console.log(data, key, status)
})

that's just an example, thing is that pretty often .map() does not call .once(). Any idea why?

libensveto
@libensveto_twitter
Mark Nadal
@amark
@libensveto_twitter :+1:
@oscarhilton (?)
@mochic Iris' Web of Trust is what fixes this. Don't worry tho, launch your app first, do not over-engineer it, you can integrate Iris and stuff later.
@dweorh_twitter hmm, there are minimal tests for filter and transform functions in map. if you just do map().once((data,key) => { if(data === 1){ ... are there any issues?
@libensveto_twitter w0000 nice homepage!!! Clicking "start" didn't do anything tho
1 reply
libensveto
@libensveto_twitter
@amark yep havnt linked it up yet
Ronald Prato
@Ronald-Prato
Hey there! i've been reading the docs all day and i'm still having a question about delete data. What if i have a medium-deeply nested schema? if i set null to a node which have other relationships those get deleted as well ?