-
Notifications
You must be signed in to change notification settings - Fork 178
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: Adding raw blocks as leafs in DirectoryBuilder
#679
Conversation
…iroh` commands (n0-computer#348) * docs: add full help text for `lookup`, `connect`, `get`, `p2p`, and `iroh` commands * move long descriptions into constants Co-authored-by: b5 <[email protected]>
Newer clippy wants the identifiers in the format string when possible. Boring change but why not.
This makes sure to await the future from async_channel::Sender::send. When not awaiting this only makes a struct and noting is ever sent. Caught by clippy really.
…puter#656) Updates the requirements on [sysinfo](https://github.com/GuillaumeGomez/sysinfo) to permit the latest version. - [Release notes](https://github.com/GuillaumeGomez/sysinfo/releases) - [Changelog](https://github.com/GuillaumeGomez/sysinfo/blob/master/CHANGELOG.md) - [Commits](https://github.com/GuillaumeGomez/sysinfo/commits) --- updated-dependencies: - dependency-name: sysinfo dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Floris Bruynooghe <[email protected]>
…er#657) Updates the requirements on [rlimit](https://github.com/Nugine/rlimit) to permit the latest version. - [Release notes](https://github.com/Nugine/rlimit/releases) - [Changelog](https://github.com/Nugine/rlimit/blob/master/CHANGELOG.md) - [Commits](Nugine/rlimit@v0.8.3...v0.8.3) --- updated-dependencies: - dependency-name: rlimit dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Floris Bruynooghe <[email protected]>
…uter#659) Updates the requirements on [base64](https://github.com/marshallpierce/rust-base64) to permit the latest version. - [Release notes](https://github.com/marshallpierce/rust-base64/releases) - [Changelog](https://github.com/marshallpierce/rust-base64/blob/master/RELEASE-NOTES.md) - [Commits](marshallpierce/rust-base64@v0.13.1...v0.13.1) --- updated-dependencies: - dependency-name: base64 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Floris Bruynooghe <[email protected]>
The store does not use the RPC client at all. Remove it.
We used to use the same config for the service and server (aka the binary). This is confusing when creating configs to use with e.g. iroh-one, iroh-embed or iroh-share because some fields are not used. This splits off the config structs to avoid this problem, services now have a Config and binaries a ServerConfig. This allows creating the services standalone without all the baggage a server needs. While this isn't many fields yet, this will get worse as we add more features (this is split off from another PR where this seemed useful).
This removes the use of mockall which is causing a lot of trouble with the cargo features intricacies it brings with it. A lot of the tooling struggles with these different versions of the structs which also behave differently in surprising ways. The tests affected by this will be converted into end-to-end tests as part of is now unused. This is possibly only temprorary and that might come back when the end-to-end tests are added.
DirectoryBuilder
DirectoryBuilder
e492aa7
to
e136e03
Compare
iroh-unixfs/src/builder.rs
Outdated
@@ -559,6 +598,10 @@ impl DirectoryBuilder { | |||
|
|||
Ok(if let Some(path) = path { | |||
let mut dir = make_dir_from_path(path, chunker.clone(), degree).await?; | |||
match &mut dir { | |||
Directory::Basic(basic) => basic.entries.extend(entries), | |||
Directory::Hamt(_) => unimplemented!(), |
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.
Hamt
s are implemented, so this shouldn't be the case
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.
Ok, I need to figure out how to add entries to existent HamtNode. Probably worth to rebuild it entirely
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.
The way this builder works is a bit weird. If path is set, entries are ignored. So maybe you can just put in an assertion that either path is None or entries is empty and be done with it?
I tried to refactor all of this at some point, but was not entirely happy with the results.
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.
Afaik there are no stoppers for working both, path
and entries
. It is just implemented this way for some reasons. I may try to refactor this part
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.
@rklaehn Done with refactoring. I removed path variable in builder and added add_path method that walks over path, converts elements to Entry
and adds them to self.entries
. It makes API more consistent and allows to add multiple paths.
673b9da
to
62c5ee6
Compare
* feat: Add pub ctor to Directory * fix: reduce logging level * feat: Pretty printing for addrs * fix: clippy * pr fixes
I have refactored code here as you suggested @rklaehn. Take a look plz when you'll have a time |
Hello! The code that was previously hosted in this repository has been moved to n0-computer/beetle. If you are still interested in getting your PR merged, please re-open your PR on n0-computer/beetle. Check out our blog post for more info on our new direction for |
In my case I need to manually craft directories, namely adding pre-existent nodes as children for new directory. Here are changes to support adding blocks in
DirectoryBuilder