or maybe you want to move a materialized view from hypercore storage to a different db and want to delete it
yosh answered part of this irl just now
emilbayes
are u guys in berlin?
substack
yes
mafintosh
yea you can delete
recently found out that you can actually unlink data inside files
using fcntl
emilbayes
fcntl is the coolest
or just discovering these low level things are cool
even though you're at the mercy of the kernel gods
yoshuawuyts
emilbayes: found another cool one the other day. It's possible to have a zero copy file-to-network interface using the sendfile(2) call ✨
emilbayes
yoshuawuyts: Yeah i've seen that in the nginx source :D
yoshuawuyts: Is that exposed in node? would be a cool module for static file serving
yoshuawuyts
emilbayes: hah, not afaik
emilbayes
yoshuawuyts: I remember it always being on of the reasons people wrapped their node.js apps in nginx servers when I was green in node
yoshuawuyts
emilbayes: also the pagecache interface is really cool; write files to disk, but actually not really it's magically kept in memory for a while - kafka makes heavy use of both sendfile and pagecache; never stores anything in memory explicitly
emilbayes
so pagecache is like the inverse of mmap?
mmap being writing virtual memory to disk, when out of space
yoshuawuyts
emilbayes: oh yeah, sounds close enough
emilbayes
yoshuawuyts: I want to explore stuff like this when I get more time
yoshuawuyts: Maybe we should do a low level hack camp duing fall sometime
yoshuawuyts: mafintosh keeps talking about doing a hacking trip
mafintosh: Couldn't you potentially reuse the ctx object in blake2b because js is single threaded?
mafintosh: That would save some allocation time for many small hashes. I'm already reusing the parameter_block
iml_ joined the channel
andrenarchy has quit
mafintosh
pfrazee: okay, pushed a fix to append-tree master
pfrazee
mafintosh: I'll give it a shot
mafintosh
not on npm yet
pfrazee: you need to re-add the missing files in your dat
pfrazee
mafintosh: they're dead for good?
mafintosh
pfrazee: yea sorry about that
corruption bug
pfrazee
mafintosh: no worries
mafintosh
need to write a fuzz'er
was a pretty serious bug actually
pfrazee
can you push to github?
oh yeah?
mafintosh
pfrazee: it is on github
in append-tree master (not npm yet)
pfrazee
oh I was looking at the package.json
mafintosh
wanted to see if i could write a fuzz'er to verify my fix
pfrazee
ok
mafintosh
can't seem to break to fix with various tests
which is good!
so gonna risk a npm release haha
the fix actually makes the code a lot simpler
which is good
my main concern is why i did not do it this way in the beginning
maybe i'm just smarter now
emilbayes: soooo i found a way where the kv is auto compacting
aka, all alive values are auto clustered over time
emilbayes
mafintosh: What do you mean?
mafintosh
emilbayes: so you have a kv store with 3 key/values, a, b, c
emilbayes: so if i delete b the store looks like this now
[a, (nil), c, del(b)]
so instead of doing that!
we can just do this
[(nil), (nil), a, c]
sorry [(nil), (nil), c, a]
aka, instead of deleting b we just rewrite a (closest to b) but! do not link the old b value
emilbayes
So this is the pointers?
mafintosh
a, b, c etc corresponds to the nodes
so they have key,value,pointers
the point is. do not write deletes
just rewrite an old value and do not link the node you want to delete
pfrazee
mafintosh: smarter every day
mafintosh
pfrazee: it's like an incrementing compaction
pfrazee: okay published the append-tree fix
pfrazee
mafintosh: cool
mafintosh
gonna force bump it in hyperdrive
pfrazee: please let me know if anything remotely weird happens after deletes hehe
pfrazee
mafintosh: ok will do
mafintosh
hyperdrive 9.2.9 is out fix a force bump
jhand: o/ reinstall deps
*with not fix
emilbayes
mafintosh: I think I need a ELI5 version :p
mafintosh
emilbayes: i'll show you in person
emilbayes
yeah haah
mafintosh
need a higher bandwidth medium
ekrion has quit
noffle
mafintosh: o/
mafintosh: have you been thinking about multi-user {hypercore,hyperdrive,dat}s?
multi-write, I mean
like hyperlog
yoshuawuyts
noffle: think mafintosh is out rn, but believe he's been working on multi-writer last week
mafintosh
noffle: ya
noffle
what repo ought I be looking at?
mafintosh
not public yet
cause its not working yet
noffle
mafintosh: is there a branch I can poke at? what's the approach you're taking?
Guest46308 joined the channel
mafintosh
noffle: i'll add you to the private one
its only private cause we are force pushing a bunch
hehe
pfrazee
mafintosh: I know youve probably told me this twice, but remind me: does hyperdrive currently do any deduplication within an archive? Eg if I add foo.txt, cp foo.txt foo2.txt, then add foo2.txt, will it double add?
or will foo.txt and foo2.txt both point to the same content-feed blocks?
TheLink
pfrazee: simple authorization doesn't seem to work with beaker, it doesn't present the user/pw popup
mafintosh
pfrazee: currently double adds
TheLink
pfrazee: and gesture navigation works fine in file listings but not on webpages
pfrazee
TheLink: you mean like Basic auth?
TheLink
pfrazee: yes
pfrazee
ok I'll file a bug
mafintosh: ok cool
jhand
mafintosh: should i force bump hyperdrive also?
in cli
mafintosh
jhand: ya good idea
Guest46308 has quit
creationix
mafintosh, is there a hyperdrive fuse binding yet?
or code to automatically import a tree recursively into hyperdrive (not that it's hard)
basically, I'm trying to make a dropbox-like interface. Add a folder as "shared" and access it remotely
I guess desktop dat does some of this
bret
That would be cool
creationix
also, I'm thinking of ways I can use a web of known-trusted peers to speed up discovery
iml_ has quit
(for example, I have a machine at my house and another at my parents'. I want to share a file with them without having to use global dns or dht)
our machines know and trust each-other through something like dht, but optimized for locality
if I create a dat using the desktop client and then try to view it in datproject.org, it normally never shows up.
is this because I'm behind a NAT and DHT is the only way for the public site to find me?
jhand
creationix: you can use mirror-folder for importing, that's what we do
creationix
jhand, what do you mean?
jhand
You can also whitelist IPs but still use the global Discovery
creationix: it's a module
Does recursive & live importing
creationix
so, to use this over a network, I just use hyperdrive for one of the `fs` instances?
or I guess this is unrelated to hyperdrive actually since it handles sync logic
recursive file watchers are a problem though. I need to support sharing entire hard-drives