Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 19 18:24
    julesl23 opened #1192
  • Jan 16 08:22
    davay42 updated the wiki
  • Jan 16 08:20
    davay42 updated the wiki
  • Jan 16 06:22
    Orimay opened #1191
  • Jan 16 05:22

    amark on master

    Update README.md (#1181) (compare)

  • Jan 16 05:22
    amark closed #1181
  • Jan 16 05:22
    amark commented #1181
  • Jan 15 00:46
    mbround18 commented #404
  • Jan 15 00:39
    mbround18 commented #404
  • Jan 15 00:38
    mbround18 commented #404
  • Jan 15 00:38
    mbround18 commented #404
  • Jan 15 00:38
    mbround18 commented #404
  • Jan 15 00:29
    mbround18 commented #404
  • Jan 14 23:39
    Orimay synchronize #1189
  • Jan 14 23:36
    Orimay synchronize #1189
  • Jan 14 23:35
    Orimay synchronize #1189
  • Jan 14 14:13
    shemeshg edited #1190
  • Jan 14 12:55
    shemeshg opened #1190
  • Jan 14 12:54
    soulsam480 commented #1174
  • Jan 14 12:51
    shemeshg closed #1188
Connor Davis
@connor-davis
Hello everyone, I am back from a couple weeks break back to continue sharing progress on improving LoneWolf and further creating p2p applications and systems!
1 reply
Daniel Raeder
@draeder
I've been trying to wrap my head around using DAM. I would like to be able to use the underlying wires between peers (not relay peers, but user peers). The documentation is not very clear on how to do this. Any direction would be appreciated!
Ally Jr
@3210jr
Hey all, has there been any work with using Realm with Gun?
Jonathan Green
@ALLiDoizCode
Does anyone have a good use case for GunDB when it comes to gaming?
3 replies
Jules Lai
@julesl23
It be really nice for open/load to have a depth parameter, e.g. .load(cb, {depth: 3}) would only load data from up to 3 nodes down the chain. Anyone know of a neat way to to do this using existing API?
3 replies
Daniel Raeder
@draeder

I've been trying to wrap my head around using DAM. I would like to be able to use the underlying wires between peers (not relay peers, but user peers). The documentation is not very clear on how to do this. Any direction would be appreciated!

What I'm trying to do is use DAM for Bugoff instead of webtorrent. This way, I can keep things all Gun based. If I could tap into DAM peer wire communication, then I shouldn't have to worry about full vs partial mesh. Otherwise, I'll have to also build a gossip protocol, and some kind of peer routing DHT, which doesn't make a lot of sense since DAM already does it!

2 replies
Michael
@mbround18
Anyone know a good way to share encrypted data between users? Like from the user space? Or ideally, create an encrypted shared user space that could add users as needed?
rogowski
@rogowski
Hi! @mbround18
You can create a key pair and share with the users or create a secret like here: https://gun.eco/docs/SEA
Hope this helps.
Poweron365
@techpro864:matrix.org
[m]
Hey, I was wondering if there would be any interest in a free service that can create unlimited gun peers and host them forever. Maybe even a gun storage adapter that could add persistence? Idk but if anyone would like that lmk.
jerl jerl
@jerl__gitlab
hey could I get an invite to the discord? I couldnt find it anywhere
1 reply
jerl jerl
@jerl__gitlab
also btw chat.gun.eco doesn't seem to load anymore
Gianmarco Turchiano
@GianmarcoTurchiano
Hi guys, just one quick question: is my understanding that if an object has even just one property initialized to "undefined", the .put() method will not work on it correct?
Gianmarco Turchiano
@GianmarcoTurchiano

Hi guys, just one quick question: is my understanding that if an object has even just one property initialized to "undefined", the .put() method will not work on it correct?

If that wasn't clear, here's an example. Should such cases be avoided?

            const test = {
                en: "hello",
                es: "hola",
                fr: "salut",
                it: undefined
            };

            gun.put(test);
Daniel Raeder
@draeder
@GianmarcoTurchiano I believe your issue is that you are trying to put an object to the root node. Try: gun.get('languages').put(test)
If that doesn't work you can stringify it: gun.get('languages').put(JSON.stringify(test)), but you would need to parse it later to use the properties.
Gianmarco Turchiano
@GianmarcoTurchiano

@GianmarcoTurchiano I believe your issue is that you are trying to put an object to the root node. Try: gun.get('languages').put(test)

That's actually what I tried in the first place, I did this with the root node just to keep the example as straightforward as possible. To elaborate further, I'm having this problem because I'm using Typescript, which allows for a class to have optional parameters (such as public readonly it?: string). It's not as I absolutely must do it like this, I could simply initialize it to an empty string, but I'd like to know if that's absolutely necessary.

Daniel Raeder
@draeder
As far as I know from my testing, you can't put an undefined property value. The reason for this is objects get flattened out in the graph and each property becomes its own their own graph node, I'm pretty sure
Gianmarco Turchiano
@GianmarcoTurchiano
Got it. Thank you very much :)
2 replies
Orimay
@Orimay

@amark, but how do these peers connect to each other? WebSocket is client to server only. WebRTC is full-mesh only (correct?). How do you make peers connect to each other and not use relay servers as the TURN ones?

Well, null may be even larger on 64 bit systems, than the 0 integer of 32 bits. Was weird to find out that boolean is also 32 bits long.

BTW, in the GUN sources, you complain that you can't store +/- Infinity. Well, you can. You already store soul links in a JSON object. You could use the same approach to serialize +/- Infinity, NaN, and whatever else you desire. Just use an object with some specific format.

Well, there's not much I changed to support undefined values. Just a couple of changes here and there. It was hard to find those places, that were taking care of actually storing data. And I was really glad to find out that it is possible to reduce the utilization of storage. I tested this branch locally, but I have a problem running mocha, I'm getting spammed with

 err: [Error: EPERM: operation not permitted, rename 'D:\MEGA\Development\Projects\gun\radatatest-%1C-3rf.tmp' -> 'D:\MEGA\Development\Projects\gun\radatatest\%1C']

and such :c

I'm not really sure what magic of useEffect you mean - to me that function is pretty straightforward. You pass it a callback to run initially and whenever one of its dependencies changes (if any). And, optionally, return a cleanup callback:

useEffect(() => {
  // do your stuff when dependencies change
  return () => { /* cleanup */ }; // optional
}, [zero or more comma-separated dependencies]);

No magic here!

BTW, the master branch doesn't really like browser mode, as it has no built-in Buffer. I fixed it locally. I haven't created a pull request to fix it though :/

@draeder, I worked with Angular and React, and saw Svelte. But I would suggest using Vue 3. It's a breeze. And Tailwind CSS 3 for design

Daniel Raeder
@draeder
@Orimay I just prefer backend dev than web design in general.. As for WebRTC being full mesh, that depends on how you use it. For instance, right now I'm working on creating a partial-mesh using simple-peer with a k-bucket DHT implementation that will provide message routing from peer A to peer Z via a k-bucket lookup. I haven't fully worked out how I'm going to do this in Gun, but my thinking is that each peer will keep an updated k-bucket in their graph. When peer A needs to send a message to peer Z, peer A's neighbor will tell peer A which peer it knows about that has a hash close to peer Z's hash.. That's basically how WebTorrent DHT works in a nutshell. I think I can pull it off.. but getting the peers connected with simple-peer isn't that simple :).. I've done it before, I just lost my code..
17 replies
rococtz
@rococtz:matrix.org
[m]
@mbround18: Check out this example I wrote a while ago:
https://github.com/amark/gun/wiki/Snippets#multiple-people-encryption
Poweron365: I would totally be interested in hosted gun for free for ever, but would support the costs?
If you offer it for free, who's actually paying for it so those people can get it for free?
Jules Lai
@julesl23

Strange bug: I'm getting the situation where

await posts.then()

becomes stuck and no results are returned. This happens for chains with five or more nodes deep. However

posts.once()
await posts.then()

works all the time. Why would this be happening?

Gabriel Hayes
@piboistudios
@amark whats the status of AXE
Fabio Nolasco
@fabionolasco
Suppose that a chat made with Gun already has 200Mb of text. When a new person join the chat, will Gun get the latest 5Mb of data stored on other nodes order by date DESC? How does that work? - sorry, but I am quite new to this.
Jules Lai
@julesl23
I've got a simple test example where await posts.then() just crashes out. I'll raise an issue
2 replies
rococtz
@rococtz:matrix.org
[m]
@fabionolasco: Gun doesn't have any mechanism for that (I hope I understand your question). If a gun peer subscribes to a piece of data, it will make a copy of it, all of it. It doesn't order anything. If it runs out of space, it will probably start throwing errors so it's up to you to manage the storage.
Gabriel Hayes
@piboistudios

@amark Wow, so I'm reading the AXE whitepaper.

