Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to track sparsely synced hypercores #2

Open
2 tasks
Frando opened this issue Jul 11, 2020 · 0 comments
Open
2 tasks

Allow to track sparsely synced hypercores #2

Frando opened this issue Jul 11, 2020 · 0 comments

Comments

@Frando
Copy link
Contributor

Frando commented Jul 11, 2020

Currently, the daemon emits an append event if new blocks are appended to a hypercore (either locally or by a remote for synced cores). However, no event is emitted when new blocks are downloaded for a sparsely synced hypercore.

I'd like to explore kappa-style apps on top of hyperspace that would index all downloaded blocks on a set of hypercores. For that to work efficiently, I think two things would be needed:

  • OnDownload method for the hypercore service that is emitted for each block downloaded with { id, seq }. Maybe this method should only be called if requested for a hypercore? So WatchDownloads({ id }), UnwatchDownloads({ id }) and OnDownload({ id, seq }). Or just emit it always, as OnAppend is at the moment. See Watch downloads #5
  • A way to quickly access which blocks have been downloaded for a hypercore, so maybe a GetBitfield or similar. This can be worked around by iterating and calling Has for each seq, which might be good enough. (This will be needed on each startup of the indexer client, because it cannot know if download events happened while it wasn't running). See Expose bitfield #7
This was referenced Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant