feat(iroh): add persistence to a local iroh-blobs store#21
Merged
Conversation
This desperately needs clean up, but it does work.
Contributor
Author
|
Implements #20 |
Contributor
Author
|
Todo: inline? |
Also remove direct bao-tree dependency.
Contributor
Author
|
Test with curl: Adding data: Getting info: Getting data: |
rklaehn
marked this pull request as ready for review
December 9, 2025 11:14
Add schema to swagger Fix imports
Contributor
Author
Contributor
|
This looks good and is working for me locally. I think we can merge after resolving merge conflicts |
Contributor
Author
|
@cameronfyfe fixed the merge conflicts |
cameronfyfe
approved these changes
Dec 18, 2025
cameronfyfe
left a comment
Contributor
There was a problem hiding this comment.
👍 I'll fix CI failure in another PR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This is very WIP and mostly serves as a place to have a discussion about the needed feature set.I added a new trait for CRPs to persist data and implemented it for the IrohCrp. So far persistence is only concerned with small to medium sized blobs, so no streaming. But of course the iroh-blobs protocol does support streaming if we need it later.
The implementation contains some utilities that are copied from iroh-blobs and should really be in iroh-blobs in the future.
Persistence is exposed as a new REST endpoint:
/v1/data POST
Cid type will be inferred from http content type, falling back to Raw if no content type is given, and erroring out if no supported content type is given.
In principle this supports multiple storage places, but this opens up the question if a request should be considered successful if a) at least 1 storage backed was successful or b) if all storage backends were successful.
You could also implement an iroh inline Crp that lives in process, but this is TBD. I am not quite sure where the cid router lives in relation to the storage backend.To try this out, you need a blob store that does support PUSH requests, which are disabled by default for security reasons. Such a store can be found in n0-computer/iroh-blobs#195 .You have to explicitly enable the source endpoint id of the pusher. To give a stable endpoint id I have just used the identity of the core also for the iroh endpoint.Cid-router needs to be brought up to date with the latest iroh and blobs, and this will require some changes - most notably node_id is now called endpoint_id. But this can happen in a different PR.
Additional changes: