Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 06:54
    janbkrejci commented #1119
  • Jan 24 22:51
    lmangani commented #68
  • Jan 24 22:39
    ericvrp commented #68
  • Jan 24 13:27
    705queenbee commented on ce20e07
  • Jan 21 08:17
    Orimay synchronize #1191
  • Jan 21 08:11
    Orimay synchronize #1191
  • 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
Jachen Duschletta
@Dletta
[D]RobChristian: <@!103660564651212800> probably hasn't been tested, but in theory, it's whatever maximum your backend supports. Gun is really just a frontend for a database engine like LMDB.
Jachen Duschletta
@Dletta
[D]danlugo92: how would I go about implementing a isPubKey(anyString) => boolean ?
pszabop
@pszabop
What is the correct syntax for specifying peers in the gun constructor? I cannot use options if I specify an array of strings, and I can't seem to get the peer if I use options.peers where that looks like { 'http://localhost:8080/gun': {} }
Stefdv
@Stefdv
@KINKCreative i posted a quick - working - example on github Stefdv/gun-tag#3
Stefdv
@Stefdv
@amark do you still use PANIC for testing ? If so, is there any documentation for it ?
Jachen Duschletta
@Dletta
[D]danlugo92: on('auth') only supports a single listener 🤦‍♂️
Jachen Duschletta
@Dletta
[D]jabis: @pszabop, the constructor will obj_map over the peers in Gun.chain.opt, try to pass them in opt.peers as ["srv1/gun","srv2/gun"]
Jabis Sevon
@jabis
image.png
pszabop
@pszabop
@Dletta okay, tried that, it worked. The documentation says options.peers is an object, where the URLs are properties, and the value is an empty object.
thanks!
Jabis Sevon
@jabis
@pszabop was actually me answering from discord ^^ and yes I think that method should check if the opt.peers is an object or an array there, might constitute an issue into github :)
in object format way it's iterated there, the signature then should be {""+url:{url:url}} not just empty object
now to sleep bbl ->
pszabop
@pszabop
ok will file issue. An array is fine
pszabop
@pszabop
Is it possible to change a user alias after creation? I have an idea on how to create the user pubkey identity first (i.e. offline first), and add an alias later when negotiating with a server, since an alias is a global namespace the alias has to be negotiated to eliminate collisions, check for sybil attacks, alias theft, etc
pszabop
@pszabop
@amark @jabis @Dletta thanks for all your help, I have promise-based tests using Tape and nodejs that can test multiple databases in one process. I can now start attacking my business logic. I basically made a thin wrapper around your API to encapsulate some idiosyncracies and confusing documentation. If you are interested I can put the result in a public repo. Meanwhile here's a gist that encapsulates some of the stuff I learned. https://gist.github.com/pszabop/61c3b7c36aa5fe866834fda4531d9219
@jabis there's already a catch-all documentation bug that discusses the peers syntax: amark/gun#70
Jachen Duschletta
@Dletta
[D]RavenHawkTech:
[D]Dyno: Welcome <@489487350108258308>!!! 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!
Jachen Duschletta
@Dletta

[D]anoxy: @pszabop in fact it is possible to have aliases exactly as it works in Discord like anoxy#4831. <@280426612900757504> have implemented it in his platform https://www.peersocial.io/

So by doing it that way there won't be any name collisions

Jachen Duschletta
@Dletta
[D]anoxy: @Stefdv the GUN tagg plugin seems to be really cool, thanks for that ;)
Jachen Duschletta
@Dletta
[D]bmatusiak: yea i found to hash the public key to sha256 then converted into a number and then using using that number to id the alias, so far the most promising unique id
Klemen
@KINKCreative
@Stefdv I am tagging items and then when I get to a view of one item (say, post), I’d like to get the tags for this item only. I made a custom getter for it as written but you may have a better solution to get all tags on a node (not all tags that exist in the system). I use it also to favorite items (eg tag with ‘like/userid’) and will use it for user “playlists” of items.
Klemen
@KINKCreative


