beaker-core icon indicating copy to clipboard operation
beaker-core copied to clipboard

Move to the new hyperdrive-daemon (WIP)

Open pfrazee opened this issue 6 years ago • 2 comments

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 .version of each change
    • [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 .key file 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 exportArchiveToArchive algorithm 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

pfrazee avatar Jul 10 '19 21:07 pfrazee

Achievement unlocked: Loaded a hyperdrive 10 site (from Copenhagen!)

pfrazee avatar Jul 11 '19 20:07 pfrazee

hyperdrive-daemon 0.10.0 has a few changes that should fix a few of your remaining issues: New methods:

  1. createDiffStream, which you can use as a replacement for history for the time being.
  2. checkout, which behaves the same as Hyperdrive.checkout, except it is async and returns a RemoteHyperdrive. You can use these with createDiffStream using Hyperdrive's API.
  3. version, an async method which returns the current drive version.
  4. There are client/server implementations for download, but don't use that one quite yet (Hyperdrive impl still pending).

Bug fixes:

  1. isSymbolicLink should return true for symlinks now, as stat returns the same object that's used in Hyperdrive (factored out into a separate module).
  2. readFile accepts an encoding option now.
  3. .key is no longer written as an actual file to any drives.
  4. The connection timeout's been increased, and a connectionTimeout option has been exposed so you can tweak it as you need (this will need to be given more thought, too).

andrewosh avatar Aug 15 '19 21:08 andrewosh