n0-computer / iroh

peer-2-peer that just works
https://iroh.computer
Apache License 2.0
2.61k stars 165 forks source link

refactor(iroh)!: Extract net and node rpc #2927

Closed rklaehn closed 5 days ago

rklaehn commented 1 week ago

Description

Introduce a new crate iroh-node-util.

This contains generic utilities that are needed to build an iroh node, as well as the rpc protocol and rpc client to remote control an arbitrary iroh-net endpoint (add/remove addresses etc.) as well as to control the node as a whole (shutdown/stats/status).

Breaking Changes

Notes & open questions

Note: I think the rpc protocol and the client needs some refactoring. It isn't always clear to me what is node and what is net. But I think it might be best to do this in a subsequent PR and keep this one as a pure move things around PR for better separation.

Change checklist

github-actions[bot] commented 1 week ago

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-20T10:37:17Z

dignifiedquire commented 1 week ago

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 commented 1 week ago

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.

rklaehn commented 6 days ago

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

I thought the idea was that iroh becomes a pure reexport crate?

github-actions[bot] commented 6 days ago

Netsim report & logs for this PR have been generated and is available at: LOGS This report will remain available for 3 days.

Last updated for commit: c45bf92

rklaehn commented 6 days ago

It's a very barebones crate for now. Not many deps and not a single feature...

This is the docs:

image
dignifiedquire commented 5 days ago

please document the breaking changes, otherwise I left some last comments and then this should be good to go