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 04:33
    ndaidong closed #1292
  • Dec 01 16:01
    ameoba32 opened #1295
  • Dec 01 07:28

    amark on master

    toString must be stringy! (compare)

  • Dec 01 05:29
    amark commented #1287
  • Dec 01 05:21
    amark commented #1289
  • Dec 01 05:20
    amark commented #1293
  • Dec 01 05:12
    amark commented #1294
  • Nov 30 08:27
    soulofmischief commented #1294
  • Nov 28 23:07
    ViteOrder opened #1294
  • Nov 24 06:51
    expelledboy synchronize #1276
  • Nov 22 18:04
    BrendanDN commented #1290
  • Nov 22 18:04
    BrendanDN closed #1290
  • Nov 22 18:04
    BrendanDN commented #1290
  • Nov 22 17:59
    BrendanDN commented #1292
  • Nov 22 04:07
    ndaidong commented #1292
  • Nov 21 20:28
    verschmelzen opened #1293
  • Nov 21 19:44
    BrendanDN commented #1292
  • Nov 21 14:50
    ndaidong opened #1292
  • Nov 19 17:41
    estebanrfp commented #1080
  • Nov 18 21:26
    @rogowski banned @jesus:halogen.city
Maygician
@Maygician
peer option did work too, just somehow isn't stable
Muhammad Hassan Bilal
@hassan-bilal144
Hi, I want to do communication between two users, in other words want to send and receive data only and only between them. I was going through the docs and saw some relevant functions like user.grant and user.trust but they are either depreciated or under development. Is there any work-around of this?
2 replies
Lexi
@Lexi:matrix.org
[m]

So restricting writes to a user is easy. Just use that user's user space https://gun.eco/docs/User

Only readable is not possible AFAIK but you can encrypt the data so only these two users can read the decrypted data. https://gun.eco/docs/SEA

7 replies
Also here is the documentation for how it's possible for a user to allow others to write to their user space. That way they can write to the same path https://gun.eco/docs/SEA.certify
1 reply
davidmaxwaterman
@davidmaxwaterman:mozilla.org
[m]
BTW, I demo'd my prototype progress 'so far' to my boss last Friday and he seemed to be favourably impressed, so work will move along.
He does seem to have reservations when it comes to anything mentioning 'peer-to-peer' so I'm curious exactly how that applies to Gun - like you say, it does seem to be quite 'client-server'-like, at least in usage. Where does the 'peer-to-peer' aspect come into it? TBH, I've been able to quite ignore it has been peer-to-peer, so I don't have any worries in that respect.
My chief frustrations so far have been due to the interactions of the async tasks involved. My code essentially is middleware between Gun and another storage and both APIs are asynchronous. I found that when my code does a Gun put(), that then results in an on() callback being called, and it then makes other async calls...and all these async tasks get interleaved and make things horribly complicated. I ended up using a mutex to make sure the on() handler isn't called before the internal API handler has finished its work; and vice-versa. It would have been much easier if a call to put() wouldn't call on() handlers on the same (browser) peer; or they could easily be filtered out somehow. ...and option to on() to not be called as a result of put()s on the same peer would be good, and (I think) would solve a lot of problems I've been grappling with. Perhaps there's already a way.
1 reply
Lexi
@Lexi:matrix.org
[m]
The browser definitely is native, just webapps aren't hehe :D
davidmaxwaterman
@davidmaxwaterman:mozilla.org
[m]
ooh, controversial!
davidmaxwaterman
@davidmaxwaterman:mozilla.org
[m]
Hrm....it seems things can get significantly more complicated than my current grok-level. What I've been doing so far (ie one relay peer in the cloud and two browser peers on the same lan) does seem quite client-server-like, but perhaps it isn't actually.
I wonder - do the browser peers ever communicate directly if they're on the same lan (without any extra help)?
1 reply
davidmaxwaterman
@davidmaxwaterman:mozilla.org
[m]
I wonder if anyone has successfully set up end-to-end testing on a single host, so that it tests two browser peers. Is there a section on testing in the docs?
4 replies
Lexi
@Lexi:matrix.org
[m]
And yes the way you described it is pretty client server like. But it's very easy to change that by including another relay peer for example
Oh your question was on the same LAN… hmm they should be able to find that out yes. But not without help, but they are connected through the relay peer anyway
Noah
@LAZERPOINT
hi! had a quick question i wanted to ask, is there any way to modify the todo list app on the gun.js.org example to allow everyone to see everyones todos? so like instead of just seeing yours you see all users todos
5 replies
Lakshya Jain
@LAKSHYAJAIN16
hey
Is it possible to do a 'return all documents' query with gun? Like a full collection in firebase firestore? Like say I want to get all of the documents created ever?
1 reply
rococtz
@rococtz:matrix.org
[m]
@LAKSHYAJAIN16: You can get full depth of a node, but you can get the root.
appusvivek
@appusvivek

Can somebody help me with identifying the issue?

On Child page

 const chat = { type: 'new', updated_at:  moment().utc().format("YYYY-MM-DD HH:mm:ss"), last_msg: 'some last msg'}

gun.get("somerandomId").get("uRooms").get('roomId').put(chat);

the above piece of code inserts the data correctly.

On Root page

gun.get("somerandomId").get("uRooms").open((data) => {
const chats = Object.values(data).filter((item) => !!item && !!item.type);
console.log('here', chats);
});

as soon as i add a new data in child page the root page gun call gets triggered as well, but I cannot see the data updated until i refresh the root page.

The initial load of root page loads everything correctly as well. Any idea why?

3 replies
Muhammad Hassan Bilal
@hassan-bilal144
Hi,
  1. What's the proper way to check if a node exists in the db
2 What's the proper way to check if a user exists in the db using it's username.
nonayerbiz
@nonayerbiz:matrix.org
[m]
@appusvivek: set axe:false option on your relay’s gun instantiation - then check
17 replies
appusvivek
@appusvivek
sure I'll check that @nonayerbiz:matrix.org
Lexi
@Lexi:matrix.org
[m]
If not we can check your code in our side if you want to provide a minimal example
Does yourdomain/basic/paste.html work with your relay peer?
davidmaxwaterman
@davidmaxwaterman:mozilla.org
[m]
Is there the concept of 'moving' an item in a hierarchy held in gun?
davidmaxwaterman
@davidmaxwaterman:mozilla.org
[m]
:point_up: Edit: Is there the concept of 'moving' an item in a tree held in gun?
:point_up: Edit: Is there the concept of 'moving' an item in a list held in gun?
davidmaxwaterman
@davidmaxwaterman:mozilla.org
[m]
I suppose the 'feature' I want it to know in (eg) an on() callback where the item was previously.
6 replies
Lexi
@Lexi:matrix.org
[m]
Wiping will probably not help because all data that has been synced ("uploaded") will just get synced back again ("downloaded")
1 reply
Mark Nadal
@amark
I'm thankful for you all :)
1 reply
Lexi
@Lexi:matrix.org
[m]
I think GUN has mechanisms to keep track of those changes so no "old updates" as in "reverts" happen
davidmaxwaterman
@davidmaxwaterman:mozilla.org
[m]
I don't mean that, no. I mean that it might be a long time before a 3rd browser reconnects...and the 'transactional' nature of the put()s means that the 3rd browser would need them to be relayed to it in the correct order, etc to make sure its state matches.
If all browser peers are online when the put()s are done, then they all get updated as expected...because the on() handlers are called and they make the corresponding local changes...but if one is offline, then it doesn't get them....and more updates happen, and more, etc etc...then it comes online again and it needs to get all those updates in the same order, else it'll not be possible to perform the changes.
davidmaxwaterman
@davidmaxwaterman:mozilla.org
[m]
It all gets very fiddly. Which is why I've been thinking it'd be best to just get notified when gun's state has been changed, and then just make the local match it - rather than try to make the same edits. Ultimately, I could stringify the whole state tree, and put that, then have the clients do whatever is needed to make its state match what is in Gun.
davidmaxwaterman
@davidmaxwaterman:mozilla.org
[m]
I mean, as I have it now, I can see this appearance of 'transactions'....if I clear out the relay peer, and start up two blank browser peers, then on one of them make some 'user' changes...I can see them happening on the other peer.
If I then fire up a 3rd blank peer, it gets the changes and its state then matches.
...but this only works because I ignore the prior state of the browsers - I just overwrite it when whatever gun says. If, instead, I do things like 'move', it makes the new browser state dependent on the previous browser state. That's fine if they all start from 'blank'...but it does sound quite fragile, no?
davidmaxwaterman
@davidmaxwaterman:mozilla.org
[m]
...or perhaps I'm thinking about this 'all wrong'?
Lexi
@Lexi:matrix.org
[m]
davidmaxwaterman: Well the puts are on the node and moving a node does not really move it but only the reference. But if the third peer gets the node by its path instead of directly that's a great question. How about trying it out? I have not looked at GUN's CRDT algorithm
1 reply
Lexi
@Lexi:matrix.org
[m]
In general I wonder how CRDTs work. What if Alice and Bob both get the same note and go offline. Alice deletes the node and Bob updates it. When both go online which state gets synced? How is it decided which update is correct?
1 reply
Damon Blais
@AlbinoGeek
So... what happened to AXE?
nonayerbiz
@nonayerbiz:matrix.org
[m]
AXE is in its last 15-20a% of development. For now disable it on your relay to guarantee expected behavior. @amark mentioned wanting to peer program some of it in case there’s any takers who want to contribute.
davidmaxwaterman
@davidmaxwaterman:mozilla.org
[m]
Doing this 'delete/create' for a whole tree of items is likely expensive (on the browser anyway, if not in gun), but it doesn't seem to be avoidable.
Manwë
@Manwe-777
Is there anywhere to see the development of axe @nonayerbiz:matrix.org ?
davidmaxwaterman
@davidmaxwaterman:mozilla.org
[m]
If you have to do a lot of put()s, is it better to 'batch' them in one put() on the parent object?
Noah
@LAZERPOINT
need help on making a twitter clone in gun js, i have a login feature but no posting features yet, anyone think they could help me with this?
Noah
@LAZERPOINT
like im just looking to make the most bare bones thing, just posts
Noah
@LAZERPOINT
i think i might remember sending this here at one point but anyone know how to remake this? https://www.youtube.com/watch?v=-FN_J3etdvY&ab_channel=gunDB
Mark Nadal
@amark
@LAZERPOINT did you see examples/basic/post.html (?)
@AlbinoGeek @Manwe-777 me and @Draeder were making a lot of progress on it a few months back - then conference season hit. I need to get back to coding, do either of you want to help join in on calls? @nonayerbiz:matrix.org ping me on telegram (or others interested, ping me on twitter) if people can sit down & pair program AXE with me!
@Lexi:matrix.org @davidmaxwaterman:mozilla.org for multi-graph operations, you may want to program your own behavior on top of GUN's base CRDT. For (unrelated) example, a counter CRDT can be implemented on top in 12 lines https://gun.eco/docs/Counter . Usually rich-text based ops, deletes, etc. you may want custom behavior ontop of GUN's base CRDT behavior. There's a few rich text / etc. CRDT layers that have been built on GUN in the past, some I demeod myself, and others by nmaro.
. . . .
Shoot, Heroku shutting off free machines this week, so a lot of volunteer peers will vanish...
can I get some volunteers to help update docs, deploy some cheap peers somewhere else, and swap their IPs into the docs that are using the peers that'll be deprecated? Please? Thanks! (DM me)
1 reply
and :( it really does look like @go1dfish may be dead :( notabug (p2p reddit) seems to have had some DNS outage and now its... dead for the first time in 2+ years since we suspected the anon founder was killed.
Noah
@LAZERPOINT
I did see, but how would i be able to modify the code so i can make it do the thing in the video?
i001962
@i001962:matrix.org
[m]
gun-manhattan will remain available at the same service level for a few moths. ie it will run out of dynos near the end of each month. I'll pay the $5/mn until folks get their apps updated with new peers.