Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
pszabop
@pszabop
@amark it still takes about 10 seconds to exit, I suspect one of the intervals has to terminate. Also multicast definitely hangs. In general, it would be nice to have a clean shutdown. Would require an event that every subsystem would have to handle (e.g. 'close'). I could try and patch that. I bet you think there are other important things to do though.
Jachen Duschletta
@Dletta
[D]RobChristian: <@!178314946201780224> for example, the guys behind OrbitDB provide the following disclaimer. This is the same spirit behind the PR I'm asking you to merge. I'm open to your feedback. Please help me come up with a mutually amicable disclaimer that will help new users quickly become aware of gun's present development status.
pszabop
@pszabop
Say, 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': {} }
also the code hangs when I try to create a user and a peer can't be connected to. That doesn't seem to be offline first.
Jachen Duschletta
@Dletta
[D]bmatusiak: offline first is the concept of not needing a user account to start using the database.. you can just start writing and reading data and export the data and import the data what ever
pszabop
@pszabop
So the user is not offline first API?
Jachen Duschletta
@Dletta
[D]Dletta: It’s recommended to be online for creation and after that it can be offline, however upon login on a new device, it’s recommended to be online as well
pszabop
@pszabop
Interesting. Ethereum allows offline-first user creation (because a user is just a 256 random value and collisions are impossibly rare). If the primary key is the public key and not the alias that would be possible.
Jachen Duschletta
@Dletta
[D]jussir: <@178314946201780224> the voting system is veery simple. The app is used with live audiences so i doubt anyone has any interest in hacking it. So no authentication of any kind, just create a random user id (stored in localStorage) and set your vote with it: gun.get(namespace).get(userId).put(voteId). Before a new vote reset all votes to null's.
Jachen Duschletta
@Dletta
[D]xenister: hi what's the maximum storage capacity of gun ?
Jachen Duschletta
@Dletta
[D]danlugo92: Hello guys, are there any events that I can subscribe to, for listening on auth status? something like user.on('auth'), cannot find anything on it on docs.
[D]danlugo92: might help to make my app more declarative
[D]Dletta: I think auth is an event, but it would be via Gun.on(‘auth’)
[D]Dletta: <@178314946201780224> ^
[D]Dletta: Also <@178314946201780224> Gun just arrived at 11’000 stars on Github 👏
[D]Dyno: Welcome <@547550778257309697>!!! 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]Yakulu:
Jachen Duschletta
@Dletta
[D]danlugo92: <@!612728945313316904> gun.on('auth') didn't work.
gun = Gun()
Gun {_: {…}}
user = gun.user() 
User {_: {…}}
gun.on('auth', console.log)
Gun {_: {…}}
user.auth('numericx', '12345678')
User {_: {…}}
gun.js:198 {gun: Gun, $: Gun, root: {…}, id: 4, back: {…}, …}
user.is.pub
"yYhLaCfPklnRCAsiLYmrkqC2vPIolENLDn2ZwsTwKWk.tQ-9Z39vktnFthfYV7D07Zzy4Z_Zb37ctXr9pTEkzw0"
[D]Dletta: gun._.on(‘auth’ is how you would register the hook, but I wasn’t 100% sure. Mark will let you know once he comes online if there is an event

[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?
Jachen Duschletta
@Dletta
[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 ;)