Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 26 19:44
    dweorh updated the wiki
  • Jan 26 17:10
    phantomlsh commented #1193
  • Jan 26 12:22
    Jourdelune closed #1183
  • Jan 26 12:22
    Jourdelune commented #1183
  • Jan 26 10:17
    atordvairn commented #1183
  • Jan 26 10:16
    atordvairn commented #1183
  • Jan 26 01:36
    phantomlsh opened #1193
  • Jan 25 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
Jachen Duschletta
@Dletta

[D]danlugo92: actually it did work. Sorry :/.

Line gun.js:198 {gun: Gun, $: Gun, root: {…}, id: 4, back: {…}, …}

[D]danlugo92: that's the console log.
[D]danlugo92: need another cup of coffee
[D]Dletta: Lol
[D]danlugo92: gun.on('leave') doesn't though. maybe it's another constant?
[D]Dletta: No clue on that one, could just be a naming thing, not sure where the names are kept (‘onto’ is the event system’
Jachen Duschletta
@Dletta
[D]jabis: leave doesn't emit afair
[D]jabis: and its code commented that Gun.on(auth should be moved to user to emit instead of root
Jachen Duschletta
@Dletta
[D]danlugo92: yeah I figured it should be user.on('auth')
Stefdv
@Stefdv
@KINKCreative Hey, i really would like to help you out with gun-tag. Can you provide me with a basic example of what you are doing ( or how you use gun-tag) ? I use gun-tag all the time and to me the documentation looks solid, but then again...maybe i'm overlooking something that isn't well documented at all :(
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