Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 07:58
    mmalmi commented #1282
  • 04:07
    Alengeorge-01 commented #1279
  • 04:07
    Alengeorge-01 commented #1279
  • 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
  • Sep 27 23:21
    amark commented #1273
  • Sep 27 23:16
    amark commented #1271
  • Sep 27 23:10
    amark commented #1282
  • Sep 27 23:02
    amark commented #1277
  • Sep 27 22:59
    amark commented #1024
  • Sep 27 22:48
    amark commented #1275
  • 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
James
@u007
Thanks @amark noted on it, i realise if i reset my db on a peer backend nodejs, my browser still have the session and still can login, wondering if we reset db, how does the browser sync with a emtpy peer?
gun-db-fan
@gun-db-fan:matrix.org
[m]
Hi Guys, i am a software developer i recently discovered gunDB and i was wondering how can you secure the integrity of your p2p network. How can you make sure that no peer has been altered. I thought that is the reason for blockchain apps? plz help me understand or point me to the source.
Radu
@rococtz
@gun-db-fan:matrix.org you can ensure it with SEA.verify (signing data)
gun-db-fan
@gun-db-fan:matrix.org
[m]
@rococtz: THANKS for the pointer i will look it up!
Radu
@rococtz
@gun-db-fan:matrix.org you might want to check this out https://gun.eco/docs/SEA
1 reply
it's used by Gun but it's very generic encryption/signing
Kier
@syonfox
Does gun internaly escape stuff by replacing \ with \?put('cat \t dog') -> get(key) -> 'cat \\t dog'
libensveto
@libensveto_twitter
@aethiop hey, wondering if there was a react-native gun app with iris-lib built in
2 replies
Robin Bron
@finwo
@lain:iwakura.xyz As gun relies on the webcrypto api and the polyfill is used for non-browsers, your error should be resolved by loading gun's browser.js instead of the index.js
2 replies
James
@u007

hi i have run im getting gun.user().get is not a function

