Closed glowkeeper closed 2 years ago
ps. if I run dat share mySharedDir/ --http
then browse http://localhost:8080
, I get a list of all my shared files. Essentially, that's all I want to do above, so I know it's possible :)
I've attached a screengrab of the console:
Is this something to do with webpack
, too?
I'm getting closer! I'm trying this:
var {
Hyperdrive,
close
} = await SDK({
persist: false
})
const myDat = 'dat://328c78dce8a95ad7bfdc5245a99c38e71d8dc75f5671017eec7ef75049dadd6e'
const myArchive = Hyperdrive(myDat)
await myArchive.ready()
console.log(await myArchive.readdir('/'))
That gets a lot further - unfortunately, it lists an empty array, rather than the dozen or so files I'm sharing. And I get this error, now:
I'm guessing I'm doing something wrong, but the docs' aren't very helpful... :(
Hey! I'll investigate further tomorrow but I think the main issue you have right now is that the dat CLI doesn't support the latest versions of Hyperdrive.
Essentially, stuff using the dat://
URL scheme need an older version of the SDK (pre 2.0) or you can use something newer like dat-store
which supports the hyper://
protocol
Gonna close this for now since it's been a while and there hasn't been any updates. 😅
The very first thing I try to do with the sdk gives an error:
I get Uncaught (in promise) Error: Not opened :
What am I doing wrong?