Skip to content

Commit

Permalink
refactor: Move iroh-router into iroh-net and rename iroh-net to…
Browse files Browse the repository at this point in the history
… `iroh` (#2973)

## Description

<!-- A summary of what this pull request achieves and a rough list of
changes. -->
This merges `iroh-net`, `iroh-router` and `iroh` into simply one crate:
`iroh`.

Also adjusts README and documentation messages.

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

- `iroh-net` got renamed to `iroh`
- `iroh-router` moved into `iroh`
- `iroh-router::ProtocolHandler` is now
`iroh::protocol::ProtocolHandler`
- `iroh-router::ProtocolMap` is now `iroh::protocol::ProtocolMap`
- `iroh-router::Router` is now `iroh::router::Router`
- `iroh-router::RouterBuilder` is now `iroh::router::RouterBuilder`

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->
Minor Q: Do the `iroh::protocol` and `iroh::router` modules make sense?

## Change checklist

- [ ] Fix "TODO(matheus23): docs" for `Router` etc.
- [ ] 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.

---------

Co-authored-by: dignifiedquire <me@dignifiedquire.com>
  • Loading branch information
matheus23 and dignifiedquire authored Nov 28, 2024
1 parent 32f1fcd commit f7764ef
Show file tree
Hide file tree
Showing 87 changed files with 918 additions and 1,034 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ jobs:
# uses: obi1kenobi/cargo-semver-checks-action@v2
uses: n0-computer/cargo-semver-checks-action@feat-baseline
with:
package: iroh, iroh-base, iroh-dns-server, iroh-metrics, iroh-net, iroh-net-bench, iroh-node-util, iroh-router, netwatch, portmapper, iroh-relay, iroh-net-report
package: iroh, iroh-base, iroh-dns-server, iroh-metrics, iroh-net-bench, iroh-node-util, netwatch, portmapper, iroh-relay, iroh-net-report
baseline-rev: ${{ env.HEAD_COMMIT_SHA }}
use-cache: false

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ env:
RUSTFLAGS: -Dwarnings
RUSTDOCFLAGS: -Dwarnings
SCCACHE_CACHE_SIZE: "50G"
CRATES_LIST: "iroh,iroh-node-util,iroh-metrics,iroh-net,iroh-net-bench,iroh-test,iroh-dns-server,iroh-router,netwatch,portmapper,iroh-relay,iroh-net-report"
CRATES_LIST: "iroh,iroh-node-util,iroh-metrics,iroh-net-bench,iroh-test,iroh-dns-server,netwatch,portmapper,iroh-relay,iroh-net-report"
IROH_FORCE_STAGING_RELAYS: "1"

jobs:
Expand Down
210 changes: 89 additions & 121 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
[workspace]
members = [
"iroh",
"iroh-base",
"iroh-dns-server",
"iroh-metrics",
"iroh-net",
"iroh",
"iroh-test",
"iroh-net/bench",
"iroh/bench",
"iroh-relay",
"iroh-router",
"net-tools/netwatch",
"net-tools/portmapper",
"iroh-net-report",
Expand Down Expand Up @@ -50,8 +48,7 @@ unused-async = "warn"

# Temporary fix for dependencies
[patch.crates-io]
iroh = { path = "./iroh" }
iroh-base = { path = "./iroh-base" }
iroh-net = { path = "./iroh-net" }
iroh-metrics = { path = "./iroh-metrics" }
iroh-test = { path = "./iroh-test" }
iroh-router = { path = "./iroh-router" }
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ If you want to use iroh from other languages, make sure to check out [iroh-ffi],
## Repository Structure

This repository contains a workspace of crates:
- `iroh`: Re-exports of stables APIs like `iroh-router` and `iroh-net`.
- `iroh-router`: APIs to compose multiple protocols in a node.
- `iroh-net`: The core networking code for hole-punching & connections to relays.
- `iroh`: The core library for hole-punching & communicating with relays.
- `iroh-relay`: The relay server implementation. This is the code we run in production (and you can, too!).
- `iroh-base`: Common types like `Hash`, key types or `RelayUrl`.
- `iroh-metrics`: Helper library for adding metrics support to crates.
Expand All @@ -140,8 +138,6 @@ This repository contains a workspace of crates:
- `iroh-net-report`: Analyzes your host's networking ability & NAT.
- `net-tools/*`: Networking utility crates

The main entry point for anyone interested in the inner workings should be `iroh-net`.

## License

Copyright 2024 N0, INC.
Expand Down
2 changes: 1 addition & 1 deletion iroh-base/src/key.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Cryptographic key handling for `iroh-net`.
//! Cryptographic key handling for `iroh`.
mod encryption;

Expand Down
Loading

0 comments on commit f7764ef

Please sign in to comment.