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(iroh): improved node builder #2087

Merged
merged 7 commits into from
Mar 18, 2024
Merged

feat(iroh): improved node builder #2087

merged 7 commits into from
Mar 18, 2024

Conversation

dignifiedquire
Copy link
Contributor

@dignifiedquire dignifiedquire commented Mar 16, 2024

  • Self sufficient Node::memory() for in memory configuration
  • Self sufficient Node::persistent(root) for in persistent configuration (including secret key)
  • Easy way to enable rpc endpoint with Builder::enable_rpc()
  • Remove manual setting of local_pool_handle
  • Add type aliases for the main node configurations

Copy link
Contributor

@flub flub left a comment

Choose a reason for hiding this comment

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

much nicer!

let hash = node
.client()
.blobs
.add_bytes(Bytes::from_static(b"Hello, world!"), SetTagOption::Auto)
Copy link
Contributor

Choose a reason for hiding this comment

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

it feels a little bit like this API did get worse by being more verbose. I think b"Hello, world!".into() is already slightly nicer. Maybe it's also worth considering something direct like node::add_blob(blob: impl Into<Blob>).

I'm also happy postponing this to further cleanups.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah that api didn’t chnage ( yet) I just updated the example, so let’s improve this later

@dignifiedquire dignifiedquire added this pull request to the merge queue Mar 18, 2024
Merged via the queue into main with commit 2364329 Mar 18, 2024
20 checks passed
@dignifiedquire dignifiedquire deleted the feat-node-builder branch March 18, 2024 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants