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
rococtz
@rococtz:matrix.org
[m]
Azarattum: The users only store what they subscribe to so they won't store huge amounts of data unless they actually try to access it and subscribe to it. I think the easiest thing to do is to test your own scenario using multiple browsers and see what happens. You can always inspect the local storage in the developer console and see what gets stored
Azarattum
@azarattum:matrix.org
[m]
But, when you do get({ ".": { "*": e.target.value } }) don't you subscribe to an entire peer?
Also how did you figure out the { ".": { "*": e.target.value } } part? I can't see anything in docs mentioning that you can use something other than a string as a key to get.
Azarattum
@azarattum:matrix.org
[m]

rococtz: The users only store what they subscribe to

So, data accessed with once or load wouldn't be stored?

1 reply
rococtz
@rococtz:matrix.org
[m]
Azarattum: The data accessed with once or load will be stored. Again, try it yourself and see what happens, that's the best way to find out. This is the documentation for the queries: https://gun.eco/docs/RAD#lex
Lexi
@Lexi:matrix.org
[m]
Does anyone know what the label Object of GUN nodes is for? Is there documentation for it?
Omarabuziad
@Omarabuziad
@draeder @rococtz:matrix.org @bmatusiak @Manwe-777 @ilhamgum @amark
there is any limit on node capacity for storing data? i'm testing the node
it's start give me this message : Warning: "You're syncing 1K+ records a second, faster than DOM can update - consider limiting query."
i'm trying to query 400 refNodes
6 replies
Suleiman Zhukov
@SuleimanZhukov
@draeder @rococtz:matrix.org @bmatusiak @Manwe-777 @ilhamgum @amark @lexi:matrix.org
How Gun get() node, does it scan, or by index?
1 reply
Omarabuziad
@Omarabuziad
image.png

@draeder @rococtz:matrix.org @bmatusiak @Manwe-777 @ilhamgum @amark @lexi:matrix.org

