Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 05 10:50
    davidmaxwaterman commented #636
  • Oct 05 09:25
    worldpeaceenginelabs updated the wiki
  • Oct 04 00:29
    soulofmischief updated the wiki
  • Oct 03 16:40
    DvilDmonPsyAres edited #1284
  • Oct 03 16:39
    DvilDmonPsyAres edited #1284
  • Oct 03 16:38
    DvilDmonPsyAres opened #1284
  • Oct 03 09:16
    expelledboy commented #1277
  • Sep 30 03:31
    Alengeorge-01 commented #1279
  • Sep 29 21:58
    draeder commented #1279
  • Sep 29 21:55
    draeder commented #1279
  • Sep 28 07:58
    mmalmi commented #1282
  • Sep 28 04:07
    Alengeorge-01 commented #1279
  • Sep 28 04:07
    Alengeorge-01 commented #1279
  • Sep 28 04:06
    Alengeorge-01 commented #1279
  • Sep 27 23:41
    amark closed #1283
  • Sep 27 23:41
    amark commented #1283
  • Sep 27 23:39
    amark commented #1280
  • Sep 27 23:25
    amark edited #1279
  • Sep 27 23:24
    amark commented #1279
  • Sep 27 23:21
    amark closed #1273
Mark Nadal
@amark
Oh, @snowycoder:matrix.org please don't reply in threads if you want me to personally see it or reply.
WebRTC signaling is baked into the core of GUN's messaging protocol, because its treated as any other type of message: it, like anything else, gets relayed. All peers relay (a NodeJS peer runs the same logic as browser peers). So even without a DHT, things still work. The DHT will just bring better efficiency/routing.
This 30min talk (15min on 2X) explains the base (brute force) layer very quickly: https://gun.eco/docs/Porting-GUN , then the next layer is DAM (Daisy-chain Ad-hoc Mesh-network) which adds a ton of improvement, then the next layer is the pub/sub pieces in AXE, then the final layer will be the DHT. After you watched the talk, I'll send you links for the other explanations.
entermonke
@entermonke:matrix.org
[m]
great reply
@amark: globally unique names may or may not be against something with how brains work but they work a hell of a lot better than keys. Hence most use DNS and not ip addresses and god help them ipv6
entermonke
@entermonke:matrix.org
[m]
and the other perspective a key is just a unique name, a unique name that is both hard to remember and relay written or spoken
you won't succeed with any platform that doesn't have a name system
people want something like marknadal@twitter etc
rococtz
@rococtz:matrix.org
[m]
entermonke: you cannot have unique name AND offline functionality, it's just not possible
entermonke
@entermonke:matrix.org
[m]
of course you can, what are you proposing won't work offline?
Snowy
@snowycoder:matrix.org
[m]
@amark: Thanks, I'll look into it
Kevin
@Leo24535831_twitter
is there any course to learn gun js completely?
Manwë
@Manwe-777
You can have something like ENS and cache the responses, but it won't be "offline first", still I think its good
Kevin
@Leo24535831_twitter
Warning: reusing same fs store and options as 1st.
what does it mean?
@amark: thxs for the links but gundbclub has no public repository
Bradley Matusiak
@bmatusiak
@entermonke:matrix.org @rococtz:matrix.org there are methods to uniquely identify alias, my method takes the pubkey, and converts it to a number, this gives a pubkey a "somewhat unique" ID, using this ID combined with alias bring it to a more unique pointer. this allows me to pick a pubkey out of a list of alias
poiyo
@poiyo:matrix.org
[m]
do objects with many keys take longer to query?
nix
@quixnix:matrix.org
[m]
most of the examples use embedded scripts in html files. maybe something with my imports?
import express from "express"
import path from "node:path"
import Gun from "gun"
import { randomUUID } from "node:crypto"

const app = express()
var gundb = Gun()
rococtz
@rococtz:matrix.org
[m]
poiyo: It shouldn't. Gun queries are O(1)
1 reply
entermonke
@entermonke:matrix.org
[m]
where is the code for AXE?
H
@hadrienmp:matrix.org
[m]
Hello everyone ! Is there a way to stop "listening" on changes ? For example I did gun.get('room1').map().on.... Is there a way to stop getting updates ?
Daniel Raeder
@draeder
Improve your terminal app's vision with some vitamin A thanks to carets.. Wrote this so I can finish gunsafe's CLI example..
@hadrienmp:matrix.org gun.get('room1').map().off()
1 reply
Suleiman Zhukov
@SuleimanZhukov
@draeder @rococtz:matrix.org @bmatusiak @Manwe-777 @ilhamgum
Guys, what is this error Only a node can be linked! Not "undefined"!?
Daniel Raeder
@draeder
@SuleimanZhukov weird error! Can you share the code where it is happening?
@SuleimanZhukov Hmm.. looks like this is from lib/promise.js, which is an external lib dependency... What do you need it for?
8 replies
0xjimmy.eth
@DecentralisedTech
Hello
0xjimmy.eth
@DecentralisedTech
Where the the pass used in gun.user.create, Is the pass used only clientside?
Looking to use Metamask to create a session, would make sense to generate a keypair, and then ask the user to sign a message with Metamask to say they are using the current keypair
Daniel Raeder
@draeder
@DecentralisedTech gun.user().create() is essentially the same as SEA.pair(), which is a primitive of Gun, but user.create() provides developers with a familiar username/password interface. If you have a SEA pair, you can log into Gun wherever you are, local or not...
N
@nicholasoxford
Has anyone seen a work gun + Deno demo?
4 replies
Azarattum
@azarattum:matrix.org
[m]
Is there a way to see how many peers are connected to an app at the moment? And also is there some kind of sync acknowledgment from a peer?
2 replies
Sarah Kay
@SarahKay99

@Lexi:matrix.org JS set not compatible :(
@renji3:matrix.org :clap: @draeder :+1: @rococtz:matrix.org important words I strongly agree with. await gun.user(pubKey).get('epub')
@bresnow WebRTC ~ 6, but non-WebRTC ~ 10K
@Manwe-777 wouldn't you have to know the hash to lookup the login, but you won't know the hash until after login?
@hownowbrowncow_8635:matrix.org it gets cached locally, yes.
@Azarattum @azarattum:matrix.org :clap: @Lexi:matrix.org . Expiry, yupe. Else you'd need to have a 2nd index that you lookup that is a ban list.
lookups in GUN are O(1), so they're efficient.
Glad you're asking for help at 5min!
isn't your .on( getting called with both?
Oh wow, I haven't seen that github issues in years I thought it was closed... had no clue people were responding in it. (At some point... GitHub notifications just stopped/broke).
@Omarabuziad thanks for reminding a Q if it got missed! We're not perfect, so its very much appreciated if anyone just re-asks.
:clap: @bmatusiak @draeder . If you are on a permanent machine, then fs RAD is good enough. If you are on a machine that gets wiped/deleted every X hours, you probably want a backup in case not enough browsers are online.
@SarahKay99 looks correct. :clap: @rococtz:matrix.org . Not sure why not. does npm start 1337 work?
@SamiLaayouni_twitter possibly the login bug... if you hit login 3+ times, does it login?
@useWallie_twitter you should check out @davay42 's cool vue component that does that!
@SarahKay99 the Fireship chat app was public, so anyone can add/update the table, they just can't modify the message itself. With DM, you don't want a public table, so you either (A) have to https://gun.eco/docs/SEA.certify user A can edit user B's table that they both chat on or safer/better (B) "thread" the chats, by saving userA.get(userBpubKey).set(chat); and userB.get(userApubKey).set(chat)then you .map().on(function thread(){ ... on both and pass both into the UI, that you sort. Then later on you'll want to use LEX to paginate the chat (right now this may be a bit buggy... but we're working on some cool new features to make this rock solid).

Thanks so much Mark! I got the server running, the problem was i didnt npm install . as for the chat app issue i will rethink my code. tysm

rococtz
@rococtz:matrix.org
[m]
Azarattum: Gun uses WebRTC AND websockets under the hood. Yes, you really have to implement a heartbeat system where the users who want to be discovered simply register themselves every X seconds/minutes against some list say "I'm online" so others can see they are online
yorreraj
@yorreraj
Hi, can someone help me why the onDisconnect() doesn't fire after closing the browser or tab
and also the connected() does not trigger when we reconnect to the server even if we make a change in the data
yorreraj
@yorreraj
@amark
Lexi
@Lexi:matrix.org
[m]

I guess I don’t understand something. Isn’t there some kind of a built in mechanism for peer discovery?

That's the plan for AXE. Don't know how far it's done already.

Does it just use the list you provide and that’s it?

The list of peers in the GUN constructor? Yes, except if using AXE which is default.

I thought gun uses webRTC under the hood, so shouldn’t the connections information be already available?

WebRTC is used for p2p communication between browsers. For browser ↔️ NodeJS clients websockets are used. Remember to import lib/webrtc.js to enable WebRTC and even then it might not work for the current version. Would be cool if you'd test it and report back!

Does the ack in put comes from a remote peer?

I'm guessing it comes from one or all of the peers set up in the GUN constructor. If it's not properly described on the API could you report back? Extra points for testing and finding out again :-) That's kinda how it works for unstable GUN right now :\

Is there a way to know that an entire database is in sync? Let’s say I have a client making changes. I want to show user a spinner until his changes are successfully propagated through the network. (Or at least to the nearest relay peer)

The latter point is easy. As I said there's the ack callback for that in put(). The former could be done by recording the datetime of the last complete sync. Would that be what you want?

5 replies
tedd pasta
@azdez:matrix.org
[m]
can anyone tell me why i am getting a status 400 with the route /gun
require('dotenv').config()
const express = require('express')
const Gun = require('gun')
const cors = require('cors')

const app = express()

app.use(cors())
app.get('/', (req, res) => {
    return res.status(200).json('success')
})
app.use(Gun.serve)
app.get('*', (req, res) => {
    return res.status(400).json('unsuccessful')
})
Gun({web: app.listen(Number(process.env.PORT), '0.0.0.0'), radisk: true, file: './folder'})

console.log('Server started on port ' + process.env.PORT + ' with /gun')
trying to make my own gun relay with storage saved to disk. but the /gun route always gives me a 400
Daniel Raeder
@draeder
I've finished Gunsafe .. the example CLI might be a little buggy at times, and there appears to be a parsing issue with multiline documents that contain special characters.. but it's a start.
I wrote Carets to make working with multiline objects from the CLI for gunsafe a little less painful than readline and/or stdin by themselves
Azarattum
@azarattum:matrix.org
[m]
I’ve seen talks where Mark mentions AXE, but didn’t quite understand how exactly it is supposed to work from a technical (not conceptual) perspective.
3 replies
Also, ideologically, is GUN supposed to be one giant network or each application should implement it’s own network on top of GUN with it’s own rules?
3 replies
rococtz
@rococtz:matrix.org
[m]
Azarattum: AXE is part of the core of Gun. Some parts are working, some are missing, some are buggy. In the future, Gun is supposed to be a gigantic network with thousands of relays
entermonke
@entermonke:matrix.org
[m]
@mmalmi: impressed with iris's progress would be good if you had a matrix room to discuss it, iris has problems retaining content
fractal
@fractal:matrix.org
[m]
yes i like iris as well... been checking out a lot of projects and it is one of my favorite finds
fractal
@fractal:matrix.org
[m]
oh hey Evan
Evan
@evan-brass:matrix.org
[m]
Ahoy!
I heard there might be some juicy WebRTC DHT treasure going on here. Where could I start reading to get up to speed?
1 reply