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
verschmelzen
@verschmelzen:matrix.org
[m]
is there a part of the doc that explains how this works root.on('out', {'@': msg['#'], '#': root.ask(open), ok: {rtc: {offer: offer, id: opt.pid}}});?
Carlos Vega
@alterx
Yeah @AlexZan, you can definitely chunk the image, encode it and save it but as the images get bigger it gets more difficult. And also take in account that base64 encoding means your files get 37% larger (https://www.wikiwand.com/en/Base64) due to the fact that it uses sequences of 6 bits but BLOBs use 8 bit sequences
Depending on your use case i'd look into other technologies that are more well suited for this. IPFS is a great example
‹› ‹(•_•)› ‹›
@computervillain_twitter

Can images/video/files be propagated through the gun network or do i need to use something like ipfs?

IPFS public gateways appear to be.. well, no longer public. I was loading lots of content for free. Anyone else seeing that for their projects?

Chandan Das
@champ5898
Is there a way to remove these from console:
WebSocket connection to 'ws://localhost:8765/gun' failed:
WebSocket connection to 'wss://gun-armitro.herokuapp.com/' failed:
WebSocket connection to 'wss://gun-manhattan.herokuapp.com/gun' failed:
WebSocket connection to 'wss://gun-eu.herokuapp.com/gun' failed:
Daniel Raeder
@draeder

@champ5898 We've talked about moving console.log in gun over to an error event handler, but it's lower on the priority list than upgrading gun's DHT. You could potentially turn off all console logging:

let cl = console.log
console.log = {}

// Turn back on:
console.log = cl

But please keep the welcome message unless you are paying for professional support

1 reply
ADAM BLVCK
@adam_blvck:matrix.org
[m]
I agree with @alterx … something which exceeds heap space (2Mbyte files in browser afaik) ought to be uploaded to a CDN, or S3, or even IPFS. Once you’ve encrypted the image (by chunking the base64 files), it doesn’t actually matter where the file is stored, because no one can actually open it
dev1n
@dev1n:matrix.org
[m]
How about something like WebTorrent?
To keep it P2P
1 reply
ADAM BLVCK
@adam_blvck:matrix.org
[m]
@alterx: I have a question for you in React Native. How would you approach resetting the gun instance (ie. creating a new one), if the one which is worked upon is setup in a context provider
Make sure to add a signature of sorts to your encrypted files
I usually just sign the first base64 chunk with the public key of the user sending the file
gunchatbridge
@gunchatbridge
[D]Server Destroyer:
[D]Dyno: Welcome <@181511138519810048>!!! GUN (https://github.com/amark/gun) is a P2P protocol for syncing data used by 8M+ people monthly across Internet Archive, HackerNoon, DTube (decentralized youtube), Notabug (p2p reddit), & more. Please try the 5min tutorial (https://gun.eco/docs/Todo-Dapp) to get started!
dev1n
@dev1n:matrix.org
[m]

I'm having a very mysterious bug, where I'm trying to pass a IGunUserInstance around from a factory function to a client function, but the object seems to be mutated when it exits my factory function.
If I return user.get.bind(user) directly, then there is no problem. But if I return user (const user = gun.user()), then the object outside the factory function is different and "loses" the .get method.

Does this talk to anyone?

The factory function code is:
function userFactory() {
 const user = gun.user()
  return new Promise(resolve => {
    gun.on('auth', () =>{
      console.log(user.get); // fine
      resolve(user);
    });
  });
}
Client function code:
userFactory().then(user => {
  console.log(user.get); // undefined
})
22 replies
DevSalmon
@DevSalmon2_twitter
dev1n
@dev1n:matrix.org
[m]
I believe you but I haven't seen anything like that in the recent years, I would be surprised if this is what I'm hitting in this case.
Jabis Sevon
@jabis
It's not your root cause, but as I said, you're setting up the promise incorrectly, to an event which might never get called, thus your chain remains empty on the .get part as it's actually not resolved
I just noted that I've ran into these weird const issues when dealing with JS prototypal inheritance (chains) earlier, so you might be wise to test :)
dev1n
@dev1n:matrix.org
[m]
If I return user directly (not in a promise), then there is no problem either. I will investigate more later, the problem might be in the framework and not gun.
Jabis Sevon
@jabis
promises change the this property so it might just destroy the binding
this usually being window or global but within gun chain it should be the gun instance
dev1n
@dev1n:matrix.org
[m]
I mean I made a test class with regular properties and methods and it wasn't broken.
Jabis Sevon
@jabis
a test class means zero - you have to look at how gun is constructed :)
2 replies
a lot of pre ES5 stuff happening
especially in the chaining functions
so context switch from window(.Gun) to Promise where you're trying to invoke the reactive gun.on listener easily can lose the actual context
Mark Nadal
@amark
@joshbenaron https://github.com/brysgo/graphql-gun ! Tho it needs to be upgraded to latest version (anyone want to help? I can do a screencall).
@adam_blvck:matrix.org :+1: .
@scorezeny:matrix.org :clap: yay Martti!
@agursoy :clap: @Lexi:matrix.org @alterx @draeder . If you can get them to all connect to the same WiFi network, you can run it all locally! (tho be prepared to deal with SSL certs & junk problems like that).
Meething team has done Audio, so it works, its just that its not easy (requires manually appending buffers, different support in Safari, etc.) without "hiccups".
@draeder :clap: @i001962:matrix.org !
@verschmelzen:matrix.org WebRTC SDPs are mystical, eh? :P I'm shocked I could compress it into such a few lines - were you able to figure it out? GUN might start to confuse your video/audio channels tho, thinking they're valid DAM peers. No? Were you able to get it to work?
@tf2_pyro:matrix.thisisjoes.site :clap: @rococtz:matrix.org . :fire: ;) GUN is smart, glad you like. :clap: @Lexi:matrix.org . Gonna get even smarter with Book's "nearest data pages" too! Hopefully within 6 to 9 months?
@timsim00 :clap: @draeder . & Iris - but its code base is deep. Also, check out @nsreed 's "multiplayer whiteboard with ACL" demo & ask for code link ( https://twitter.com/marknadal/status/1552740681554092033 ).
@mikelun :clap: @Lexi:matrix.org :clap: @alterx . Yes .put( is dumb simple, .set( is a convenience wrapper that covers 2+ "array-like" edge cases: Loosely-Ordered Appends & Mathematical Sets (tables), but likewise, requires more understanding to use / checking docs. I'd love if this could be simplified, but like with ACLs, the nature of these things in any system (centralized or not) have nuances to them. Honestly, that is why I prefer more key/value object stores: they're pretty dumb simple & predictable to use.
@leoncstew :clap: @draeder . RAD is gonna get major update with Book power - so if you're willing, would love help there (and note, meanwhile, RAD is not updated to latest GUN so there are quite a few issues presently).
@acblackburn lovely use case! Correct. 2 things to be aware of / help you out: (A) just put(formData) not put({data: formData}), (B) doing .put(null) nulls out the LINK to the data (GUN is a graph database), it doesn't null the data itself, unless (C) you serialize your formData as a string? (maybe a bad idea), then when you do .put("the form data") and later .put(null) the null overwrites the bytes of the previous string/text, because the data was saved in-place not as a link to another data node.
... still catching up ... will continue more later ...
1 reply
verschmelzen
@verschmelzen:matrix.org
[m]
I guess I have found root.on source code, but I have no idea what happens here 🤷
tedd pasta
@azdez:matrix.org
[m]
is lexical queries fixed yet? i remember trying to paginate and the lex queries did not work as it should have.
DevSalmon
@DevSalmon2_twitter
Hey guys, sorry for this seemingly silly question, but auth on different devices doesn’t seem to work unless I spam sign in, related to https://stackoverflow.com/questions/69070363/gunjs-user-not-getting-authenticated-in-incognito-window. Am I missing something?
Daniel Raeder
@draeder
@azdez:matrix.org I don't think so..Gun's DHT has taken priority, making a lot of progress (incremental though!) with @amark
4 replies
DevSalmon
@DevSalmon2_twitter
Thanks!
Daniel Raeder
@draeder
@DevSalmon2_twitter React has some real weird edge-cases with Gun..
Mark Nadal
@amark
@leoncstew they share the same object constructor so GUN({store: {put: ..., get: ...}
@AlexZan @computervillain_twitter @adam_blvck:matrix.org :clap: @rococtz:matrix.org . It'll do it faster than __, but yeah :clap: @dev1n:matrix.org definitely choose https://github.com/gundb/interop/blob/main/webtorrent/index.html instead, or some other real tech, not the slow junk.
@verschmelzen:matrix.org did you watch the 30min https://gun.eco/docs/Porting-GUN ? @ is ACK, # is msg ID, ok means no error. A new thing (as of this last couple months) is we're officially supporting "hijacking" ACK/OK responses with custom data / behavior, which is how the WebRTC module is generating its SDP negotiation handshake as a RPCed state machine. But as far as GUN / wire, its just ACK / ID / OK. It doesn't know any better.
@champ5898 :clap: @draeder - we're unable to prevent websocket errors from logging tho, that is at the Browser level. @champ5898 are you using AXE? It's undergoing a lot of changes right now. Do you need it? You could turn it off and manually add your own peers.
Can people please remind the Discord server that I'm banned and nobody should be using Discord unless they want to hide from me?
@DevSalmon2_twitter :clap: @dev1n:matrix.org , are you on v0.2020.1238? If not, please upgrade & try again.
@dev1n:matrix.org :clap: @jabis . (Tho did I miss something? Did gitter not load something?). I have no clue how TS works, glad there are others who do.
Yes, as a mathematician, they call all my variables o, t etc. as if I'm a human minifier. But it works, super fast speed, 10K ops/sec on 2015 Air!
@verschmelzen:matrix.org GUN uses the in & out events to message things, while as DAM uses mesh.say(data, peer) and hear things. onto is my event listener/emitter library - its faster than everything else I tested because it does direct function calls rather than using a delegator.
@azdez:matrix.org :+1: @draeder . Willing to donate time adding tests to Book so we can feel safe/confident publishing the new RAD that uses it?
1 reply
Mark Nadal
@amark
@ahg:it-dengler.de ROFL PetiteVue is syncing with GUN without any calls??? How is that possible? If so, sounds like a feature, not a bug?
@acblackburn :clap: @adam_blvck:matrix.org . S3 on v0.2020.1238, or an older one?
@mmalmi did you see the thing about needing api.rs or something in flutter for @VittorioParagallo ? ( @tylerjwatson how's your Rusting going?)
I feel like we should be able to have "only save my friend's data" based-on-pubkey feature in about ~9sh months.
1 reply
voidwalker09
@voidwalker09:matrix.org
[m]
Hi. Can I use gun instead of orbitdb to have a simple key:value store that is mutable ? Does it have http or other kind of api so I can use from a non-js code base?
Mark Nadal
@amark
@voidwalker09:matrix.org it'll be much faster too. There is not an HTTP API built in (that would make it centralized) but I believe @noctrisa @bresnow &https://github.com/lmangani/gunstore.io and a few others have made different/separate modules for that @draeder remember any others? (its pretty easy)
people often don't, because GUN has realtime features - and once you use them, its hard to go back.
voidwalker09
@voidwalker09:matrix.org
[m]
I do not understand how adding a HTTP API control interface would make it centralized ? or gRPC. It
It's just a way of programatically interacting with any other programming language.
verschmelzen
@verschmelzen:matrix.org
[m]

Also I plan to add gun instance override for webrtc.js later so that only people in room (and sharing rooms key) could see the messages. For example pass gunsafe instance to webrtc.js instead of usual gun instance to start communication.

Not sure if that will be useful in upstream, but I will use it for my project

noor aldeen
@nour-dev
hi, how to run gun in node.js peer ?
2 replies
ALEN GEORGE
@alen_george_gitlab
Hi, Does anyone know how we can make gun SSR support?
Daniel Raeder
@draeder
@alen_george_gitlab We are working on scalable source routing .. https://twitter.com/marknadal/status/1557897882988007424
1 reply
ALEN GEORGE
@alen_george_gitlab
Hi, Does anyone know how we can make gun SSR (Server side rendering) support?
CeNiEi
@ceniei:matrix.org
[m]

hi folks!
I am trying to make a react chat application using Gun. I have the following code which is fetching the messages.

  const fetchMess = useCallback((key) => {
    const messages = gun.get(key);
    messages.map().on((m) => {
      console.log(m);
      dispatch({
        type: "add",
        newMessage: {
          name: m.name,
          message: m.message,
          createdAt: m.date,
          key: m.key,
        },
      });
    });
  }, []);

For some reason, the callback for on is being fired multiple times for every message, the first time I am calling this function. This is messing up the message list, since the dispatch (responsible for changing the state of the message list; from the useReducer hook) is mutating the message list multiple times.

Any work around for this?

Jabis Sevon
@jabis
@ceniei:matrix.org use some schema enforcing, and function debouncing within a set time period to avoid multiple dispatches