Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 24 23:36
    syonfox updated the wiki
  • Sep 23 21:10
    qgustavor commented #1280
  • Sep 23 21:06
    qgustavor commented #1280
  • Sep 23 21:05
    qgustavor commented #1280
  • Sep 23 20:57
    qgustavor commented #1280
  • Sep 23 20:40
    draeder commented #1282
  • Sep 23 20:38
    draeder commented #1280
  • Sep 23 20:36
    draeder commented #1283
  • Sep 23 10:21
    Codzaa opened #1283
  • Sep 23 02:25
    qgustavor commented #1280
  • Sep 21 09:26
    mmalmi opened #1282
  • Sep 19 21:08
    thiago-hs closed #1281
  • Sep 19 19:48
    thiago-hs edited #1281
  • Sep 19 19:33
    thiago-hs edited #1281
  • Sep 19 19:33
    thiago-hs opened #1281
  • Sep 18 20:15
    qgustavor opened #1280
  • Sep 15 05:02
    Alengeorge-01 edited #1279
  • Sep 13 21:32
    csharpner updated the wiki
  • Sep 13 08:12
    Alengeorge-01 opened #1279
  • Sep 12 13:13
    1MaddieX updated the wiki
Adam Bowman
@abow
Anyone else notice that when you go to gun.eco and quickly click on the github link all the videos on the page start playing?
There is also a text box at the top of the page that doesn't seem to do anything.
Shendy
@devshendy
Hello everyone,
I am new here, and specially in the distributed world. So please excuse me if my questions seems dumb at anytime.
I see now gun is made for the web, does it mean we cannot have peers using only a mobile app?
I know it uses localStorage and indexedDB of the web browser, and how about realm for mobile apps?
For example, I found that we can run npm packages using a package in Flutter called flutter_js, but I thought how gun run in Flutter without localStorage or indexedDB .. or this would be a future feature?
Adam
@adam-12:matrix.org
[m]
A PWA might be a good mobile option for you depending on the features you need. @devshendy
Adam Bowman
@abow
Is there a way to get another user's epub?
Shendy
@devshendy
@adam-12:matrix.org Yeah i get it, it just still web browser based.
CSS for me is a painful framework, I do UI on mobile apps more productive.
Barłomiej Bąk
@dweorh_twitter
@abow in general epub is not a secret but there is no such thing as a list of users, so you can store 'known users' in some node, eg. 'profiles', with that epub along with other data you may find useful
other option is to get user details from its message
Barłomiej Bąk
@dweorh_twitter

let's say there is a common node where all users store data,
if a user did something like

let message = await gun.user().get('all').set({ msg: 'hello'})
gun.get('messages').get('first_message').put(message)

later you can do this:

let data = await gun.get('messages').get('fist_message')
let alias = gun.user(data).get('alias')
Adam Bowman
@abow
Thanks @dweorh_twitter. I currently store the epub in the user's profile for others to access. I was hoping I could do away with that and somehow get it from gun.user().
Barłomiej Bąk
@dweorh_twitter
so, to use gun.user() you would have to get a message from the user, that the user stores in his userspace, as in my example, at least I don't know any other way :)
Barłomiej Bąk
@dweorh_twitter
does anyone know git repo where we can pull changes to the documentation?
We had questions about a list of users a few times in the last couple of days, and I guess examples in the official documentation are not helpful. I would say they can be confusing. eg.
// retrieve all available users
gun.get('users').map().on(ui.show.users)
Shendy
@devshendy
@adam-12:matrix.org Plus, when the user leave the browser to use another app, it means he went offline, right? in the case of desktop he is still online even the browser tab is not the active one at the moment.
Barłomiej Bąk
@dweorh_twitter

I've found a strange behavior. I'm not sure if that's a bug or it works as designed but here is a code

let room = SEA.pair()
let user = SEA.pair()
let cert = await SEA.certify( 
  '*',
  { '*':'posts', '+': '*' },
  room
)

await gunRoom.get('posts') // => undefined

await gunUser.user().auth(user)
await gunUser.get('~' + room.pub).get('posts').get(user.pub).get('messages').put({message: 'hello'}, null, {opt: {cert: cert}})

gunRoom.user().get('posts').get(user.pub).get('messages') // => {message: hello}
gunRoom.user().get('posts').get(user.pub).put(null)

gunRoom.user().get('posts').get(user.pub).get('messages') // => undefined
gunRoom.user().get('posts').get(user.pub).set(null)

gunRoom.user().get('posts').get(user.pub).get('messages') // => {message: hello}

the whole thing is in a difference .put(null) vs .set(null)

Barłomiej Bąk
@dweorh_twitter

we can go a bit further with it

