-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat!: add block streaming interface #44
Conversation
walkUnixfsPath (path: UnknownLink|string, options?: AbortOptions): AsyncIterableIterator<UnixFSEntry> | ||
} | ||
|
||
export declare class Dagula implements IDagula { | ||
export declare class Dagula implements BlockService, DagService, UnixfsService { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I'm planning on separating this into multiple classes that implement the respective interfaces. However it's going to take a bit of time because the unixfs specific stuff is all mixed up with the generic DAG traversal stuff.
WIP: #45
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! ✨
🤖 I have created a release *beep* *boop* --- ## [8.0.0](v7.3.0...v8.0.0) (2024-05-14) ### ⚠ BREAKING CHANGES * The `Blockstore` interface now includes a `stream` method that returns a `ReadableStream` and a `stat` method that returns info (byte size). ### Features * add block streaming interface ([#44](#44)) ([2236fe4](2236fe4)) ### Bug Fixes * remove only test ([#42](#42)) ([ca858fb](ca858fb)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Supports byte ranges for raw block requests - including multipart. depends on storacha/dagula#44 refs storacha/freeway#100 (comment) BREAKING CHANGE: dependencies for handlers have changed, splitting out block, DAG and unixfs services. These are all satisfied by the `Dagula` class for the time being.
This PR adds a
streamBlock(cid, [options])
method to Dagula that returns aReadableStream
of block bytes. You can optionally pass a byte range to extract a subset of bytes.Also
statBlock(cid, [options])
that retrieves block info i.e. total size in bytes.The idea is to allow dagula to serve byte ranges from big blocks without having to load the whole thing into memory.
BREAKING CHANGE: The
Blockstore
interface now includes astream
method that returns aReadableStream
and astat
method that returns info (byte size).The format for the
entityBytes
option ofgetPath
has changed. It is now an array of 1 or 2 numbers. SeeRange
type for more details.refs storacha/freeway#100 (comment)