#dat

/

      • dat-gitter
        (RangerMauve) I've been thinking about how one could get dat to work with service workers. Would y'all mind giving feedback? dat://rangermauve.hashbase.io/dat-in-browsers-without-a-gateway
      • (RangerMauve) For some reason orkl only works with dat:// urls.
      • a_chou joined the channel
      • (RangerMauve) Oh man, instant proof that forking is awesome. Able to fix my version without having to wait for a release. :D
      • timwis joined the channel
      • a_chou has quit
      • rho has quit
      • pfrazee
        @RangerMauve I'm getting "entry not found"
      • jimpick
        me too
      • i can see the raw content though... dat://rangermauve.hashbase.io/content/dat-in-browsers-without-a-gateway.txt
      • pfrazee
        same
      • might be because `public: false` is set
      • sec^nd has quit
      • sec^nd joined the channel
      • moszeed joined the channel
      • sec0nd joined the channel
      • sec^nd has quit
      • sec0nd is now known as sec^nd
      • mafintosh
        pfrazee: jimpick only needs one new sig in practice :) so super cheap
      • jimpick: also yes, that'd be trivial to add. make an issue
      • vmx joined the channel
      • lapinot joined the channel
      • datafatmunger joined the channel
      • lapinot joined the channel
      • sec^nd has quit
      • sec^nd joined the channel
      • sec0nd joined the channel
      • sec^nd has quit
      • sec0nd is now known as sec^nd
      • sknebel has quit
      • sknebel joined the channel
      • datafatmunger
        i'm looking for any help to get swarming going in the browser, i'm using this guide: https://docs.datproject.org/browser ... specifically the section "under the hood", as i'm trying to get hyperdb working. I'm now running my own mifintosh signalhub (via the cli, signalhub listen -p 8080) and added it as an upstream server in nginx to rid me of CORS issues. The browser can't seem to connect to it however, and it's sort of unclear which key should
      • be used in the context signalhub. if anyone has a moment for pointers would be awesome: https://gist.github.com/datafatmunger/3734f38f3...
      • seems to be an issue with subpaths and signalhub ... it doesn't like them.
      • lapinot joined the channel
      • (using nginx upstream)
      • sec^nd has quit
      • sec^nd joined the channel
      • rho joined the channel
      • yeah, seems line 46 server.js is an issue, but i'll move this over to github issues at this point. sorry for the noise.
      • mafintosh
        datafatmunger: did you figure it out?
      • datafatmunger
        mafintosh: some of my issues, yes ...signalhub the server code assumes the path starts with /v1/ otherwise just returns. mine doesn't because i was trying to configure around CORS, but i see you are setting headers to avoid CORS errors, so i have not idea why firefox was complaining about CORS in the first place (something else to figure out), but i don't know what code you are running at the freehosted signalhub servers like: https://signalhub-jc
      • cqtwhdwc.now.sh, and if the CORS header stuff is in there ... in any case i will make a github issue, and "fix" suggestion.
      • mafintosh: went ahead and made a PR, take it or leave it. won't hurt my feelings.
      • dat-gitter
        (RangerMauve) pfrazee, jimpick: Dang it! I didn't get any notifications from gitter last night. I've fixed the link since, I think.
      • datafatmunger has quit
      • micahscopes joined the channel
      • micahscopes has quit
      • micahscopes joined the channel
      • SamM joined the channel
      • kmossco joined the channel
      • webdesserts[t] joined the channel
      • obensource joined the channel
      • kmossco has quit
      • webdesserts[t] is now known as webdesserts
      • beardicus has quit
      • beardicus joined the channel
      • webdesserts has quit
      • moszeed has quit
      • jungly has quit
      • (RangerMauve) pfrazee: Is beaker using a single discovery-swarm for all it's dats?
      • (RangerMauve) It kinda looked like it, but I wasn't 100% sure that that was what was happening.
      • (RangerMauve) Also, when I join a swarm, will it be connecting to peers automagically?
      • kmossco joined the channel
      • (RangerMauve) More specifically, I'm having a hard time figuring out how to share a swarm between multiple dats.
      • RangerMauve joined the channel
      • (RangerMauve) :cry: Is there documentation on how discovery swarm works and is used in dat?
      • RangerMauve has quit
      • pfrazee
        @RangerMauve yeah we use a single swarm. Take a look inside library.js
      • if you ctrl+f for `archiveSwarm` you should see the full story
      • kmossco has quit
      • shama joined the channel
      • dat-gitter
        (RangerMauve) pfrazee: Yeah, that's what I've been reading. From what I understand, you provide a createReplicationStream function which gets the info about the peer (IP/discovery keys?). Then you start replicating with it using hypercoreProtocol. In my case I want to have multiple clients using the same swarm. If I have two clients that want connections from the same peer, should I use the first stream for the client and open
      • another connection? Or am I going about this all wrong and should have individual swarms per browser client?
      • micahscopes has quit
      • (RangerMauve) It looks like discovery swarm is really no geared towards having multiple connections to a peer. :(
      • (RangerMauve) *really not
      • pfrazee
        @RangerMauve it's definitely designed to establish only one connection, but you can multiplex hypercore feeds
      • that's basically what's happening whenever you replicate a hyperdrive
      • I dont know all the details but I'm about to get into this space myself because I need to multiplex hypercores for the mounting code
      • i'm *fairly* sure that, for each hypercore you replicate() onto the stream, the remote will get an 'feed' event and then it's up to them to respond by replicate()ing the correct hypercore in response
      • dat-gitter
        (RangerMauve) Yeah, I was hoping to avoid making this hypercore-specific to make it useful in applications outside of dat. Probably a bit too ambitious, though. ๐Ÿ˜…
      • (RangerMauve) pfrazee: That's how I understood it, too.
      • (RangerMauve) Actually, I think I could totally make it work with multiple connections.
      • ilyaigpetrov joined the channel
      • (RangerMauve)
      • (RangerMauve) I might be missing something, though
      • (RangerMauve) I guess I'll have to make it hypercore specific after all. /shrug
      • (RangerMauve) Actually! That's the hex id which I could make different somehow.
      • millette
        doh, I just got it: no/de, de/no
      • pfrazee
        mafintosh: lol yeah
      • discopatrick joined the channel
      • dat-gitter
        (RangerMauve) I guess I'll just need to use discovery-channel and the handshake from discovery-swarm without using the swarm directly. /shrug
      • emilbayes
        I know there has been talk about dat forks, in case the same key is used twice. How about revokcation? I'd really like a special message that hypercore recognises as a "seal" or revoke, so any messages after that are ignored
      • millette
        emilbayes, there was this short exchange on the subject https://github.com/datprotocol/discussions/issu...
      • dat-gitter
        (fsteff) Can someone point me out to how dat resolves peers over dns?
      • (fsteff) Is there a document or do I have to dig through the code?
      • pfrazee
        emilbayes: another relevant discussion here https://github.com/datprotocol/DEPs/issues/31
      • @fsteff are you asking, how does a domain name become a dat key, or are you asking, how does a dat key become peer IPs?
      • dat-gitter
        (fsteff) How a dat key becomes a peer ip is what I am interested in - does this use the default dns protocol or some other form?
      • millette
      • dat-gitter
        (RangerMauve) fsteff: Basically, there's a DNS server, clients send it requests saying "Hey, I'm a peer for such and such key", then others send request being like "Hey, what peers are there for such and such key?"
      • (RangerMauve) The key for your dat is hashed to derive the "discovery key" which is what is used to find peers from the DNS server
      • (RangerMauve) I don't think there's a document for this anywhere
      • millette
        I think that's implemented in https://github.com/mafintosh/dns-discovery
      • dat-gitter
        (RangerMauve) ^
      • (fsteff) millette: thanks, I was hoping I do not have to dig through all that code to find out the details ;-)
      • (fsteff) @RangerMauve I do understand how this is done, but I am wondering about the details.
      • (fsteff) I am currently thinking about how I could implement an extremely lightweight replacement for discovery-swarm that can be used for mobile apps.
      • (RangerMauve) fsteff: That's exactly what I want, too. :D Glad to see you're making it already. :P
      • (RangerMauve) I don't think you'll be able to get away with not reading the code, though. ๐Ÿ˜…
      • millette
        I can mime it for you
      • dat-gitter
        (RangerMauve) dns-socket is going to be where you'll want to start to figure out the protocol for the DNS server
      • (RangerMauve) @fsteff With discovery-swarm for mobile apps, do you mean to use in native Java / Swift applications? Or are you still planning on interfacing with it using JS?
      • (fsteff) @RangerMauve Still thinking about how this could work at all...
      • (fsteff) Eg. for an android app: a little networking library that does the dns lookups and TCP connections - the rest is done in a webview, and the communication between the native code and the webview can be done by calling the js functions using the android api
      • (RangerMauve) fsteff: Would you mind waiting on this until after I finish https://github.com/RangerMauve/discovery-swarm-... ?
      • (RangerMauve) Then we could have a standard interface for proxying to discovery-swarm instances and you could implement the server for it using native libraries
      • (RangerMauve) Though, I guess there's a bunch of stuff to do on the discovery-swarm side before you can even start on the web view portion
      • (fsteff) depends on how long it takes you ;-)
      • (fsteff) I am at the very beginning of the planning, so until I actually write some code it will take me a while anyway.
      • (RangerMauve) Yeah, try implementing the native portion of discovery swarm, and hopefully I'll have the protocol and the client-side done for you by then. :D
      • (RangerMauve) I'm planning on using protocol buffers for the protocol so you won't need to do any weird parsing logic for it
      • (RangerMauve) So you can use whatever java/swift libraries that can read protocol buffer definitions
      • (fsteff) @RangerMauve At least for android I think it would not even be necessary to communicate using a websocket - it is possible to call js functions in a webview from java.
      • (fsteff) As far as I understood it right it would only be necessary to pipe through all the communication between the hypercore and the TCP socket.
      • (fsteff) I guess Iยดll take a look at discovery-swarm first.
      • (RangerMauve) @fsteff Check out how beaker uses discovery-swarm to get a feel of how stuff is getting invoked https://github.com/beakerbrowser/beaker-core/bl...
      • kicks joined the channel
      • M-trashrabbit has left the channel
      • son0p joined the channel
      • rho has quit