Anyone else - is there a way to mutate a value without referencing it (e.g. gun.get(‘someitem’).get(‘views’).inc() to increment? Maybe a custom chain method that will call a method on a node with itself as a parameter? That possibly is already written, I’m just thinking out loud here:

Gun.prototype.call( function( Function cb ) {
this.put(cb(this))
})

And then we could do:

Gun.prototype.inc( function() {
    this.call( function(x) { return x++ } )
})
Klemen
@KINKCreative
And maybe for a list, you map & call the callback on each item
Jabis Sevon
@jabis
@Klemen, maybe something along the lines:
Gun.chain.inc = function () {
  let self = this;
  this.get('.').once(function(data,key){
    console.log("data",data,"key",key);
    if(!data) data = 0;
    data = data+1;
    console.log("data",data,"key",key);
    return self.put({[key]:data});
  });
}
// usage: 
gun.get('something').get('views').inc();
// read count
gun.get('something').get('views').get('.').once(function(count){ // count should be now 1 });
wrapper for the count could be
Gun.chain.curval = async function(){
  return await this.get('.').then();
}

//usage: 
let views= await gun.get("whatever").get("inc2").curval();
// should return whatever was incremented
Jabis Sevon
@jabis
ofc you could use callbacks passed instead of async/await
Jachen Duschletta
@Dletta
[D]Dyno: Welcome <@664252972355813377>!!! 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!
[D]go-rusty:
[D]oneezy:
[D]Dyno: Welcome <@248978062786428928>!!! 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!
Jachen Duschletta
@Dletta
Jachen Duschletta
@Dletta
[D]mhelander: 👍
Jachen Duschletta
@Dletta
[D]mmalmi: http://localhost:8765/ should perhaps show /examples directory index instead of chat example? 🤔
Jachen Duschletta
@Dletta
[D]datashaman:
[D]Dyno: Welcome <@664436103578779648>!!! 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!
Stefdv
@Stefdv

@KINKCreative ah, i see... you want the tags per node. While the purpose of gun-tag is to get all nodes tagged to something, you want it the other way around ;)
Well , whenever a node is tagged, the tag is added to the property 'tags' ( as you noticed ) the difference between tag and untag is 1 (tagged) or 0 (untagged).
So (using my example provided in my github comment )

gun.get('alex').get('tags').once(tags=>{
  var t = Gun.obj.copy(tags)
   delete t._
  console.log(t)   // {member:0,paid:1} 
})

So alex is untagged from 'member' but tagged to 'paid'
Does this answer your question ?

Jachen Duschletta
@Dletta
[D]xenister: hi can i store gun.user() information on indexedDB ?
Jachen Duschletta
@Dletta
[D]sirpy: <@!178314946201780224> a working react-native asyncstorage https://github.com/GoodDollar/gun-asyncstorage
Klemen
@KINKCreative

@Stefdv Yes that much I figured, thanks!

I was wondering if it would be a huge workaround the difference between tag and untag is not 1 & 0 but instead an int number of total numbers of such tag? (say, I have 10 people tagging an item with ‘like’, wouldn’t it be cool if the response would say { like: 10 }

btw I notice you do .obj.copy(…) - is that different from open() or load() ?
Jachen Duschletta
@Dletta
[D]marknadal: <@!506274864089268235> I'll check it out, been swamped.
@pszabop yeah, AXE code, Stats, and garbage collector, etc. are all on setIntervals, you're right, they should cancel/close, good observation.
Gun('peer' Gun(['peer', 'peer Gun({peers: [ Gun({peers: { etc. guessing somebody else already helped.
NOTE (this should be in docs already) GUN works offline but if you specify a peer(s), it will error, since it assumes you intend to be online with it.
For instance, if you have no peers, you can still create/auth Users offline/locally.
Creating key pairs always works no matter what await SEA.pair()
But yeah, like <@!612728945313316904> said syncing users best if at least online once. <@!280426612900757504> also ^
<@!407331962269728768> fun!!! you've already used it with people??? What was the audience?
<@!103660564651212800> yes what <@!506274864089268235> said, whatever the storage engine supports, yayy thanks for helping others out, I love seeing that! 🙂 Also note RAM limit: GUN values are atomic, so limit of an individual key/value pair should be SMALLER than the RAM of the smallest device you support.
<@!447932418477916160> <@!612728945313316904> so close! sorry gun.on('auth versus Gun.on('auth I think it is just that your phone auto capitalizes stuff 😛 but important subtle difference. I want to make user.on('auth' work but lol it is buggy.
user.leave() is synchronous, no event for it currently.
Oh wow, you already saw my code comments, nice!!!! Impressive.
Hmm, maybe I'm not calling to.next(e in auth when I need to, it should support multiple, if not, that is a bug. Should be easy fix, wanna try?
<@!447932418477916160> there is SEA.opt.pub('asdf~lol.yay.what') which returns the PubKey portion of that "soul" or undefined. Does that help?
[D]marknadal: <@!635601430413049859> yes 😄 😄 😄 still use PANIC and it is EPIC, docs are here: https://github.com/gundb/panic-server and alsoc heck out https://github.com/amark/gun/blob/master/test/panic/load.js for a tutorial.
Also... I test/debug a lot in production haha, woops!
  • @KINKCreative how is the Tagging library going? + <@!366349503265112074>
    <@!648558515463651338> 👏 you also jumping in and helping as well, love it!
    Yeah, peers will Array -> Object upgrade for you.
    @pszabop I gave a manual example how to add another alias to a user a ? week ago ? discord search should pull it up. Yay <@!366349503265112074> + <@!280426612900757504> help! 😄 :D
    w000h00, you have the test working?? YAAAAYyy!! THanks to all the help of the others too.
    Maybe you can create a https://github.com/amark/gun/wiki/Testing page for us??? Even if just stub to start.
    @KINKCreative Gun.chain.myExtension = function(){ var gun = this; return gun } super easy to make custom extensions 😄 goal is to wrap even app-specific logic into little "macros" you reuse in your app instead of GUN's core API. Things like increment/decrement require a special CRDT, can be done in like 12 LOC, see this page: https://gun.eco/docs/Counter + <@!648558515463651338> if you're curious too (what is curval?).
    <@!491228220520136704> w00h00 clicks thanks for the mention, and excited for getting React Native stuff more official.
    OOOO yay and you're helping with more official React Native storage ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ YOU ARE AWESOME!!!!!!!!!!!! ⚡ ⚡ ⚡ ⚡
    <@!636489182214357002> been meaning to improve the example app yeah, but that homepage is also the homepage of all default deploys, so I want it to also be useful apps, not example-only.
    <@!103660564651212800> should via https://gun.eco/docs/RAD#install but I think there is a BUG someone listed that Users aren't working with IndexedDB or something odd like that? I need to look into it.
[D]marknadal: <@!547550778257309697> <@!489487350108258308> <@!664252972355813377> <@!248978062786428928> <@!664436103578779648> !!!!!!!!!!!! WELCOME WELCOME WELCOME TO THE COMMUNITY!!!!!!!!!!! ⭐ ⚡ 👏 ⭐ 👏 ⚡ how'd you hear about us? What are you working on???
Mark Nadal
@amark
still some gitter discord missing messages.
@KINKCreative I think @Stefdv was working around stuff (way back when) when load/open didn't exist. :)
Jachen Duschletta
@Dletta
[D]marknadal: <@!612728945313316904> still do me a favor and update your gitter dletta profile avatar with an obvious (maybe solid color) unique image, so it is easier to scan (?) thank you!!!
[D]marknadal: <@!664252972355813377> I take it you've got some good rust/go experience, wanna help with a RUST port of GUN?
[D]marknadal: <@!547550778257309697> <@!489487350108258308> <@!664252972355813377> <@!248978062786428928> <@!664436103578779648> did you all land here because of <@!491228220520136704> 's article? Seems like you all came in at same time. 🙂 Did I miss something?
  • what are your skills? Or things you're passionate wanting to learn?
[D]jabis: <@!178314946201780224> was just example how to implement a counter for a node
Gun.chain.incrval = function () {
  let self = this;
  this.get('.').once(function(data,key){ 
    if(typeof data === "undefined") data = 0;
    data = data+1;
    return self.put({[key]:data});
  });
}
Gun.chain.decrval = function(){
  let self = this;
  this.get('.').once(function(data,key){
    if(typeof data === "undefined") data = 0;
    data = data-1;
    return self.put({[key]:data});
  });
}
Gun.chain.currval = async function(){
  let curr = await this.get('.').then();
  if(!curr) curr = 0;
  return curr;
}
//usage:
gun.get("stuff").get("views").incrval() // data is 0+1
gun.get("stuff").get("views").currval() // 1
gun.get("stuff").get("views").incrval() // data is 1+1
gun.get("stuff").get("views").currval() // 2
gun.get("stuff").get("views").decrval() // data is 2-1
//etc