-
Notifications
You must be signed in to change notification settings - Fork 166
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
refactor!: remove default protocols and iroh-cli #2928
Conversation
430e19a
to
dda20df
Compare
iroh
iroh
iroh
So what's the plan now. Ideally we will set up an Also the docker files should not be removed as we still build images for |
5fb1ef0
to
9feb3a4
Compare
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/2928/docs/iroh/ Last updated: 2024-11-25T20:39:00Z |
## Description Moves our netsim tests to run from an example and only test the lib part of the code, not the full CLI & blobs. Things left to do: - [x] rename the example from `new` to anything that makes more sense `netsim` runs it under `iroh-transfer` - [x] clean up the example code - [x] add the option to provide either a relay config or pass in at least the relay url as an argument - [x] continue the CI adjustment and move all invocations of the netsim runner to run from `iroh_v2` and `integration_v2` sims (we want a less abrupt netsim switchover) - [x] convert the remaining sims in `chuck/netsim/sims` to the new format - [ ] after some time flip back the CI invocations to be regular `iroh` and `integration` sims which includes doing the same on `netsim` and removing the old ones ## Breaking Changes <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist - [ ] Self-review. - [ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented.
f4adb94
to
bc9d420
Compare
where | ||
S: Store, | ||
{ | ||
async fn run(builder: iroh::node::Builder) -> anyhow::Result<()> { | ||
let node = builder | ||
.enable_rpc() |
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.
I was a bit confused at first what node does now. I thought the idea was that iroh is a pure reexport crate and whenever you build a node like thing you DIY it using the router API. E.g. this enable_rpc enables rpc, but only for the node api, which is almost never what people want if they want rpc.
Is the plan to change this at some point?
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.
yes, that Node
will go away, as a follow up to this PR
@@ -0,0 +1,324 @@ | |||
use std::{ |
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.
This is not really an example but a bench, right?
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 intent is for it to be example that we also happen to use for netsim. It benches nothing on it's own though.
dns_resolver: Option<DnsResolver>, | ||
node_discovery: DiscoveryConfig, | ||
docs_storage: DocsStorage, | ||
#[cfg(any(test, feature = "test-utils"))] | ||
insecure_skip_relay_cert_verify: bool, |
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.
This mirrors all the options of the endpoint API. I found that somewhat tedious. Have you considered starting this builder with an endpoint builder?
let ep_builder = Endpoint::builder().insecure_skip_relay_cert_verify(true); // do not not call build yet
Node::builder(ep_builder).node_specific_stuff().build().await?;
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.
that's a good idea, but this builder will be deleted in a follow up anyway
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.
All my reservations are about code that is going to be removed anyway. Also, there seems to be a lot of reformatting of yaml files.
So let's get this over with...
yeah sorry, fighting my temporary editor.. |
Also dropped the required Docker test as it's no longer with us ☠️ |
Description
As previously announced and planned, this removes all protocol implementations from the
iroh
crate, as well as removes theiroh-cli
crate.The core functionality of those protocols, including RPC & CLI now is in the individual crates.
Remove from
iroh
iroh-docs
iroh-blobs
iroh-gossip
Examples
Tests
CLI
Breaking Changes
iroh-cli
removediroh
itself in a docker container, as there is no binary anymoreiroh::blobs
useiroh_blobs
iroh::docs
useiroh_docs
iroh::gossip
useiroh_gossip
iroh::client::blobs
useiroh_blobs::rpc::client
. a memory client is available on Blobsiroh::client::tags
useiroh_blobs::rpc::client
. a memory client is available on Blobsiroh::client::gossip
useiroh_gossip::rpc::client
. a memory client is available on Gossipiroh::client::docs
useiroh_docs::rpc::client
. a memory client is available on Docsiroh::client::authors
useiroh_docs::rpc::client
. a memory client is available on Docsiroh::node::MemNode
, useNode
directlyiroh::node::FsNode
, useNode
directlyiroh::node::Node::local_pool_handle
iroh::node::builder::DocsStorage
iroh::node::builder::Builder::enable_gc_policy
iroh::node::builder::Builder::enable_docs
iroh::node::builder::Builder::register_cb_done
iroh::node::builder::ProtocolBuilder::local_pool_handle
iroh::node::builder::GcPolicy
iroh::util::progress
iroh::util::path::IrohPaths::BaoStoreDir
iroh::util::path::IrohPaths::DocsDatabase
iroh::util::path::IrohPaths::Console
iroh::util::path::IrohPaths::DefaultAuthor
iroh::node::Builder
has no more generic parameters anymoreiroh::node::Node
has no more generic parameters anymoreNotes & open questions
Change checklist