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

Extract node rpc #2927

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from
Draft

Extract node rpc #2927

wants to merge 25 commits into from

Conversation

rklaehn
Copy link
Contributor

@rklaehn rklaehn commented Nov 14, 2024

Description

Breaking Changes

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.

Copy link

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/2927/docs/iroh/

Last updated: 2024-11-14T11:19:25Z

pub mod net;
pub mod node;

fn flatten<T, E1, E2>(
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe add this to quic-rpc? its used everywhere 🤣

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Where is this used? In the context of streaming responses, right? I can maybe add it somewhere in client as an util...

}

/// Shuts down the node.
///
/// If `force` is true, the node will be shut down instantly without
/// waiting for things to stop gracefully.
pub async fn shutdown(&self, force: bool) -> Result<()> {
self.rpc.rpc(ShutdownRequest { force }).await?;
Ok(())
self.node().shutdown(force).await
Copy link
Contributor

Choose a reason for hiding this comment

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

we should drop these helper methods, now that they are on .node()

chan: RpcChannel<RpcService, C>,
) -> Result<(), RpcServerError<C>> {
use net::Request::*;
debug!("handling node request: {msg}");
Copy link
Contributor

Choose a reason for hiding this comment

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

net, not node

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's confusing...

@dignifiedquire
Copy link
Contributor

I like the structure, but I am not clear that we really need this in its own repo, or if we just leave it for the moment in iroh

@rklaehn
Copy link
Contributor Author

rklaehn commented Nov 15, 2024

I like the structure, but I am not clear that we really need this in its own repo, or if we just leave it for the moment in iroh

This would help with the insane amount of boilerplate you need when you want to write an iroh node for a specific set of protocols, like e.g. I have to do in the iroh-docs tests here: https://github.com/n0-computer/iroh-docs/blob/main/tests/util.rs#L36

Ideally it should be quite easy to write an iroh node for a specific set of protocols, complete with a bin and a cli that talks to the bin via rpc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

3 participants