Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 24 23:36
    syonfox updated the wiki
  • Sep 23 21:10
    qgustavor commented #1280
  • Sep 23 21:06
    qgustavor commented #1280
  • Sep 23 21:05
    qgustavor commented #1280
  • Sep 23 20:57
    qgustavor commented #1280
  • Sep 23 20:40
    draeder commented #1282
  • Sep 23 20:38
    draeder commented #1280
  • Sep 23 20:36
    draeder commented #1283
  • Sep 23 10:21
    Codzaa opened #1283
  • Sep 23 02:25
    qgustavor commented #1280
  • Sep 21 09:26
    mmalmi opened #1282
  • Sep 19 21:08
    thiago-hs closed #1281
  • Sep 19 19:48
    thiago-hs edited #1281
  • Sep 19 19:33
    thiago-hs edited #1281
  • Sep 19 19:33
    thiago-hs opened #1281
  • Sep 18 20:15
    qgustavor opened #1280
  • Sep 15 05:02
    Alengeorge-01 edited #1279
  • Sep 13 21:32
    csharpner updated the wiki
  • Sep 13 08:12
    Alengeorge-01 opened #1279
  • Sep 12 13:13
    1MaddieX updated the wiki
Bo
@worldpeaceenginelabs
In case you want to run a desktop gun relay (example: https://github.com/worldpeaceenginelabs/ELECTRON-GUN ) then at https://www.noip.com/ you can get a free dynamic dns account for your changing public address.
Daniel Raeder
@draeder
@thiago-hs Locally Gun uses multicast to connect peers together. There is no need for a relay. It is enabled by default. To disable, const gun = new Gun( { multicast: false } )
2 replies
Thiago Silva
@thiago-hs
Cool !!! Thank you so much, this helped me a lot.
Lexi
@Lexi:matrix.org
[m]
However since a webpage or webapp needs a server to load it from that server might as well be the relay peer. Can be on local network only, too
AFAIK GUN's multicast feature is for NodeJS/relay peers to connect to other NodeJS peers directly per LAN multicast instead of through the internet
Daniel Raeder
@draeder

However since a webpage or webapp needs a server to load it from that server might as well be the relay peer. Can be on local network only, too

Exactly @Lexi:matrix.org, and you are correct about the Node JS peers, but browser peers will be able to connect to that local Node JS peer if its IP address and port is instantiated in the browser with let gun = new gun( { peers: ['http://localpeerIP/gun'] }

Thiago Silva
@thiago-hs
This multicast feature would work for a react native app ?
2 replies
jamesgibson14
@jamesgibson14:matrix.org
[m]
I am wondering if I can use Gun login as a type of OAuth for a current nodejs backend I have... so once gun is logged in, I could send an encryped userId to the web server which could then decrypt and log in that userId.
Has anyone done this kind of thing, or have any ideas on how it would work well?
Isaiah Thompkins
@iThompkins
Does GUN guarantee that subscribed node’s updates are always propagated to the subscriber? Or is there potential for some loss?
2 replies
hi πŸ‘‹πŸ»
@useWallie_twitter

@worldpeaceenginelabs' right now Amark wants/needs other maintainers to help build this.

As far as other examples go, I don't think you'll find a better one than Notabug. I've been trying to reverse engineer it, but I'm not sure I can see the full architecture.

Thanks for the referral, @stevenfranssen:matrix.org, it seems interesting. Perhaps this has all been ploy for us all to only follow Sirius Business Ltd on it! Or, maybe some people have cut over to their own relays. It seems like that's the future in which we don't really get to see all the traffic once the client is out there configurable and in the wild 😬Also it looks like the default peer is http://gun-us.herokuapp.com/gun which is probably getting cleared out once or twice per day AND mmalmi having their own peer would/could resync to the emptied peer giving way to it appearing to only holding his data.

I can be more specific, there's just quite a bit to work through, @soulofmischief, and I'm not sure who can help.

  1. sometimes I have two browsers right next to each other and they don't send stay in sync each other. Both listen to .on() and we're looking at wallie/node/{id}. From one browser I set a value /wallie/node/{id}/direction/{msg}. Sometimes they show up and sometimes they don't. It gets especially worse when I try my cloud hosted server. I'm going to try and run a server locally and see if it helps.
Steven Franssen
@stevenfranssen:matrix.org
[m]
@useWallie_twitter: go1dfish has apparently slyly updated notabug the site for a while but not github, really quite strange things surrounding that place, anyway nostr seems far better to develop something social on
Bo
@worldpeaceenginelabs

Hi everybody. Still stucking here!

Quick beginner question:
Is the data that I fetch with gun.on, available afterwards inside the {}, so that I can retrieve the data with for instance ``Number(latitude)``` to get the data?

Is this correct in principle what I am doing here?

<script>
// Initialize GUN and tell it we will be storing all data under the key 'test'.

var gun = Gun(['https://gunrelayeurope.herokuapp.com/gun']).get('test')

// Fetch Gun data

gun.on(data => { 

// Mapmarker constructor

Cesium.DataSource.add ({ 
position: Cartesian3.fromDegrees(
                        Number(longitude),
                        Number(latitude)
                    ),
                    point: {
                        pixelSize: 5,
                        color: Color.RED,
                        outlineColor: Color.WHITE,
                        outlineWidth: 2,
                    }

})
})

// render datasource to globe
viewer.dataSources.add(DataSource);
</script>
2 replies
Lexi
@Lexi:matrix.org
[m]
Right now it looks like you're not doing anything with the variable data which contains the fetched data
1 reply
Bo
@worldpeaceenginelabs
image.png
Bo
@worldpeaceenginelabs

image.png

Another beginner question:
I am connected with my 1. (Gun desktop relay). When i enter something into my form, it causes 2. (four times this console entry). And in my Gun desktop relay arrives 3. (two cryptic entries)

Is that normal or is something going wrong here?

rogowski
@rogowski
Hi! @worldpeaceenginelabs
When looking at your code(last image), (1)I noticed that each call of the handleSubmit method a new listener is created. (2) Trigger .on twice seems related to this actual behavior mentioned in the docs(https://gun.eco/docs/API#important)
gun.get('home').get('lights').put({state:'on'})       // BAD fires twice
gun.get('home').get('lights').get('state').put('on')  // GOOD fires once
Mark Nadal
@amark
My talk got posted!
Also I'm stuck in London, my plane had an emergency landing
And... I lost my laptop 😭 so it's gonna be a hectic week ahead.
https://watch.ethberlin.ooo/session/humanity-30-beyond-blockchains-planetary-systems-and-infinite-games
Bo
@worldpeaceenginelabs
@Lexi:matrix.org @rogowski Thanks guys.
rogowski
@rogowski
Hope this helps :)
Garry
@garrydolley:matrix.org
[m]
@amark: sorry to hear about the loss of your laptop! :(
Bo
@worldpeaceenginelabs
@amark great talk πŸ”₯πŸ”₯πŸ”₯ We are definitly on the same train which is post-scarcity. Love the s/d = a equation. Just understood it for the first time, and realized it could drive my Zerodollar project's "value" table of ressources easily 😍 πŸ‘
tomyo
@tomyo:matrix.org
[m]

Hi everyone!
I can't find in Docs if there's a issue in having several instances of gun running in paralel.. i.e:

const g1 = GUN(config);
const g2 = GUN(another-config, or same);


g1.get()....
g2.get()...

Or, is there a performance penalty if my app calls gun() with same config in several places? Or I should maintain a singleton instance somewhere instead?

Thanks.

soulofmischief
@soulofmischief
@tomyo:matrix.org I attempted this and learned that the graphs combine in the browser and so each instance pollutes the other. You can namespace each under its own table in public space, but userspace is shared. A solution I found was to use certificates and create a user on each relay whose graph other users can access. You can learn more about that here: https://gun.eco/docs/SEA.certify
4 replies
Note that getting this setup to work nicely will require a thorough understanding of gun's principles and sharp corners.
Bo
@worldpeaceengine:matrix.org
[m]
@amark i found this framework, which splits your code into js chunks which get loaded just in time... Instant-on interactivity! https://qwik.builder.io/docs/overview/
mertdeveci5
@mertdeveci5
Is it possible to decrypt/encrypt any data by using the private key of the authorized user?
The exact thing I am looking for is encrypting a message sent with the private key of the user and then decrypting it. It used to be done through user.pair() but now it is deprecated so I wonder how you guys do it?
1 reply
ADAM BLVCK
@adam_blvck:matrix.org
[m]
You can retrieve the key pair using β€˜gun._.sea’ if I’m not mistaken
5 replies
soulofmischief
@soulofmischief
rip mark's laptop
Kier
@syonfox
Hey just integrating a offline RAD instance for private server to server communication backed by PostgreSQL and am wondering if anyone can confirm the store apis callback signatures. Can anyone confirm that store.get wants cb(string:data, bool:err)
and store.put want cb(bool:err, bool:success)
//https://gun.eco/docs/RAD#without
// Without #
// If you want to use RAD without GUN? Just do:

let pool = rm.jan.pool;
var Rad = require('gun/lib/radisk'); // in NodeJS

// var Rad = window.Radisk; // in Browser, still needs the above script tags.
// What is opt? Check the API!

// API
// RAD takes 1 parameter, an option object, with at least 1 property of an opt.store object having:

// put function (key, data, cb) for saving chunks.
// get function (key, cb) for reading chunks.
// It is easier to understand with some examples, here is a localStorage plugin for RAD:

/**
 create table rad
    (
      key varchar
          constraint pk_key
              primary key,
      data varchar
    )
 */
let pgRad = new rm.jan.Table(pool, 'rad');
let tableStore = {}
tableStore.put = function (key, data, cb) {

    // pgRad.update({data}, 'key', key, )
    pgRad.update({data}, 'key', key, {upsert: true})
        .then(ret => {

            if (res.success) {
                cb(null, 1);
            } else {
                cb(ret, 0);//pls confirm the signature for callbacks is cb(err, success)
            }
            console.log(ret.msg)
        })
}

tableStore.get = function (key, cb) {
    pgRad.select("*", {key})
        .then(ret => {
            if (ret.success) {
                cb(null, ret.data[0].data)
            } else {
                cb(ret, 0);//pls confirm the signature for callbacks is cb(data, err)
            }
        });
}

var rad = Rad({
    store: tableStore,
});

module.exports = rad;
Daniel Raeder
@draeder

And... I lost my laptop 😭 so it's gonna be a hectic week ahead.
https://watch.ethberlin.ooo/session/humanity-30-beyond-blockchains-planetary-systems-and-infinite-games

@amark Yikes!

Kier
@syonfox
wow nice, very well put
Colin Mudzami
@Codzaa

Hello everyone, Im new to GunJS . I wanted to know you use GunJS with indexedDB on the client side?
For a simple chat app can each user's information/chats/posts be stored in IndexeDB ?

If so is there an example or detailed explanation I can read.

Thank you.

Steven Franssen
@stevenfranssen:matrix.org
[m]
@Codzaa: take a look at anigma.io it's nostr based
Colin Mudzami
@Codzaa
Screenshot_20220924_205402.png I tried this but its not working
soulofmischief
@soulofmischief
I had issues getting indexedDB to work clientside as well.
Mark Nadal
@amark
Finally arrived home. Gotta figure out if I should buy a new laptop or figure out how to packmule it thru someone in Bogota.
So don't expect any code or bug fixes :(
Also catching up with family.
Quick! Someone help me finish the Code from Phone project 😭
1 reply
soulofmischief
@soulofmischief
Have you considered GitHub codespaces + USB peripherals as a stopgap?
bitfinicon.com
@bitdom8
Can we prepare RSS with gun?
1 reply
Kier
@syonfox
wrote some notes on lex hope im not to off base with my understanding https://github.com/amark/gun/wiki/Strings,-Keys-and-Lex-Rules
Mark Nadal
@amark
Nice notes! Book is gonna make LEX easier tho. Since it can do nearest closest match, that kinda replaces all the range queries.
@adam_blvck:matrix.org DM me on Twitter?
Esteban Fuster Pozzi
@estebanrfp
watching the @amark talk !
rococtz
@rococtz:matrix.org
[m]
@bitdom8: Not sure what "prepare RSS" means. Can you please provide more details on what you try to achieve and what you tried so far? Also, have you tried the hands on tutorials of Gun?