I think, if you somehow combined this with my (probably not original) idea of turning users into miners, you could make it such that users can pay the fees for servers by mining (some external value) in some form or fashion (in the case, for example, that they don't want to pay to connect to the internet usernet :))

Also, maybe (and maybe I missed this) it would be helpful to talk more about Gun without AXE vs Gun with AXE. Just as an example, I am just guessing (And only 70% certain) that the PoP miners/servers in an AXE chain would basically be Gun peers
Aspirational
@aspirational:matrix.org
[m]
@amark: Hey, I am curious to update brysgo/graphql-gun#129 and .open .load modules , but I am new to vanilla js (I am clojurescript dev), so ? can smb point me to examples of rewriting old internal utility functions ( obj . map; obj; list; ... etc )
or explain me in a nutshell what has come to replace them or point the finger where I can research it. thx. I have no time to a call. sorry. thx
Kier
@syonfox

Hey so just building out my user system.... is there a proper way to save the user for later or creat an new gun.user instance

the problem is

let user = gun.user().auth('alice', 'password');
//then later 
let g = await SEA.pair()

let room = gun.user().auth(g);
//setup room
//now user.is == room.is :(
//but I'm still in Alice browser tab and now want to do stuff as Alice
//what is the proper way to do this what I want is for room to be a new instance so my reference to the Alice user is not overwritten

//do i just need to make a new instance of gun?
//or save Alice's password in memory?
26 replies
Gabriel Hayes
@piboistudios
@amark Also 10.2 on double spending. Do you suppose Tendermint could be used for this? (to keep it all in-house, for example)
Gabriel Hayes
@piboistudios

Also, 13.2, I am pretty sure the last sentence should say:

13.2. End Peers.
There are no “exit nodes” to manipulate the system, and no peer can force another peer
to send data. Even if an end peer colludes with a server, it still has to prove that it
received data or else the sending peer would abandon the bid. The only interesting attack
would require stealing the end peer’s sending peer's private key.

1 reply
Timur
@TSecretT
Just discovered GUN and trying to understand the concept: What is the best approach for storing user's private key? Im using ReactJS
11 replies
Ikenna
@carterax
I know how users are entitled to their own data on GUN but i have a situation where when a certain condition is met users shouldn't be able to modify a record, now i went through issues on github and i came across this amark/gun#290 which shows how to turn off writes on the browser, is there a way to apply this per user?
Gabriel Hayes
@piboistudios
@carterax A user's graph, by default, is only modifiable by them. You would just use a user's graph, and then issue out certificates from that user (to users who are allowed to write)
6 replies
If you need it read-protected, encrypt it
tedd pasta
@azdez:matrix.org
[m]
@amark: is the npm version of gun not the same version as the github repo?
@amark: never mind, they are both the same version
tedd pasta
@azdez:matrix.org
[m]
when i clone the github gun repo, i see my merged changes, but when i npm install gun, my merged changes are not there
strange
oh i see npm has the same version as the github repo but npm doesn't add changes until the version number is increased
would you be able to push the latest stuff to npm? for now i will use the github version
kislball
@kislball
did anyone manage to run gun on deno>
?
rogowski
@rogowski
@kislball some time ago someone commented that the crypto part was still not complete enough (something like that). I don't know how it is currently.
atordvairn
@atordvairn
can anybody suggest what's the best way to store image on gun ?
2 replies
Lexi
@Lexi:matrix.org
[m]

In the API of the documentation it says

Unexpected behavior

If you do not use a schema with .open(cb) it can only best guess and approximate whether the data is fully loaded or not.

What kind of schema is meant there? I could not find any other mentions of a schema in the API documentation.

Anesu
@itsanesup_twitter

Hi all,

I have been having issues trying to keep my data persistent when all users are disconnected. It took me a while to figure this out (maybe a week on and off (or so) as I didn't know what I might have been doing wrong). I currently have server peers for this purpose. It appears that they don't remember the data they saved until you restart them. It seems only then do they load this data.

For example, I have a chat app. I log-in and send a message. It appears in the other side's chat box and the servers save this message. I then close both clients and clear their cache (or using incognito window and a guest window for true 2 users test). I then go back to try to log-in and now I can't. If I create a new user account I ca'nt see the other messages.

It's only until I go to restart one of the relay/persistent servers does the chat data suddenly show up. Similarly, if I was at the log-in screen this would be when that suddenly works now.

Hi all,

Sorry to bump this, but felt like it was going to be buried as I never got any suggestions on this . This seems like a pretty important pat of this whole thing. I have essentially moved away from using this for now for my production project because of this. But I would like to revisit this later. Any suggestions to this?

2 replies