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

feat: Adding raw blocks as leafs in DirectoryBuilder #679

Closed
wants to merge 708 commits into from

Conversation

ppodolsky
Copy link
Contributor

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

b5 and others added 30 commits October 14, 2022 18:07
…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]>
dignifiedquire and others added 12 commits December 21, 2022 17:52
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.
@ppodolsky ppodolsky changed the title Adding raw blocks as leafs in DirectoryBuilder feat: Adding raw blocks as leafs in DirectoryBuilder Jan 9, 2023
@ppodolsky ppodolsky force-pushed the feature/custom-directories branch from e492aa7 to e136e03 Compare January 9, 2023 11:35
@@ -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!(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hamts are implemented, so this shouldn't be the case

Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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.

@ppodolsky ppodolsky force-pushed the feature/custom-directories branch from 673b9da to 62c5ee6 Compare January 11, 2023 15:14
ppodolsky and others added 4 commits January 11, 2023 22:18
* feat: Add pub ctor to Directory

* fix: reduce logging level

* feat: Pretty printing for addrs

* fix: clippy

* pr fixes
)

* fix(iroh-share): force close gossip task on finish/done

* fmt

* fix
@ppodolsky
Copy link
Contributor Author

I have refactored code here as you suggested @rklaehn. Take a look plz when you'll have a time

@ramfox
Copy link
Contributor

ramfox commented Feb 20, 2023

Hello! The code that was previously hosted in this repository has been moved to n0-computer/beetle. beetle is in maintenance mode, but will still accept PRs.

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 iroh: https://n0.computer/blog/a-new-direction-for-iroh/

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

Successfully merging this pull request may close these issues.