I have this basic structure for the database for emails but I'm sure there is something wrong
I create 613 converID Node at conversations Node, and at the user Inbox node i but the 613 references for the converID nodes
when I tried to retrieve these 613 conversations with the subject and body property, it takes more than 63 sec
I first get the hole refPath for all converId nodes at Inbox node using gun.get("accounts").get(user).get("inbox").once( async (data)=>{
after that
i loop through each ref-path and retrive the converId property
gun.get("conversations").get(converID ref-path).once( async (data)=>{
}
i feel there is something wrong , 613 records takes 63 sec ??

i also try
gun.get("accounts").get(user).get("inbox").map().once( async (data)=>{
and store data in react state and show it
}
it takes more than 111 sec !!

8 replies
Sahara NFT
@SamiLaayouni_twitter
Hello everybody. I have a couple of questions. 1) How do I save information to the user like name/age... 2) How can I implement pagination? 3) How do I make sure that users can't change the information of other users. 4) How do I subscribe to data? I'm new to this and any help would be appreciated.
Lexi
@Lexi:matrix.org
[m]
@Omarabuziad: Have you tried without React, just plain Vanilla? How long does it take then?
Daniel Raeder
@draeder
@SamiLaayouni_twitter
  1. This depends on what you want that data for.. E.g. is it an index of users for an app? If so, gun.get('app-name').get('users').get(username).put(age)
  2. Use Lex: https://gun.eco/docs/RAD#lex
  3. Use the user API: gun.user().get('root-node').put(data)
  4. gun.get('app-name').get('users').get(username).on(data => console.log(data))
Sahara NFT
@SamiLaayouni_twitter
Thanks
Bo
@worldpeaceenginelabs
@amark the magic glitches with Gun seem to happen with Sveltekit only, because its more meant for serverside rendering and routes. SvelteJS is what you want to use with Gun if. It overcomes also the 1K+/sec limitation of DOM, because there is no DOM in Svelte. And your Typescript gets compiled to vanilla-js automatically. check out https://github.com/worldpeaceenginelabs/FORM-GUN to try it yourself. It comes with Tutorial.
Omarabuziad
@Omarabuziad

@draeder @rococtz:matrix.org @bmatusiak @Manwe-777 @ilhamgum @amark @lexi:matrix.org
I have this query

const oneTimeArray = [] ;

gun.get("emails").map().once( (data)=>{

** it will return 613 records as objects for example { subject : data.subject , body : data.body }
what is the best way to render it using react ?
i try to use

1 - setEmails(prev = > [...prev , { subject : data.subject , body : data.body } ] but this make the performance so bad and the query need 1 sec to retrive data , after using setState it's take 100 sec for retrive and render the data
}

2- I tried to store the whole data in one array and then after that render it one time, like
oneTimeArray.push({ subject : data.subject , body : data.body } )

}
and after gun statement i tried to catch the array and it's keep give empty array , any ideas?

Daniel Raeder
@draeder
@Omarabuziad I don't use react, so I can't help there
18 replies
Manwë
@Manwe-777
@Omarabuziad have you tried creating a global object outside React to use Gun? something like
// This outside React, at index.jsx
window.gunData = {};

// This elsewhere, try to not use useEffect !
gun.get("emails").on( (data)=>{
  // key could be some id inside data, or just replace the entire object
  window.gunData[key] = data;
})
1 reply
Bo
@worldpeaceenginelabs
has anybody experience with Gun and Bun? Sounds to me like they could go together good https://bun.sh/ https://youtu.be/FMhScnY0dME
1 reply
bitfinicon.com
@bitdom8
Hi, how can we save array?
gun .get('text') .put({ text: $addatreturntitle, who: 'Bitfinicon', when: new Date().toISOString(), hashtags: { 0: postidname1[0], 1: postidname1[1] } })
It saves the object. How can we take it from database and turn it into array?
Lexi
@Lexi:matrix.org
[m]
@Omarabuziad: can't you access your object/the data in the callback function? That way you don't need to wait until all the data is there to iterate over it
26 replies
cow
@0xcow
hi
i'm trying to build a decentralized chat room, is this current app that I'm using (hitter) built using gunjs?
1 reply
anyone have got good resource to build a chat room from scratch using gunjs?
2 replies
Lexi
@Lexi:matrix.org
[m]
Also, welcome
cow
@0xcow
thanks
what is iris search for lone wolf
Lexi
@Lexi:matrix.org
[m]
I had the same problem but noticed that I cannot tell at runtime whether the complete data has been received. At any time some other user could add data and that data wouldn't be there. So instead of waiting for data I decided to show data as soon as it's received because it's not possible to tell whether there is new data available. It will just also run the callback function. So I set that callback function to update the user interface. The user can still stop updates coming in
It's you, the developer, who has to decide when to stop listening for live updates. You could never stop, let the user decide, stop at a number of records, or on receiving data that has a specific form
cow
@0xcow
any chat application using gunjs I could take a look at? Iris is not a chat application per say
1 reply
entermonke
@entermonke:matrix.org
[m]
notabug has chat on it
iris too
cow
@0xcow
iris has a message function, not a group chat (think)
notabug.org?
oh I see the group chat on iris, thanks
2 replies
entermonke
@entermonke:matrix.org
[m]
iris chat
Daniel Raeder
@draeder
So, I was using Nord VPN up until yesterday when all of my browsing stopped working. The reason? ingest.sentry.io was down. It's a data tracker for marketing! https://confection.io/trackers/ingest-sentry-io/. If you use Nord VPN, I strongly suggest considering another VPN. But, this led me to realize that using device/machine ID for Gunsafe encryption might not be the best approach. Notice in the link that some browsers will allow trackers to consume your device/machine ID. @bmatusiak What are your thoughts about this? I know you have a hardware based solution, but that won't be viable for my API.
Daniel Raeder
@draeder
I think I'm going to generate a unique cryptographically secure key and store it on the device.. It's no less-secure than using machine ID since both approaches would require physical access to the device, and probably more secure than using machine ID since that ID can get leaked to trackers
6 replies
davay
@davay42

Hey guys! Yesterday I've started building my gift economy section for the @gun-vue project. And got the screen recording shared for those, who would like to see some Vite + Vue 3 + Gun + WindiCSS + Pug web development process. It may be boring and not too professional, but may be useful for those who just start building web apps.

https://youtu.be/z29qSr0YG2I

My idea is to make a decentralized donations platform so users can propose some gifts to other users, which they can approve or reject. The actual transaction should be somewhere in the middle. I build this as a piece of a greater public project funding platform.

If you don't have 4 hours to watch that, here's the SEA design I've came up with.

  1. A user publishes a content-addressed gift proposal {from:'pub1', to:'pub2', qn:'2', ql:'USD', wish:'For you', date: 'timestamp' } to a public graph '#gifts'
  2. the sender saves it's hash to his gun.user().get('gifts').get(hash).put(true) - this verifies the author
  3. Once the receiver gets the funding, he saves the hash to his gun.user().get('gifts').get(hash).put(true) and this means that the donation was successful.

So we can iterate over the list of all gifts reading the 'from' and 'to' fields to check if they are signed by the users and filter them out. Or we can just get a list of gifts for any user just by looking and their user/gifts lists of hashes. And once I get the projects section working, the projects will index the linked gifts hashes too, so we won't need to parse the main ever growing #gifts list, only for some stats maybe.

@amark Is this as a viable GUN data structure for the purpose?

3 replies
Bradley Matusiak
@bmatusiak
@draeder so with keypair.js, it takes data, and converts it to a key, the same is done in the hardware. so we can take the hardware key, generate a key->sharedSecret to itself and use that as the data to create a pair
so keypair(machineID, [ hardwarekey(machineid) , someAdditionalData ]
the hardware key can be used in cli apps with and without using the user interaction option so it can be used in something like a raspberry pi. hardware keys can be duplicated also for running multi Pi systems
Daniel Raeder
@draeder
@bmatusiak Thanks -- I'm just worried that browsers leak my machine ID, and even with additional data, the way I'm using that is the additional data is an index of sorts for keypair.js. This makes my data stored in Gun, encrypted by keypair.js vulnerable to brute force dictionary attacks. This is why I'm going with a randomly generated SEA pair that I store and re-use.
Ilham Gumilang
@ilhamgum
has anyone tried to persist data into MongoDB? Please i need some help
reset forward
@8745215_gitlab
Hey team Gun... I an new to development and was wondering a few things..
I cloned the repo from github, and then followed the gun.js beginners guide. after I was done the html, I have no idea what I am supposed to do...
I would like to set up a p2p for myself and friends.
I know everyone is going to say read this or that, I would love to.. Yet there are complications in doing that...
reset forward
@8745215_gitlab
I don;t want somene to build it for me I just would maybe like things explained a bit better???
Bradley Matusiak
@bmatusiak
yea, this is true, and is why i use a seed file for someAdditionalData. it can be a photo or something encrypted (that is decrypted)
rococtz
@rococtz:matrix.org
[m]
@8745215_gitlab: Sorry, do you want someone to explain the entire documentation to you a bit better? :) Maybe you can try to be more specific. I tried to achieve this small thing. I tried that and that, but I got that particular error. Here is a replicable example I made in jsfiddle.
Honestly, the only thing you can do is to start with the docs https://gun.eco/docs/ and read everything page by page until you feel comfortable