await gunUser.get('~' + room.pub).get('posts').get(user.pub).get('messages').put(null, null, {opt: {cert: cert}})
gunRoom.user().get('posts').get(user.pub).get('messages') // => undefined

await gunUser.get('~' + room.pub).get('posts').get(user.pub).get('messages').set(null, null, {opt: {cert: cert}})
gunRoom.user().get('posts').get(user.pub).get('messages') // => {message: hello, ku33iqysRfusABH: null}

when the owner of the message .set(null) it reverts the nullified by .put(null) document with some extra hash key with a null value

tedd pasta
@azdez:matrix.org
[m]
i was trying to chain gun.get() like this
let someArr = ['test', 'tests', 'testing']
for(let i = 0;i < someArr.length;i++){
gun.get(someArr[i])
}
gun.once(data => {console.log(data)})
this doesn't work, so my question is can chaining .get() work with a for loop, does the chaining has to happen in one line with out a loop, such as gun.get('test').get('tests').get('testing')
so
let someArr = ['test', 'tests', 'testing']
for(let i = 0;i < someArr.length;i++){
gun.get(someArr[i])
}
gun.once(data => {console.log(data)})

vs

gun.get('test').get('tests').get('testing').once(data => {console.log(data)})
is gun.get('test').get('tests').get('testing').once(data => {console.log(data)}) the correct way? and if so, then for loop will not work with chaining?
WTFDoc
@WTFDoc
Hello, i'm trying to run a node of gun that would not remember any data. Is it possible ? Do you have any documentation or article to have a p2p communication only ? (all data stays on user machines) I'm trying it using example/http.js and i remove pieces one by one but still it remembers.
Lorenzo Mangani @qxip
@lmangani:matrix.org
[m]
@WTFDoc: we have a "forgetful" GUN server with scoped paths we use for coordinating meething webrtc rooms w/o storage https://github.com/meething/gundb-multisocket
not sure if this is what you're after, but its basically a node that doesn't remember any data once the room expires and is mostly used to coordinate a DAM events in our implementation
WTFDoc
@WTFDoc
thanks @lmangani:matrix.org I will try it out !
sahaabhishek
@sahaabhishek
Hello all, Im working on a project with gunjs with svelte.
In dev, import Gun from 'gun/gun' it worked. but while building I got error.
import Gun from 'gun' is working.
Which is the correct way of importing gun?
Lorenzo Mangani @qxip
@lmangani:matrix.org
[m]
importing gun/gun should provide Gun to your scope, so you dont need to import it twice, just initialize it afterwards
Mark Nadal
@amark

@daviddahl wow :D a decade+ ahead. Let's get this off the ground this time around?
@dweorh_twitter hmm, will look how to get this supported, can you submit as a GitHub Issue and tag mimiza?

