Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Mar 29 18:52
    rayros opened #916
  • Mar 28 01:18
    amark closed #915
  • Mar 28 01:18
    amark commented #915
  • Mar 28 01:17
    amark commented #915
  • Mar 27 23:59
    rogowski commented #915
  • Mar 27 23:41
    Jusmaar commented #915
  • Mar 27 23:14
    rogowski commented #915
  • Mar 27 23:05
    Jusmaar opened #915
  • Mar 26 12:49
    PEZO19 commented #784
  • Mar 26 12:48
    PEZO19 commented #784
  • Mar 26 12:48
    PEZO19 commented #784
  • Mar 26 12:45
    PEZO19 commented #784
  • Mar 26 12:44
    PEZO19 commented #784
  • Mar 24 16:23
    @amark banned @rm-rf-etc
  • Mar 23 18:20
    realrecordzLab commented #823
  • Mar 23 18:17
    realrecordzLab commented #823
  • Mar 23 18:16
    realrecordzLab commented #823
  • Mar 22 20:09

    amark on dev

    meta cmd hold, backspace etc. Merge branch 'dev' into dev Merge pull request #914 from ju… (compare)

  • Mar 22 20:09
    amark closed #914
  • Mar 22 20:09
    amark commented #914
gunchatbridge
@gunchatbridge
[D] rogowski: /gun
[D] sharukurusu: Sorry to appear in the middle of the conversation, but is there any online tool to play around with queries?
[D] canadaduane: <@621087760496853023> it looks like a different result now (see image)
[D] canadaduane: Oh, maybe it's working! Maybe the ack callback is just happening after that last assignment
gunchatbridge
@gunchatbridge
[D] canadaduane: Yes! That's it. Thanks <@!621087760496853023> !
[D] canadaduane: So there were two problems:
  1. I was only "sort of" connected to my localhost server (?) because I specified Gun({web: "http://localhost:8080"}) when I should have specified Gun("http://localhost:8080/gun"). I'm not sure why this didn't produce an error, nor am I sure why it "sort of" worked, but didn't provide eventual consistency.
  2. My callback on the "put" was an ack of the put state not the final state, so it appeared as though it wasn't converging on state when in fact it was.
gunchatbridge
@gunchatbridge
[D] rogowski: Glad to help o/
[D] rogowski: G2g
[D] rogowski: Nite!
[D] canadaduane: \o
gunchatbridge
@gunchatbridge
[D] unusual:
[D] Dyno: Welcome <@693662978586968064>!!! 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!
gunchatbridge
@gunchatbridge
[D] canadaduane: What's the best way to retrieve a bunch of values in a single 'on' callback? Specifically, I have an {x, y, z} triple that needs to be kept together.
[D] canadaduane: From what I understand, on does not work for anything other than 1-deep values, right?
moses5407
@moses5407

@PsychoLlama Just found this "boiled down" message today looking for an option to access gundb via a REST API.
I'm using a development environment that can work with WEB API's but doesn't include gundb as a supported database. IS there any more detailed info for a not-developer? :-)

Though boiled down, gun let’s you register handlers for .get and .put:
// any time a new gun instance is created
Gun.on(‘opt’).event(function (gun, options) {
gun.opt({
wire: {
get: function (almostLikeAQueryButNotQuite, callback, options) {
// read the data, sending it into the callback as found
},
put: function (graph, callback, options) {
// for each node in the graph, save it
}
}
}, true) // “true” prevents the event from firing again
})
That’s a 90,000 foot overview

rogowski
@rogowski
@moses5407 Morning! Why not create a http route (using expressjs ou other) like:
route('/:soul', function(req,res) {
  gun.get(req.params.soul).once(function(v,k) { res.json({k:v}); });
})
gunchatbridge
@gunchatbridge
[D] rogowski: <@!330395330820571136> Have you seen lib/open.js and lib/load.js ?
Maybe it is what you are looking for. https://gun.eco/docs/API#on
You must include it manually.
moses5407
@moses5407
@rogowski The short answer is: because I'm not smart enough :-p
@rogowski @gunchatbridge @PsychoLlama Would any of you be available for hire to walk me thru a Web API setup for gun? Or know someone who might be?
Lorenzo Mangani
@lmangani
@moses5407 could you detail a bit further, what you do need to be helped with?
@moses5407 my 2 cents, if you need to build an API to work with storage, you should center the design on how your specific storage adaptor works, if you just want to map a web API to Gun there are already quite a few examples such as https://github.com/lmangani/gunstore.io
gunchatbridge
@gunchatbridge
[D] themmes:
[D] Dyno: Welcome <@693805675087790192>!!! 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!
moses5407
@moses5407
@lmangani wow! thanks! I had no idea that existed. Looks like it will suit my needs. BIG thanks!
gunchatbridge
@gunchatbridge
[D] canadaduane: It appears that Gun.load will load the document whether or not it has changed--its callback is called whenever a Gun.put affects is subtree? i.e. even if I put the same values over and over again, Gun.load gets called every time.
gunchatbridge
@gunchatbridge
[D] zniwus: <@!178314946201780224> amark/gun#916
gunchatbridge
@gunchatbridge
[D] circles: It's really hard to understand how SEA interacts with GUN tbh. Seemingly, the gun.user API is completely different from the SEA.pair API
[D] circles: but it's not clear how exactly....
gunchatbridge
@gunchatbridge
[D] marknadal: <@!693342486885564437> <@!693461290542301295> <@!486837796854693909> <@!501860573932290051> <@!693662978586968064> <@!693805675087790192> WELCOME WELCOME WELCOME!!!!!!!!!! 😄 😄 😄 🤩 ⚡ 🎊 🥳 🤗 How'd you hear about us!!!??? What are you wanting to create???
<@!693342486885564437> 😦 unfortunately not because some data may not exist on the machine, it has to be synced from disk or other peers, and therefore needs callback.
<@!674404085105164290> w00h00! 😄 😄 😄 😄 yay!!! 👏 👏 👏
@glensimister niiiiice!!! This sounds a lot like party.lol !
Yeah :/ not much on this, but random thoughts...
counting: https://gun.eco/docs/Counter (tho please see <@!321271119304720384> 's https://github.com/nmaro/gun-poll app, @go1dfish 's work on http://notabug.io upvoting, etc.)
searching / filtering: use .set( to create indices, or even a FTS, rather than filtering, or check out tagging libraries like <@!635601430413049859> 's https://github.com/Stefdv/gun-tag
nulls: what is your expanded use case around this and hiccups?
Yeah .map(filter) but indexing better than filtering.
<@!636951039559335948>ses5407 @lmangani 😄 !!!
@lmangani yes!!! very interested in the WebRTC stuff. Plus I recently came across the "Unified Plan Transition" for WebRTC, does that mean browsers have made big progress in the last 6 months since that came out? I'm also re-architecting all of GUN to do yielding CPU scheduling on all operations which is critical for handling large records (imagine video frames). My custom JSON parser is actually 10~20X faster than native on JSON objects with large video chunks in it.
<@!203666215502217216> nice!
[D] marknadal: <@!659240782452097024> awesome!!! Unfortunately, since 2020 MongoDB adapters not compatible. Were you having issue with the default RAD storage engine?
GUN is a graph database, MongoDB is not, so GUN has to store "relationships / links / pointers" and the format for that si {'#': uuid}.
<@!330395330820571136> 😄 thanks <@!621087760496853023> for helping! ❤️ <3 😄 😄 glad to hear things are converging 😄 :D `gun.get('node').on(cb)` if `{x,y,x}` same object. If you have a known schema, better to maybe use your own extension, perhaps modify `.open` code to recurse over your schema not recurse over any data. Would love for you to contrib it back to community as a new extension, maybe like `.read(cb, schema)` `load` maybe report bug? <@!636951039559335948>ses5407 that wire example you found is super old/outdated/not-compatible anymore... <@!621087760496853023> nice Express route idea!!!!!!! Very cool!!!
<@!203666215502217216> yes, User API and SEA are very different. One is focused on cryptography, the other is focused on... "being logged into an account & doing stuff" (regardless of cryptography).
gunchatbridge
@gunchatbridge
[D] circles: with that House metaphor, I was thinking of something like this, but couldn't figure it out really:
    var SEA = Gun.SEA;
    ;(async () => {
    async function createMe() {
      const {pub, priv, epub, epriv} = await SEA.pair();
      var me = {
        type: user,
        id: pub,
        essence: priv,
        seal: {epub, epriv},
        houses: [],
        wallet: {}, // can hold attributes like fav color, hometown, etc 
      }
      return me;
    }

    async function createMyHouse(me) {
      const {pub, priv, epub, epriv} = await SEA.pair();
      var myHouse = { 
        type: house,
        owner: me.id,
        guests: [], // get temporary access WHEN OWNER IS PRESENT
        tenants: [], // get access whenever they wish to enter
        address: pub,
        masterKey: priv,
        seal: {epub, epriv},
        data: {}, // can hold a chat log, links to files on Sia etc
      }
      me.houses.append(myHouse);
    }

    function inviteGuestToHouse(friend, house, owner) {
      if (owner.seal === house.owner.seal) {
        house.tenants
      }
    }

    var me = createMe();
    createMyHouse(me);
    //inviteFriendToHouse
gunchatbridge
@gunchatbridge
[D] tclarke: > Hey <@!178314946201780224> ! Thanks for the welcome! I've been meaning to build something with Gun ever since we spoke in berlin late on the grass outside ethberlin. Im working testing things out with a simple messenger, but want to use it for an email client idea based on blockchain wallet backed emails. the SEA module is very nice BTW 😄
genderev
@genderev
I want to use Gun INSTEAD of a traditional database, but from the docs it seems like you still need some traditional database involved (e.g. using MongoDB to create a superpeer.). Is my understanding correct?
genderev
@genderev
I implemented gun = Gun() in my status posting app and it was super easy, but of course when you refresh the page all the posts are gone.
  1. How do I call some function that retrieves previous posts?
  2. Do I need a server to recall previous posts?
  3. Are users required to store Metamask or any other plugin for authentication success?
gunchatbridge
@gunchatbridge
[D] tyrellwellick:
[D] Dyno: Welcome <@357294947545645058>!!! 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] tyrellwellick: Is there a way to store data users can access in Gun without using any central server?
gunchatbridge
@gunchatbridge
[D] zniwus: <@!178314946201780224> see if there is a solution to this problem. I think it would be nice to test the compatibility with different frameworks. You can check some projects from examples and we are sure that they will work. https://github.com/rayros/gun/tree/test/environments/test/environments/angular
Lorenzo Mangani
@lmangani
@genderev Gun IS a graph database. By nature its storage is distributed between its clients an decentralized. If you do need to have a "central" repository for data being exchanged, that's what the storage adapters are for.
gunchatbridge
@gunchatbridge
[D] niowniow: <@!178314946201780224> I'm trying to teach myself JS app development and working on an activity app / annotation tool, requiring a graph database. Decentralized, offline-first fits nicely into the concept.
Currently I'm mainly struggling with technicalities: making a clone of a node (or more specific: copy a clone of a node of a set into a new set). Are there some built-in ways?
gunchatbridge
@gunchatbridge
[D] Dyno: Welcome <@694107129275220037>!!! 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] georgigriffiths:
[D] georgigriffiths: put not working
[D] georgigriffiths: Sorry that was mean't to be a search!
gunchatbridge
@gunchatbridge
[D] georgigriffiths: When running gun.get('room').get(id).put({id:id}) the first update is not sent to peers
[D] georgigriffiths: if you use gun.get('room').get(id).put("a value") it is synced
[D] georgigriffiths: So seems to be only when putting an object
[D] georgigriffiths: This is from master is there a current stable version?
gunchatbridge
@gunchatbridge
[D] georgigriffiths: var gun = Gun(location.origin + '/gun'); var think = gun.get('think/' + location.hash.slice(1)); var thoughtItemStr = function(id) { return '<li class="thought__item"><label class="visually-hidden" for="' + id + '">Thought</label><input id="' + id + '" class="thought__input huet"><li/>'} var typing, throttle; $('.thought__add').on('click', function () { $(thoughtItemStr('')).prependTo('.thought__list').find('.thought__input').focus(); }); $(document).on('keyup', '.thought__input', function () { var input = $(this), id = input.attr('id'); if (!id) { input.attr('id', id = Gun.text.random()); } typing = id; clearTimeout(throttle); throttle = setTimeout(function () { think.get(id).put({input:input.val()}); typing = false; }, 10); }); think.map().on(function (thought, id) { var li = $('#' + id).parent()[0] || $(thoughtItemStr(id)).prependTo('.thought__list'); if (thought) { if (id === typing) { return } $(li).find('.thought__input').val(thought.input); } else { $(li).hide(); } });