Gun.chain.promGet = function(key) { let chain = this; return new Promise(resolve=>{ chain.get(key).once(resolve) }) }
// usage after instantiating : let gun = Gun({...})
//either with async
(async()=>{
let results = await gun.get("myapp").promGet("key")
console.log("results",results)
})()
// or with regular promise-then
gun.get("myapp").promGet("key").then(results=>
console.log(results);
})
Hello guys,
I would like to develop a Family tree project using Gun JS. I want to make sure these 3 things can be done.
2 different family tree data need to be separate. Currently all data shows up in developer tools of a browser. Is there a way to keep some data secret from others?
I can’t have all data visible to every family members
lets see how active this place is
Hello everyone, I want to create a social network based on GunJs.
Where do I start? Is there any repo I can clone and start with it?
My first goal for now:
Sign-up/Login
Displayed the signed in user in another page
then basically in another page pull all the users (Username) that signed up.
webrtc.js
now. Is there an example of how to setup 2-way message only communication between peers?
message only meaning data is not kept in the graph like done here
right now that works only one way (only peers that joined first can message like this to the other peer)
.put({}, function (_data, _key, msg) {...})
and use msg
instead of _data
inside callback for that matter 🤔? But that would still keep the data on the nodes
webrtc.js
. I am at the same place as before root.on('out',
just does not fire an event when I try to use it. but in original webrtc.js
code it is definetly used for messaging
Briefly, I am doing something like this
side One
gun.get('+'+opt.pid).on(function(last, key, msg){
if(opt.rtc.start > msg.put['>']){ return }
root.on('out', {'@': ''+msg['#'], '#': root.ask(open), ok: {rtc: {id: opt.pid}}});
});
side Two
gun.get('+'+ack.ok.rtc.id).put(opt.pid, open); // put stuff in the same node and expect respone in callback
but side Two never gets my ACK
gun.get('+'+opt.pid)
and gun.get('+'+ack.ok.rtc.id)
are the same node