beaker-core
beaker-core copied to clipboard
Move to the new hyperdrive-daemon (WIP)
This is a work-in-progress PR to replace the dat-daemon with the new hyperdrive-daemon which will also move us to the new Dat 2.0 stack. I will update the TODOs as this progresses.
TODOS
- [x] Replace the daemon
getArchiveInfo()- [x] Need a way to fetch the latest version (https://github.com/andrewosh/hyperdrive-daemon-client/issues/5)
- [ ] Implement all existing hyperdrive methods
- [ ] history (relies on upstream)
- [ ] access (relies on upstream)
- [ ] download (relies on upstream)
- [x] createReadStream
- [x] createWriteStream
- [ ] Support for mtime, ctime params
- [x] createDiffStream
- [ ] Need the
.versionof each change
- [ ] Need the
- [x] watch
- [ ] Missing path in event https://github.com/mafintosh/hypertrie/issues/24
- [ ] createNetworkActivityStream
- [ ] PDA2
- [ ] stat() .blocks and .downloaded (relies on upstream)
- [x] readFile opts (relies on upstream)
- [ ] writeFile opts (relies on upstream)
- [ ] mount() should resolve DNS before mounting
- [ ] update docs
- [x] Resolve whether the
.keyfile should be part of drives - [x] https://github.com/andrewosh/hyperdrive-daemon-client/issues/3
- [x] https://github.com/andrewosh/hyperdrive-daemon-client/pull/4
- [x] Update hyperdrive-daemon to level@5
- [x] Issue: Mounting at a version is failing
- [x] Issue: isSymbolicLink() is not returning true
- [ ] Issue: first visit needs to wait for data before attempting to read (getting 'no file found' because not waiting for a file listing to come down)
- [ ] Issue: Daemon will sometimes fail with "Bandwidth exhausted"
- [x] Implement the mount API
- [x] Implement the symlink API
- [ ] Implement network events and stats (relies on upstream)
- [x] Implement disk-usage tracking (relies on upstream)
- [ ] Implement local disk-usage management including clearing all stored data (relies on upstream)
- [x] Test folder-sync
- [x] Move the
exportArchiveToArchivealgorithm out of the old daemon and into beaker (fork relies on this) - [x] Move the folder-sync algorithm out of the old daemon and into beaker
- [x] Move the "preview mode" scoped-fs management out of the old daemon and into beaker
- [ ] Replace or deprecate the auto-download behavior
- [ ] Deprecate or replace the dat bandwidth throttle config
- [ ] Deprecate or replace all debug/logging in the old daemon
- [ ] Deprecate or replace the wire-protocol extensions (datPeers)
- [ ] Move the daemon into an external self-managing process (relies on upstream)
- [ ] Create a migration flow for previous user-data
Achievement unlocked: Loaded a hyperdrive 10 site (from Copenhagen!)
hyperdrive-daemon 0.10.0 has a few changes that should fix a few of your remaining issues: New methods:
createDiffStream, which you can use as a replacement forhistoryfor the time being.checkout, which behaves the same as Hyperdrive.checkout, except it is async and returns a RemoteHyperdrive. You can use these withcreateDiffStreamusing Hyperdrive's API.version, an async method which returns the current drive version.- There are client/server implementations for
download, but don't use that one quite yet (Hyperdrive impl still pending).
Bug fixes:
isSymbolicLinkshould return true for symlinks now, asstatreturns the same object that's used in Hyperdrive (factored out into a separate module).readFileaccepts anencodingoption now..keyis no longer written as an actual file to any drives.- The connection timeout's been increased, and a
connectionTimeoutoption has been exposed so you can tweak it as you need (this will need to be given more thought, too).