<3 https://github.com/amark/gun/wiki/ can edit in-browser! :) Would be really appreciated, thanks!
@mmalmi :clap: :clap: :clap: let me retweet!!! 3rd is message which is different every time, while as event is the listener.
@sahaabhishek :wave: :) hiii!! :clap: @dweorh_twitter :clap: @lmangani:matrix.org . Browser WebRTC still needs "signaling" peers :( so relays default choice with websockets.
@abow reporting videos auto-play @estebanrfp
@devshendy Hiii! :clap: @adam-12:matrix.org . And RN, maybe someone can help with flutter.
@abow await gun.user(pubkey).get('epub)
@dweorh_twitter .set(null is like pushing null into an loosely sorted array. It won't null out other things, put( must. If GUN cannot find the UUID/soul of something, it will generate it as deterministically as possible based on the path - so that is why you see it "reappear" its the same ID, I believe .put( docs API discusses this. If you want to start a "new" object at a path, make sure its a random ID.
@azdez:matrix.org you're missing gun = gun.get... in your loop :) else gun never changes. (prob do ref = gun outside and ref = ref.get( inside, so you don't lose your root gun).
@WTFDoc :clap: @lmangani:matrix.org . GUN likes to remember... even via other browsers. But if you localStorage.clear() at beginning of every refresh, and keep relay without storage... you should see things vanish.
@sahaabhishek :clap: @lmangani:matrix.org

1 reply
Adam Bowman
@abow
@amark await gun.user(pubkey).get('epub') doesn't seem to work for me. I think it's because I'm not using user.create(alias, password). I create users with user.auth(keypair).
That brings up another question. If I start with a user that is created using user.auth(keypair), can I at some point allow that user to enter an alias and password with that same user account?
Barłomiej Bąk
@dweorh_twitter
I don't know about user's password but alias you can find here
let pair = SEA.pair()
gun.user().auth(pair)
gun.user().is.alias
Barłomiej Bąk
@dweorh_twitter
im.maddie
@im.maddie:matrix.org
[m]
I'm getting a weird issue. I've peered a node on my local machine to a peer on a server but it doesn't seem to be syncing state with the server, is this supposed to happen? how can I force a sync with the server peer?
Simon Bailey
@newtriks

I think I'm getting the same, if not very similar issue reported on amark/gun#917 after pulling and running the code from this tutorial https://www.youtube.com/watch?v=J5x3OMXjgMc.

Essentially, if I use a new unique id for the data I'm finding the first entry (or message posted) never shows up, only the following (second, third, etc) messages. Sending a blank first message prior to gun.get("some/room").map().on() as similar to what is shown by @georgigriffiths in the issue linked above is a workaround.

Specific code in the example is:

  1. https://github.com/fireship-io/gun-chat/blob/main/src/Chat.svelte#L42
  2. https://github.com/fireship-io/gun-chat/blob/main/src/Chat.svelte#L68
Gessic
@gessicapps_twitter
Hey guys, does anyone else notice that on the webpage the data is stale at first, but if you refresh the page, all the data gets updated? I'm using react
I'm using gun.get('dbname').on(...) and it seems to be a few records behind until I refresh the page
tried from multiple browsers
Lorenzo Mangani @qxip
@lmangani:matrix.org
[m]
tedd pasta: nice move on gun-fetch! not sure I understand without a peer definition how it would select or attach to a gun node where the data might be so it should probably be part of the URI?
1 reply
jakethejab
@jakethejab

I'm experiencing a weird issue with SEA certify. If I provide the pub of 1 user it works fine (the user is able to write to the authority user's graph). If I provide more than 1 pub, then it does not work at all. Is this a bug with certify or am I using it wrong?

This works:

const cert = await SEA.certify(
  ['H5LBBxrb0wFukxlI9YAFif9M-LVE6JFtRwvMZCTfe54.CzOB4zTpzR3OPa7Ncf6pfOVmyXiAJp3-XohtcBgvwBw'],  // 1 pub provided
  {"*": "messages", '+': '*' },
  user.is.alias,
  null
);

This doesn't:

const cert = await SEA.certify(
  ['H5LBBxrb0wFukxlI9YAFif9M-LVE6JFtRwvMZCTfe54.CzOB4zTpzR3OPa7Ncf6pfOVmyXiAJp3-XohtcBgvwBw', 'eBv261G2jBJOQzAUEb-jn6XISvRQq3rbPgLaatrC9qQ.ZUXChPYESeYFiGizTuppffBETXaBnOTAYjValT1qpsg'], // 2 pubs provided
  {"*": "messages", '+': '*' },
  user.is.alias,
  null
);
Lorenzo Mangani @qxip
@lmangani:matrix.org
[m]
well done! starting is the hardest part, we'll join in and help for sure
Barłomiej Bąk
@dweorh_twitter
@jakethejab as the third param use user's pairs not an alias
if alias would be good enough to create certificates everybody could generate certificates to write in the other user's spaces :)
jakethejab
@jakethejab
@dweorh_twitter For me, user.is.alias is an object that contains the authenticated user's private and public keys. Is there a better way to get access to an authenticated user's keys, perhaps session storage? The certificate works for a single user, just not for multiple.
Adam Bowman
@abow
@jakethejab are you on the most recent version of gun? user.is.alias no longer has a copy of the private and public key.
Adam Bowman
@abow
I think alias used to hold the keys when users where authenticated with keys.
(as opposed to alias, password)
I save the user's keys to local storage.
Adam Bowman
@abow
Also, I remember having an issue with certificates only working for a single user. @jakethejab
1 reply
Mark Nadal
@amark
@abow ahh, correct. Well, what it does for you is no different than how you're saving it anyways, so just keep doing that. Can reuse the code that saves the user info, yeah, like :clap: @dweorh_twitter password reset, tho will need to check if it works in those combos (be nice if someone could PR tests/fixes)
@im.maddie:matrix.org often is Gun({axe: false fix this bug, if not, more details? If in browser, check networking tab websocket messages?
@newtriks @georgigriffiths IDK if relevant but @gcoakes says he's using .put( when usually you use .set( for .map() over. Does this help at all?
@gessicapps_twitter does this happen after waking up your computer or some prior network disconnection? It sounds like you can replicate well enough, can you record a video or isolate into a test?
@azdez:matrix.org @lmangani:matrix.org where was gunFetch posted :) ? I didn't see!
@jakethejab :clap: @dweorh_twitter :clap: @abow . Yes, please try upgrading and using user.pair() and see if fixed now. It was always a bug if alias had something else on it.
2 replies