-
Notifications
You must be signed in to change notification settings - Fork 213
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: Use BlobFormat
and properly support adding raw blobs
#1518
Conversation
iroh/src/rpc_protocol.rs
Outdated
wrap_in_collection: bool, | ||
}, | ||
/// Add a directory recursively. | ||
Directory { |
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.
maybe not for now, but isn't the question whether to include the directory name basically the same thing as wrap_in_collection? E.g. you add a directory , you might want to preserve the file name.
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.
This should allow adding bare blobs without a wrapping collection. But how do I actually do it, from the CLI?
I tried adding a single file, and it always produces a wrapping collection. I also don't see a CLI option to disable that.
Tried this:
cargo run blob add ../testdir_large_files/test1
3fce9c1
to
7175c54
Compare
Alright:
/// Wrap the added file or directory in a collection.
///
/// When adding a single file, without `wrap` the file is added as a single blob and no
/// collection is created. When enabling `wrap` it also creates a collection with a
/// single entry, where the entry's name is the filename and the entry's content is blob.
///
/// When adding a directory, a collection is always created.
/// Without `wrap`, the collection directly contains the entries from the added direcory.
/// With `wrap`, the directory will be nested so that all names in the collection are
/// prefixed with the directory name, thus preserving the name of the directory.
///
/// When adding content from STDIN and setting `wrap` you also need to set `filename` to name
/// the entry pointing to the content from STDIN.
From my point this is as intuitive as it gets and ready to merge. |
~So what does this do if you give the path to a single file when doing iroh start? It seems that it wraps in a collection, which is Other than that, seems to work just fine.~ Nah, all good. Seems to work. |
Description
With #1496 we also got a
BlobFormat
in more parts of the code base. This extends this to the CLI, bringing with it a few features:iroh blobs add
BlobFormat
in ticketsiroh provide
oriroh send
command that would start a temp node (similar toget
)Notes & open questions
Change checklist