Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Pape666
@Pape666
does gun work with react native? Or (this might be a stretch since its not js) does it work with flutter?
rococtz
@rococtz:matrix.org
[m]
@Pape666: it definitely works with react-native, not sure about Flutter
Pape666
@Pape666
oh perfect thank you!
rococtz
@rococtz:matrix.org
[m]
👍️
equivalent_log_5626
@equivalent_log_5626:matrix.org
[m]
The other day I asked if I could do this with gun? A collaborative, crowd-sourced, distributed database of metadata, something like a distributed musicbrainz. When a user changes his metadata the change can be approved by voting on it by the other users, and when changes are approved they propagate to the other databases.
And you told me:
yes, sounds doable
but I don't think they "propagate" after approval. More likely the other databases would only listen to changes that are marked as approved
So to make the voting system I would only have to count votes for a modification in the database.
What if I wanted to have a list of moderator ids in the database
equivalent_log_5626
@equivalent_log_5626:matrix.org
[m]
How do I make sure no one can change that list of moderator ids in the database?
Daniel Raeder
@draeder
@equivalent_log_5626:matrix.org Create a user or SEA pair for your app, then log in as that user or with that SEA pair, and put the moderators to that user's graph. Only the app can modify the list.
equivalent_log_5626
@equivalent_log_5626:matrix.org
[m]
:point_up: Edit: What if I wanted to have a list of moderator ids in the database so that they could approve or reject submissions skipping the voting.
neilecm
@neilecm
Guys, is anyone using a blockchain to create a decentralized chat application using gun? I am trying to build it, but honestly, I am so dumb!
rococtz
@rococtz:matrix.org
[m]
equivalent_log_5626: What @draeder said + use SEA.certify so only those users can vote (or tell the people listening "only trust these people") but I feel it's easier to tell them "trust everybody who can vote" and make sure only your people can vote using SEA.certify
Alex Zanfir
@AlexZan
how can i get an array of my set (will eventually use pagination), but for now just a plain array of my set? something similar to what synclist did, but just a plain array for now
rococtz
@rococtz:matrix.org
[m]
TranHBach
@TranHBach
When i import GUN into my React project. It shows this warning:
WARNING in ./node_modules/gun/gun.js 6:17-29
Critical dependency: the request of a dependency is an expression
TranHBach
@TranHBach
can anyone help me with this?
Suleiman Zhukov
@SuleimanZhukov
So, gun won't show you the data.
Then how can I get/retrieve all the users I have created?
I tried gun.map().once(cb), doesn't work
rococtz
@rococtz:matrix.org
[m]
@SuleimanZhukov: You have to index them yourself manually
renji3
@renji3:matrix.org
[m]
I'm currently missing an error handling mechanism on gun.get("foo").once()
how do I know that i failed for example when loading a user graph that I don't have access to
Suleiman Zhukov
@SuleimanZhukov
@rococtz:matrix.org Thanks
Chacko at Vyrb
@chacko1_gitlab
Hello, can someone please point me to sample code for a node.js peer with a store such as LevelDB? Thanks so much.
Suleiman Zhukov
@SuleimanZhukov

How Gun stores data? I mean, if I have 1MB of data (and let's say hypothetically I only have 1MB of free space), does it store it like 200KB on my machine, 200KM on other machine and so on, OR, does it store it 1MB on my machine, and then a copy of 1MB in other machine and so on?

And what if I had more then 1MB of free space, does it store data the same way?

K L
@KLorek__twitter

Hi, I'm trying to test my app on local server. I used VSCode and it put the app under the address: http://127.0.0.1:5500/ . I deduced that at the beginning of my code I should put the line: gun = Gun(['http://127.0.0.1:5500/gun']); . I did and then I opened two browser tabs and tried to see if they both have access to the same gun node, but they don't. In the console I'm getting the error: "Firefox can’t establish a connection to the server at ws://127.0.0.1:5500/gun."

What am I doing wrong?

1 reply
Omarabuziad
@Omarabuziad
it seems that there is a bug right now, yesterday I made like a simple chat app, i create a messages node and I let 2 users(separate browser tabs) add messages to this node and I show the messages in both browser windows and its work fine, now when I open the app , when i add a message, the other browser window can not retrive the data from that node, only the same browser window which add the data can retrieve it , any feedback ?
TranHBach
@TranHBach
The documentation said that i shouldn't use path. So what should I use instead for the same functionality?
rococtz
@rococtz:matrix.org
[m]
renji3: There is no such thing as not having access. In gun, everything is public read by everyone. It might turn out that the data you read from some user is encrypted in which case you have to decrypt it but that shouldn't be unexpected.
@chacko1_gitlab a simple google search revealed this repo but it hasn't been touched in 4 years
@SuleimanZhukov Gun doesn't care about how much storage space you have. If it needs to store something, it will try to store it anyway. If you ran out of space, it will throw error and fail.
@TranHBach Instead of path you use get
2 replies
haveanicedavid
@haveanicedavid:matrix.org
[m]
Is there any way to save a string starting with a # hashtag in gun? I'm trying to index some nodes on markdown strings to take advantage of LEX queries, and # headers seem to break gun ('Data hash not same as hash!'). Anyone run into this?
rococtz
@rococtz:matrix.org
[m]
haveanicedavid: it's because of Content Addressing, that's why it happens. You can try to do what we have been doing with URLs for years:
encodeURIComponent('#') // => '%23'
1 reply
of course, don't forget to sanitize it before rendering!
TranHBach
@TranHBach
what does sea.secret() do?
Mark Nadal
@amark
@AlexZan he was great. Sad stories tho :(
@blwtxc were you able to get a test setup? Ping me occasionally on twitter @marknadal DM until I'm free and we can do it together if need be.
@haveanicedavid:matrix.org @estebanrfp @manwe777:matrix.org The next person after me, who has been most helpful to gun.js core is @rogowski . Core is meant to be used, performant, small. Readability is not a goal.
@AlexZan :clap: @rococtz:matrix.org .
@Pape666 :clap: @rococtz:matrix.org .
@equivalent_log_5626:matrix.org :clap: @draeder :+1: @rococtz:matrix.org (You're on :fire: :fire: :fire: !!!!! :heart: ). Like with any database (mongo, firebase, sql, etc.) they don't come pre-programmed with vote-based moderation, you'll have to build that out.
@neilecm you'd just use GUN, not a blockchain - they are too slow for chat.
@TranHBach hey @bmatusiak do you know how to force webpack/etc. or whatever React uses these days to use the pre-built version listed in the package.json ? Every 6 months they change something that breaks stuff.
@SuleimanZhukov :clap: @rococtz:matrix.org .
@renji3:matrix.org Good Q, :clap: @rococtz:matrix.org , that is correct. Also note .put(data, function(ack){ console.log(ack.err has errors ( @SuleimanZhukov ), but reads do not - instead, you'll get webRTC/websocket errors if the connection drops.
@chacko1_gitlab levelDB is no longer supported :( sorry, however Jonathan and I are working on an upgraded version of RAD and we might support levelDB again after that.
@SuleimanZhukov :clap: @rococtz:matrix.org . Even if it is saved on another device, you should handle errors.
@KLorek__twitter :clap: @KLorek__twitter yay you figured it out! :)
@Omarabuziad are your browser tabs connected? :/
@TranHBach :clap: @rococtz:matrix.org
@haveanicedavid:matrix.org :clap: @rococtz:matrix.org . Note, it is SEA that enforces this, not GUN by itself. But most people have SEA running so... oye.
@TranHBach helps 2 people send encrypted messages to each other :) https://gun.eco/docs/SEA
Suleiman Zhukov
@SuleimanZhukov
Still confused! @rococtz:matrix.org @amark @draeder
How does Gun store data, for example you want to store 1GB, how would it store it?
1GB on every machine (So, copy on my machine and copies on every other machine that wants the data), OR it will be cut in pieces and these pieces will be stored on different machines?
Suleiman Zhukov
@SuleimanZhukov
@amark @rococtz:matrix.org @draeder
Another question not related to the previous one:
How do I make sure my browser tabs are connected?
Daniel Raeder
@draeder
@SuleimanZhukov As far as I understand all peers that are subscribed to the data will store it.
Suleiman Zhukov
@SuleimanZhukov
@draeder Thank you for the answer
Omarabuziad
@Omarabuziad

gun.get("users") gun.get("users").get("user1").put({name:user1}) gun.get("users").get("user2").put({name:user3}) gun.get("users").get("user3").put({name:user3})

why when i use
gun.get("users").map().on( (data)=> { console.log(data.name)})
the console log execute 9 time at the first when i use it inside useEffect

Bo
@worldpeaceenginelabs

Hey hey,

i went into the Matrix.org concept. Could someone elaborate the differences between Matrix and Gun? Are they compatible? Are there different scenarios, were you would prefer Matrix over Gun or vice versa? Any example of a good hybrid project? (Matrix and Gun combined)

Bo
@worldpeaceenginelabs
image.png

@amark

this is build on Matrix. Can Gun accomblish that too? If yes, how? Which gun setting i mean.

Do you remember Jacob Rosenthal? This is what he meant with user-owned data... This should be the new paradigm, definitly... We all paying for our free access/usage with our privacy/data... Especially today, we are sharing stuff on our cloud-based note apps, which we 20 years ago, would never ever have shared on something, which the host could actually read, or make available to government entities.

Suleiman Zhukov
@SuleimanZhukov
How can I use socket.io with Gun database? Is it even possible?
Suleiman Zhukov
@SuleimanZhukov
And is it better to use socket.io with Gun database?
@amark @draeder @rococtz:matrix.org
Guys?
Bradley Matusiak
@bmatusiak
@amark require("gun") gives me
WARNING in ./node_modules/gun/gun.js 5:16-28
Critical dependency: the request of a dependency is an expression
 @ ./node_modules/gun/browser.js 1:0-36
do you want me to build a webpack example in the example folder?
Bradley Matusiak
@bmatusiak
and i dont use 'react' building tools.