gun.user().auth(userid, pass, (e) =>{
  gun.user().get('profiles')// gun.user().get is not a function
}

just realise it works within this scope, but i cannot return gun.user() to another function , then it will not work. i need to call gun.user() from anywhere i wish to call user related get chain

4 replies
lain
@lain:iwakura.xyz
[m]
i still get the error when i do that ^
Robin Bron
@finwo
Does webpack support importing/bundling from an url?
If so, you may be able to try loading the browser.js through unpkg instead of a locally-installed version
lain
@lain:iwakura.xyz
[m]
not sure
lain
@lain:iwakura.xyz
[m]
idk what unbuild is but its using a dynamic require statement, ie require(var) which webpack doesnt like. i dont get the error if i import gun/src
still get the error from sea though
Robin Bron
@finwo
unbuild = custom tool built by mark because he prefers manually editing index.js and then splitting into multiple files over keeping the source separate and combining it later.
it's the whole reason it's hard to add typescript definitions, implement es6 imports, etc
lain
@lain:iwakura.xyz
[m]
hmmm
James
@u007
hi guys, how do i check if a path have list or count the list?
4 replies
Kier
@syonfox

hi guys, how do i check if a path have list or count the list?

somthing like this I think

function isThere(thing, cb){
   thing.once(d=>{cb(typeof d == "undefiend")})
}
var things = gun.get('things');
things.set('cat');things.set('dog');

let jsArray = [];
things.map().once(thing=>{
  jsArray.push(thing);
  console.log(thing)
})
James
@u007
how do we know if its already finish receiving?
im also getting strange error: "Signature did not match." after .auth(). didnt get this issue previously. i did a removal of all radata folder and restart it. then i create the user, then login from frontend works. but on node stack, it login without error but throws Signature did not match.
7 replies
Kier
@syonfox
it wont call the once callback until its there for the first time.
someone correct me if im wrong but
case: no local it returns after val is goten from first peer?
case: local it returns synchronously from local storage ... (and again after network sync? pls confirm somone)
case offline no local synchronously returns undefiend
edit: to clarify for the once()
lain
@lain:iwakura.xyz
[m]
:point_up: Edit: idk what unbuild is but its using a dynamic require statement, ie require(var) which webpack doesnt like. i dont get the error if i import gun/src. EDIT i do get other errors though so this not a solution
lain
@lain:iwakura.xyz
[m]
im trying to set up a relay server / super peer. i ran the install script from the repo, but how do i connect to it from my client? i used const gun = GUN({ peers: ["<ip>:80/gun"] }); but it doesnt seem to be working
is there a sample project i can use to test it? idk if its my code or if the server isnt working
lain
@lain:iwakura.xyz
[m]
ah fixed it lol. i didn't have http:// before the ip address
Edoardo Cremaschi
@NuclearManatee

I think I'm doing something wrong and possibly stupid.

const gunSpace = Gun(['https://gunjs.herokuapp.com/gun']).get(appSpace);
gunSpace.put('name' : 'my name');

console.log(gunSpace.get('name')); // <-- [Object Object]

what am I missing? i Just want to get the 'my name' string.

6 replies
lain
@lain:iwakura.xyz
[m]
or you can use await and do const value = await gunSpace.get('name')
2 replies
Kier
@syonfox

or you can use await and do const value = await gunSpace.get('name')

https://gun.eco/docs/API#-a-name-then-a-gun-then-cb-not-official-yet-

also Bullet.js does some cool stuff but i went down the same hole the gun way makse sence if you start thinking in graphs

lain
@lain:iwakura.xyz
[m]
o ok
Kier
@syonfox
... So im looking into SEA/ users. And how do do user's decrypt data... say the server wants to give some data to a user do you HAVE to use the grant api and access it from bob.get('shared')put('yolo').grant(gun.get('~@Alice')) then can the Alice see gun.get('~@bob').get('shared') or does it also need to be placed in a public place. with something like bob> gun.get('shared').put(bob.get(shared)) // Alice can read but Keven cant??
Kier
@syonfox
or is it a just roll your own with sea kind of deal. ... is the user space accessible from other users. how does one publish a object that a user owns so others cant edit but anyone can see/decrypt depending on application
Mac16661
@Mac16661
How I can extract data return from content-addressing? Because it returning hash: data
Radu
@rococtz
@syonfox you never use public space for anything. you always use user space (with certify) or Content Addressing. For encryption see this
https://github.com/amark/gun/wiki/Snippets
1 reply
lain
@lain:iwakura.xyz
[m]
do you guys have any recommendations for increasing performance? i have a game and im using gun to sync player positions, calling .put(position) every say 50ms, but its pretty resource intensive and has a lot of latency
Radu
@rococtz
@lain:iwakura.xyz If you don't need to persist data (for example player position), why not use this one? https://peerjs.com/
also, how do you measure latency? latency between what and what?
3 replies
SiJinmin
@SiJinmin
hi @amark ! I'm sorry to spend your time for a very personal question, I promise I will be a fun of gun forever. ^^ The question is could you remember the link to the awesome tutorial of cryptography that you once provided in gun's documentation a few years ago? (In the new version gun documentation I cannot find it anymore.) I need this online tutorial to learn cryptography. thanks! ^^
asd417
@asd417
hi I'm new to this whole thing and I wonder how GUN handles proof of work or validating a peer's data
lain
@lain:iwakura.xyz
[m]
i had used yjs (a webrtc crdt database thing) before so i can use that for it i guess
Radu
@rococtz
@asd417 You can probably write a book about that :) But you can have a look yourself in the docs, maybe start with the Architecture chapter https://gun.eco/docs/
Or maybe this https://gun.eco/docs/Cartoon-Cryptography#cryptography for @SiJinmin as-well
SiJinmin
@SiJinmin
@rococtz yes, I have read these cartoons, but I want to learn the detail principles and algorithms for crypto, so I need a more detail tutorial about crypto. Thank you!
Edoardo Cremaschi
@NuclearManatee

a question about data modeling. How can I handle objects with arrays in it? Example:

let object = {
  scopes : [ 
    { name: 'a'},
   { name: 'b'}
  ],
  value : 'my value'

do I have any alternative other than decomposing the object and the array and saving into gun using gun.set() ?

Ty Rauber
@tyrauber
Hey All, I am exploring the use of Gun in Expo following the ReactNative example. I guess I have some questions on dependencies, specifically in regards to SEA. It looks like Metro doesn’t support dynamic imports? I am getting the error "Dynamic require defined at line 5; not supported by Metro”, related to the use function at line 15 of SEA.js. Anyone have some experience using Gun in Expo, or interest in helping sort out a demonstration? I am interested in building a simple client/server monorepo that demonstrates basic auth and chat.
James
@u007
gun.unset code chnanged? my code didnt work
gun.user().get('coins').unset(gun.user().get('coin/code1'));
1 reply
and also this issue
// does login here
let machines = gun.user().get('machines');
let machine = gun.user().get('machine/tesseract');
machine.put({faces: 24, cells: 8, edges: 32});
machines.set(machine);
// let's add machine to the list of machines;

let machine2 = gun.user().get('machine/tesseract2');
machine2.put({faces: 1, cells: 1, edges: 1});

machines.set(machine2);

gun.user().get('machines').map().once(() => {
    //this is called once only with machine, not machine2

})
Adam Bowman
@abow
if it did break, I'm guessing that rel and node aren't always "#" and "_"