Commit Graph
124 Commits
Author SHA1 Message Date
Pablo d2ecbdbf7f docs(iroh-cli): fix typo (#2718)
## Description

Fixes a typo introduced in a previous PR.

## 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.
- [X] 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.
2024-09-06 14:16:27 +00:00
PabloandPhilipp Krüger 7b6c974022 docs(iroh-cli): update docs command documentation (#2703)
## Description

Update documentation to RPC's subcommand `docs`.

This partially addresses #2660, and belongs to a series of PRs to
complete it.

## Breaking Changes

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

## Notes & open questions

Imports have been formated to be grouped.

## Change checklist

- [ ] Self-review.
- [X] 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: Philipp Krüger <philipp.krueger1@gmail.com>
2024-09-06 13:18:23 +00:00
PabloandPhilipp Krüger 76b1473d37 docs(iroh-cli): update blobs command documentation (#2704)
## Description

Update documentation to RPC's subcommand `blobs`.

This partially addresses #2660, and belongs to a series of PRs to
complete it

## Breaking Changes

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

## Notes & open questions

Imports have been formated to be grouped.

## Change checklist

- [ ] Self-review.
- [X] 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: Philipp Krüger <philipp.krueger1@gmail.com>
2024-09-06 12:20:39 +00:00
Pablo 7510a59b87 docs(iroh-cli): update tags command documentation (#2709)
## Description

<!-- A summary of what this pull request achieves and a rough list of
changes. -->
Update documentation to `tags` command.

This partially addresses #2660, and belongs to a series of PRs to
complete it

## Breaking Changes

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

## Notes & open questions

Imports have been formated to be grouped.

## Change checklist

- [ ] Self-review.
- [X] 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.
2024-09-06 11:51:01 +00:00
Pablo bdaeba1b96 docs(iroh-cli): update gossip command documentation (#2706)
## Description

Update documentation to `console` commands.

This partially addresses #2660, and belongs to a series of PRs to
complete it

## Breaking Changes

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

## Notes & open questions

Imports have been formated to be grouped.

## Change checklist

- [ ] Self-review.
- [X] 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.
2024-09-06 11:50:34 +00:00
Pablo 518d439684 docs(iroh-cli): update rpc command documentation (#2711)
## Description

<!-- A summary of what this pull request achieves and a rough list of
changes. -->
Update documentation to tags command.

This partially addresses #2660, and belongs to a series of PRs to
complete it.

## 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.
-->
Imports have been formated to be grouped.

## Change checklist

- [ ] Self-review.
- [X] 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.
2024-09-06 10:41:43 +00:00
Pablo 2636be8586 docs(iroh-cli): update start command documentation (#2708)
## Description

<!-- A summary of what this pull request achieves and a rough list of
changes. -->
Update documentation to `start` command.

This partially addresses #2660, and belongs to a series of PRs to
complete it.

## Breaking Changes

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

## Notes & open questions

Imports have been formated to be grouped.

## Change checklist

- [ ] Self-review.
- [x] 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.
2024-09-06 10:28:58 +00:00
Pablo 8c321a2a48 docs(iroh-cli): update net command documentation (#2707)
## Description

<!-- A summary of what this pull request achieves and a rough list of
changes. -->
Update documentation to `net` command.

This partially addresses #2660, and belongs to a series of PRs to
complete it

## Breaking Changes

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

## Notes & open questions

Imports have been formated to be grouped.

## Change checklist

- [ ] Self-review.
- [x] 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.
2024-09-06 10:22:35 +00:00
Pablo 4964ee3652 docs(iroh-cli): update console command documentation (#2705)
## Description

Update documentation to `console` command.

This partially addresses #2660, and belongs to a series of PRs to
complete it

## Breaking Changes

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

## Notes & open questions

Imports have been formated to be grouped.

## Change checklist

- [ ] Self-review.
- [x] 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.
2024-09-06 10:08:55 +00:00
Pablo 2c199a02e8 docs(iroh-cli): update authors command documentation (#2702)
## Description

Update documentation to RPC's subcommand `authors`.

This partially addresses #2660, and belongs to a series of PRs to
complete it.

## Breaking Changes

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

## Notes & open questions

The imports have been formatted to join similar `use` paths.

## Change checklist

- [ ] Self-review.
- [X] 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.
2024-09-06 10:01:55 +00:00
Pablo 93b400a067 docs(iroh-cli): udpate doctor command documentation (#2710)
## Description

Update documentation to `doctor` command submodule.

This partially addresses #2660, and belongs to a series of PRs to
complete it.

## 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.
-->
Imports have been formated to be grouped.

## Change checklist

- [ ] Self-review.
- [X] 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.
2024-09-06 09:06:32 +00:00
PabloandPhilipp Krüger c6e2f05e3a docs(iroh-cli): add docs to entrypoint (#2697)
## Description

Add documentation to undocumented items in the entrypoint for the
`iroh-cli` at `iroh/iroh-cli/src/commands.rs`.

This partially addresses #2660, and belongs to a series of PRs to
complete it.

## Breaking Changes

No breaking changes.

## Notes & open questions

No additional notes.

## Change checklist

- [ ] Self-review.
- [X] 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: Philipp Krüger <philipp.krueger1@gmail.com>
2024-09-05 14:11:34 +00:00
Floris Bruynooghe 35e9873901 refactor!: Migrate to tokio's AbortOnDropHandle (#2701)
## Description

This migrates us to tokio's AbortOnDropHandle from the various
versions we had for this ourselves.  Only for iroh::node::Node we keep
a local version around since it is both Clone *and* awaits the tasks.
Generally it's probably better to not make this kind of design though,
if possible.

## Breaking Changes

Removes the `iroh_net::util` module.  This only contained utilities
that should have been internal in the first place.  If you were using
one of the tools to abort tasks on drop, we recommend migrating to
`tokio_util::task::AbortOnDropHandle`.

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] 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.~~
- [x] All breaking changes documented.
2024-09-05 14:02:04 +00:00
2e5188a1f3 feat: allow to bind to a specific address (#2694)
## Description

Allows to specify the IPv4 and IPv6 addresses where iroh should bind to.

Closes #2565

## Breaking Changes

- changed 
  - `iroh_net::endpoint::Endpoint::bind` now takes  no arguments
- removed
  -  `iroh::node::Builder::bind_port`
- added
  -  `iroh_net::endpoint::Builder::bind_addr_v4`
  -  `iroh_net::endpoint::Builder::bind_addr_v6`
  -  `iroh::node::Builder::bind_addr_v4`
  -  `iroh::node::Builder::bind_addr_v6`
  -  `iroh::node::Builder::bind_random_port`

## Change checklist

- [x] Self-review.
- [x] 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.
- [x] Tests if relevant.
- [x] All breaking changes documented.

---------

Co-authored-by: Kasey <kasey@n0.computer>
Co-authored-by: Floris Bruynooghe <flub@n0.computer>
2024-09-05 13:25:32 +00:00
ramfox a029d89a2b chore: Release 2024-09-02 16:00:36 -04:00
34ec5e24b9 feat(iroh-net)!: upgrade to Quinn 0.11 and Rustls 0.23 (#2595)
## Description

Upgrades the Quinn and Rustls dependencies. This touches a lot of
dependencies and affects a lot of the internal API due to the changes in
Quinn.

## Breaking Changes

- `iroh::net::endpoint::Endpoint::accept` now returns `Incoming` instead
of `Connecting`. This allows rejecting incoming connections earlier,
notify the initiating side to retry later and more. To get back
`Connecting`, simply use `Incoming::accept()`. If all you did with
`Connecting` before was to `.await` it, you can do the same with
`Incoming`, too, and get back a `Connection`.
- Removed `iroh::net::endpoint::Builder::concurrent_connections`. The
amount of concurrent connections is now controlled by either calling
`Incoming::accept` or `Incoming::refuse` after `Endpoint::accept`.

## Notes & open questions

See #2273 for the tracking issue coordinating all this work. This is the
last piece of the puzzle.

## Change checklist

- [x] Self-review.
- [x] 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.
- [x] Tests if relevant.
- [x] All breaking changes documented.

---------

Co-authored-by: dignifiedquire <me@dignifiedquire.com>
Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
2024-08-28 15:12:51 +00:00
Divma 060bf8326d refactor(iroh, iroh-blobs, iroh-net)!: remove deprecated items (#2652)
## Description

Removes items deprecated in the last release.

## Breaking Changes

### iroh-blobs
- `iroh_blobs::store::fs::Store::import_flat_store` was previously
deprecated and is now removed. Use iroh <= `0.22.0` to migrate.
- `iroh_blobs::store::fs::FlatStorePaths` is removed. This was only used
for importing flat stores, which were previously deprecated. Use iroh <=
`0.22.0` to migrate.

### iroh
- Automatic migration from flat stores is no longer possible. This was
previously deprecated. Use iroh <= `0.22.0` to migrate.

### iroh-net
- `iroh_net::endpoint::RemoteInfo::last_alive_relay` was previously
deprecated and it's now removed.

## Notes & open questions

n/a

## Change checklist

- [x] 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.~~
- [x] Tests if relevant.
- [x] All breaking changes documented.
2024-08-20 17:55:00 +00:00
ramfox 855e1bbdd2 chore: Release 2024-08-20 09:44:23 -04:00
Philipp Krüger 717b3cdd52 fix(iroh-cli): cli_provide_addresses to use the correct iroh status command (#2649)
## Description

<!-- A summary of what this pull request achieves and a rough list of
changes. -->

`iroh node status` changed to `iroh status` after
https://github.com/n0-computer/iroh/pull/2642

The `cli_provide_addresses` command wasn't set up correctly for that.

## 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

- [x] 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.~~
- [x] All breaking changes documented.
2024-08-20 08:58:20 +00:00
Friedel ZiegelmayerandKasey 6354e04f34 refactor(iroh)!: convert node to net module (#2642)
## Description

Converts the `node` module to the `net` module (`iroh` and `iroh-cli`)

Closes #2639

## Breaking Changes

- No more `deref` of `iroh::net::Client` to `iroh::client::node::Node`
- `iroh::client::node` -> `iroh::client::net`
- `iroh::client::node::Node::shutdown` ->
`iroh::client::Client::shutdown`

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] 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.
- [x] All breaking changes documented.

---------

Co-authored-by: Kasey <kasey@n0.computer>
2024-08-19 17:09:29 +00:00
Rüdiger KlaehnandFriedel Ziegelmayer 134dbeedc7 feat(iroh-net): allow customizing republish delay for the pkarr publisher (#2637)
## Description

The pkarr dht publisher has two delays, the initial delay and the
republish delay. These were constants so far, but now are configurable
in the builder.

This allows us to set the delay to 0s in the dht_discovery_smoke test.

## Breaking Changes

None

## Notes & open questions

Will this fix the flakiness?

## Change checklist

- [x] Self-review.
- [x] 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.
- [x] All breaking changes documented.

Co-authored-by: Friedel Ziegelmayer <me@dignifiedquire.com>
2024-08-19 14:26:37 +00:00
Floris Bruynooghe b17bf1d551 refactor(iroh-net,iroh): rename to remote_info_iter, fixup some docs (#2645)
## Description

This renames remote_infos_iter to remote_info_iter.  This returns an
iterator of remote_info items.  Using plural for "info" adds a double
plural together with "iter", creating something of a pleonasm.

## Breaking Changes

None right now, this is unreleased.

But `Endpoint::remote_infos_iter` -> `Endpoint::remote_info_iter` from
previous breaking changes.

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] 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.~~
- [x] All breaking changes documented.
2024-08-19 14:25:18 +00:00
9d068886f1 refactor(iroh,iroh-net)!: prefer remote to connection in api (#2610)
## Description

Moves some functions and types to use `remote` to describe the
information we know about a node,
instead of connections. This, based on the fact that iroh-net does not
itself handle connections,
making the wording misleading at best.

## Breaking Changes

### iroh
- `client::node::Client::connection_info` ->
`client::node::Client::remote_info`
- `client::node::Client::connections` ->
`client::node::Client::remote_infos_iter`

### iroh-net
- `endpoint::ConnectionInfo` -> `endpoint::RemoteInfo`
- `endpoint::ConnectionInfo::id` is removed since it's internal
information.
- `endpoint::ConnectionInfo::last_alive_relay` is deprecated. Use
`.relay_url.last_alive`
- `endpoint::Endpoint::connection_info` ->
`endpoint::Endpoint::remote_info`
- `endpoint::Endpoint::connection_infos` ->
`endpoint::Endpoint::remote_infos_iter`

### iroh-cli (bin)
- `node connection-info` -> `node remote-info`
- `node connections` -> `node remote-list`

## Notes & open questions

1. We decided to also move many of the (currently) node commands that
come directly from iroh-net to
a new `net` top level api. Doing so we should aim as well to move the
cli to the more gracious
   `remote <node-id>` and `remote list`. In summary:
- we have `iroh node remote <node-id>` and we want `iroh net remote
<remote-id>`
  - we have `iroh node remote-list` and we want `iroh net remote list`
  Issue #2639 is created for this
2. This adds a deprecation that needs to be removed later. Issue #2640
is created for this.

## Change checklist

- [x] Self-review.
- [x] 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.~~
- [x] All breaking changes documented.

---------

Co-authored-by: Diva M <divma@protonmail.com>
Co-authored-by: Kasey <kasey@n0.computer>
2024-08-17 17:55:49 +00:00
Brendan O'Brien 4df1c91f4d refactor(iroh-cli)!: metrics-addr cli arg, metrics off by default (#2631)
## Description

When iroh is running in a docker container, not being able to specify
the full address is an issue. This aligns with the rpc-addr flag.

at the same time–but for different reasons–I'd also like to disable
surfacing metrics by default. My primary reason for this is an
experience I've had numerous times using iroh:
1. Start an initial node
2. Start a second node, on the same machine (usually while debugging or
following a tutorial)
3. See a "can't bind to port" error from the iroh metrics crate
4. Wonder to myself what metrics do, and if they're being sent anywhere
(I know they by default are not)

I think metrics should be treated as an advanced, opt-in feature that
power users discover and are delighted to find. As tribute to this work
I offer to write a docs page about enabling metrics to get this merged.

## Breaking Changes

* `--metrics-port` flag on the iroh cli is now `--metrics-addr`, eg:
specify `127.0.0.1:9090` instead of `9090`

## 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.
2024-08-15 14:56:18 +00:00
Rüdiger KlaehnandPhilipp Krüger 9a55122c97 feat(iroh)!: Blob batch PR, attempt 3 (#2545)
## Description

This is the third attempt to add a batch API for adding blobs. Previous
one was https://github.com/n0-computer/iroh/pull/2339

The basic idea is the following: all changes to the store happen in the
context of a _batch_. All write operations within a batch produce temp
tags. These temp tags are scoped to the batch and keep the data alive as
long as the batch exists.

At some point, the API user has to upgrade one or more temp tags to
permanent tags.

All non-batch operations would long term be implemented in terms of
batch operations.

In a second step, the following rpc calls would be replaced by their
batch equivalent.
- AddStream
- AddPath
- CreateCollection

The third one is very nice, since it means that the notion of a
collection (as in a special kind of hashseq) no longer has to even exist
in the node code.

## Breaking Changes

- iroh::client::blobs::BlobStatus has a new case NotFound
- iroh::client::blobs::BlobStatus::Partial: size is now a BaoBlobSize
instead of a u64

All other public changes are adding of new APIs.

## Notes & open questions

Note: in the previous version I had an optimisation to avoid storing
TempTags in the case where there are multiple TempTags with the same
hash. I removed this to keep things simple. We can add it back later.

## 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.

---------

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
2024-08-15 09:12:46 +00:00
Divma ceb94dab98 docs(iroh-cli): fix help text for incomplete blobs (#2615)
## Description

Aligns the help text for `blobs list incomplete-blobs` with the docs in
iroh.computer.

## Breaking Changes

n/a

## Notes & open questions

n/a

## Change checklist

- [x] Self-review.
- [x] 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.~~
2024-08-12 13:41:20 +00:00
Philipp Krüger 7494566ef2 test(iroh-cli): Replace cli_provide_one_file_large with a faster test (#2607)
## Description

<!-- A summary of what this pull request achieves and a rough list of
changes. -->

The `cli_provide_one_file_large` test takes multiple minutes to
complete.

We talked about removing it altogether in the discord.
The reasoning for removing it is that we already exercise big file
provide & get loops via netsim. So there is no need to run the same code
in debug mode taking >3 minutes in CI.

However, I ended up not removing the test but instead changing it,
because the other tests test really small file sizes, e.g. `1000` bytes.
At those sizes, outboards aren't even generated and files are put inline
into the database.
So instead I worked out the file size required for exercising the whole
external-outboard (and external-file) machinery of iroh-blobs.
The cutoff point is at ~4.1MB, which is really far away from the 1GB
size and should transfer within seconds.

## Breaking Changes

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

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->
Should we just delete the test altogether?

## Change checklist

- [x] Self-review.
- [x] 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.
- [x] Tests if relevant.
- [x] All breaking changes documented.
2024-08-09 11:08:00 +00:00
Divma 1c86dace54 fix(iroh-blobs): do not skip empty partial blobs in migration (#2604)
## Description

When a blob found during migration is missing an outboard, according to
the
`cli_bao_store_migration` test, we should still migrate it. Before this
change
the blob would be ignored. This makes the test no longer broken.

## Breaking Changes

n/a

## Notes & open questions

1. I can reproduce the failure 100% of the time, so before this change
**I consider the test broken, not flaky.**
2. I reproduced the failure by running an iroh node with the exact v0
data the test uses. After the change, I did this again, and also ran
both `validate` and `consistency-check` and got no errors.

## Change checklist

- [x] 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.~~
2024-08-09 10:35:10 +00:00
dignifiedquire d54a5deb09 chore: Release 2024-08-05 22:52:25 +02:00
Franz Heinzmann bdc1c45b82 [wip] refactor(iroh-gossip)!: dispatch gossip events and updates by topic (#2570)
## Description

This PR changes the main public `iroh_gossip` to keep track of
client-side gossip subscriptions. The `net::Gossip` struct now keeps
track of client-side subscribers per topic, which are made up of a pair
of two streams/channels: from the client to the actor a stream of
updates (outgoing messages) and from the actor to the client a stream of
events (incoming messages). Once all client streams&sinks for a topic
are dropped, the topic is being quit.

This builds on the client API added in #2258, but completely removes the
`dispatcher` module, integrating its features directly into the gossip
actor. See below for a short list of the API changes. The new API can be
browsed
[here](https://n0-computer.github.io/iroh/pr/2570/docs/iroh/gossip/net/index.html).

The refactor turned out bigger than initially intended, sorry for that,
but I did not see a good way to reduce the scope.

What's still missing (can also be follow-ups)?:

- [ ] Review the new public API
- [ ] Align the client API to the iroh_gossip API. The `GossipTopic` can
be made to work on both the client and the native API, as it only deals
with streams and sinks.

## Breaking Changes

* `iroh_gossip::dispatcher` is removed with everything that was in it.
use the new API from `iroh_gossip::net::Gossip` instead (see below).
* `iroh_gossip::net::Gossip` methods changed:
  * changed: `join` now returns a `GossipTopic`
* removed: `broadcast`, `broadcast_neighbors`, `subscribe`,
`subscribe_all`, `quit`.
* for `subscribe` use `join` instead, which returns a `GossipTopic`
* for `broadcast` and `broadcast_neighbors` use the respective methods
on `GossipTopic` .
* `quit` is obsolete now, the topic will be quitted once all
`GossipTopic` handles are dropped.
      * `subscribe_all` is no longer available
* `iroh_gossip::net::JoinTopicFut` is removed (is now obsolete)

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] 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.
2024-08-05 19:04:54 +00:00
Friedel Ziegelmayer 1ba033cf0c fix: pin derive_more to avoid sudden breakages (#2584)
To avoid sudden breakages in new releases, pin `deriver_more` to a
specific `beta`
2024-08-03 13:04:19 +00:00
347d45c3de refactor(iroh): remove flume from iroh-cli and iroh (#2543)
## Description

refactor(iroh): remove flume from iroh-cli and iroh

Removes most usages of flume from iroh and all usages of flume from
iroh-cli.

## Breaking Changes

None

## Notes & open questions

Note: this does not remove all usages because we need the iroh docs
purge PR to be merged before that.

## 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.~~

---------

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
Co-authored-by: Kasey <kasey@n0.computer>
Co-authored-by: Kasey Huizinga <ramfox@Kaseys-MBP.lan>
2024-08-02 06:07:00 +00:00
Divma 8e4e586cec docs(iroh-cli): point to the configuration refernce from each iroh subcommand (#2571)
## Description

#2537 mentions someone not finding the configuration options after
running `iroh start --help`. `iroh --help` already mentions both
<https://iroh.computer/docs> in the second line and
<https://iroh.computer/docs/reference/config> in the config flag (this
one
being fairly recent addition to the help text). I'd say the only thing
missing here is to be able to see the docs from the subcommands, which
is what this pr does.

## Breaking Changes

n/a

## Notes & open questions

n/a

## Change checklist

- [x] 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.~~
2024-08-01 11:22:00 +00:00
Divma 9e6b1e0897 test(iroh-cli): make cli resumption tests not flaky (#2564)
## Description

Takes a different approach to tests by doing the setup for them all
first
before running the tests, to prevent windows from whining about a locked
blobs.db used by the provider. This still requires an ephemeral iroh to
obtain
the blobs.db but does not require much re-starting, making it less prone
to
weird shutdown issues. 

## Breaking Changes

n/a

## Notes & open questions

Note that there is sleep as a synchronization point because otherwise
the
folder for the tests will not have the correct contents. Unexpected but
have
seen it happen a lot. We also use a different folder for the iroh
instance
that actually is providing during the tests, in case shutdown is not
done
for the instance that produces the blobs.db, when the one that provides
is
started.

## Change checklist

- [x] 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.~~
- [x] Tests if relevant.
- [ ] ~~All breaking changes documented.~~
2024-07-31 16:56:30 +00:00
Philipp Krüger 29d2e82a57 refactor(iroh-net)!: Improve server modules structure & rename structs (#2568)
## Description

<!-- A summary of what this pull request achieves and a rough list of
changes. -->
This is moving around the relay modules a bit. Mostly so that all
server-specific code is under `iroh-net/src/relay/server/`.
This means there's only a handful of `#[cfg(feature = "iroh-relay")]`s
in `relay.rs` and a bunch of other places due to unused warnings
otherwise.

I've also renamed what was previously `iroh::relay::client::{Client,
ClientBuilder, ClientReceiver, ...}` to
`iroh::relay::client::conn::{Conn, ConnBuilder, ConnReceiver, ...}`,
because otherwise the `Client*` names were duplicated in two modules
that were in a parent-child relationship, which is super confusing.
And really, the inner `Client`s are more about individual connections.

I also resolved a TODO around moving to an `AbortingJoinHandle` in favor
of a custom `RelayHttpServerGuard`.

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->
- Refactored the module structure for users of the `iroh-relay` feature
in iroh-net.

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->
I realize the diff here is quite substantial. Unfortunately the diff is
mostly just bad because I ended up "swapping places" for modules in two
cases, which ended up creating really bad diffs.

I know the diff is quite sad, so it's fair if we say "this is
unreviewable" and I scrap this piece of work. I'm not blocked on this
merging, and I only fairly quickly knocked this out today.
As Mark Twain famously said
> I apologize for such a long PR - I didn't have time to write a short
one.

Or sth like that.

## Change checklist

- [X] Self-review.
- [X] 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.~~
- [X] All breaking changes documented. Yeah? Kinda?
2024-07-31 09:31:29 +00:00
Divma f085e633c8 test(iroh-cli): reduce flakyness of cli_provide_file_resume (#2563)
## Description

In windows there is no way to copy a file being accessed by another
process in an accessible way. This is what makes this test fail since it
attempt to copy the blobs.db folder a couple of times while the iroh
instance that handles is running.

The change is simple: shutdown the provider, copy the files, re-start
the provider. From my perspective, this does not affect what the test is
attempting to assert.

Now, since this includes re-starting the iroh instance that provides the
files several times, and we match on output, sometimes we can get weird
logs related to shutdown. One of those (and the only one I have seen so
far) is for a netcheck report and didn't finish on time. Instead of
logging this in the reportgen actor, the error is bubbled up to be
handled by the netcheck actor (which will have shutdown by then) thus
reducing noise and allowing for better error handling in the future

## Breaking Changes

n/a

## Notes & open questions

n/a

## Change checklist

- [x] 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.~~
- [x] Tests if relevant.
- [ ] ~~All breaking changes documented.~~
2024-07-29 19:21:53 +00:00
Divma 14fcceed53 tests(iroh-cli): remove flaky mark from 5 tests and improve logs (#2562)
## Description

I have not seen these tests fail for at least the past two weeks. I
think they might no longer be flaky. I suspect much of the flakiness
came from quinn's logging errors on shutdown, which no longer happens.

## Breaking Changes

n/a

## Notes & open questions

n/a

## Change checklist

- [x] 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.~~
2024-07-29 15:49:43 +00:00
Asmir Avdicevic ed4420b5df feat: override to staging relays (#2551)
## Description

While I'm not a huge fan of this piece of code, I don't really see much
of an alternative as we want to be able to force the override to use
staging relays even in "prod" environments or when it's deeply
integrated such as the FFI library cases.

This should allow us to override the default relay maps for all of our
CI setups in all of our repos.

## 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.
2024-07-28 21:48:26 +00:00
Floris Bruynooghe 0fc37942be fix(iroh-cli)!: Improve cli and configuration file (#2532)
## Description

The configuration file behaviour is improved:

- Unknown fields will now cause an error rather than be silently
ignored.

- Make it possible to express GcPolicy in the TOML config file.  This
  was not possible before.  It was possible to disable it before, but
  it was disabled by default so that was rather moot.

The --help output is improved:

- Update header of iroh.
- Directly point to config file docs.
- Use consistent style.


<!-- A summary of what this pull request achieves and a rough list of
changes. -->

## Breaking Changes

- Unknown fields in the configuration file will now cause an error.

- Configuring the GC Policy in the configuration file has changed.

<!-- 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.
- [x] 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.
- [x] Tests if relevant.
- [x] All breaking changes documented.
2024-07-25 19:19:40 +00:00
Divma f97c1c0858 tests(iroh-cli): update to new api (#2549)
## Description

We recently update the api from `blob` to `blobs`, and `tag` to `tags`.
This adjusts the tests.

## Breaking Changes
n/a

## Notes & open questions

n/a

## Change checklist

- [x] 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.~~
2024-07-25 19:14:13 +00:00
dignifiedquire 1145b34a2f chore: Release 2024-07-22 20:31:57 +02:00
Asmir Avdicevic 09e9746231 refactor!: metrics (#2464)
## Description

- Cleans up stale counters
- Introduces unique daily node counts on relays
- Introduces a metrics dumper so we can create dumps of metrics and also
view them in doctor plot
- Introduces new trace level counters

## Breaking Changes

- Introduces `metrics_dump_path` on the top level CLI parameters, which
if set will make sure metrics are collected at regular intervals and
written to the provided path in CSV format.

## 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.
2024-07-22 18:07:09 +00:00
Friedel Ziegelmayer 0a8cb8ac8f feat(iroh-net)!: remove fs based peers storage (#2510)
## Description

Instead introduces

- `endpoint::Builder::known_nodes` to provide existing `NodeAddr`s
- you can use `endpoint::Endpoint::connection_infos` to retrieve the
current list of known nodes that can be persisted

## Notes

- `prune_inactive` is not called anymore when storing, only on the
heartbeat, and so there is a chance of storing uninteresting addresses
- the logic of filtering nodes has changed a little bit, to simplify the
code paths


## Breaking Changes

- `endpoint::Builder::peers_path` is removed
- no automatic storage of known peers in `iroh-net`

## TODO

- [x] Recreate automatic storage and loading of peers inside of `iroh`
2024-07-22 15:48:26 +00:00
Rüdiger Klaehn b4506b2c4a fix(iroh-blobs): properly handle Drop in local pool during shutdown (#2517)
## Description

The tokio_util LocalPoolHandle does not properly handle Drop during
shutdown. Its threads are just spawned as detached. So any drop impl
that runs in a local pool thread will be stopped as soon as the process
terminates. This can have some bad consequences if that drop operation
performs IO, like closing files and committing database transactions.

Here is where the threads get spawned. The `std::thread::JoinHandle`s
are just dropped.

https://docs.rs/tokio-util/latest/src/tokio_util/task/spawn_pinned.rs.html#381

Here is some discussion of the observed effects:
https://discord.com/channels/949724860232392765/1260571544414064670

LocalPoolHandle also, of course, is using an unbounded channel:

https://docs.rs/tokio-util/latest/src/tokio_util/task/spawn_pinned.rs.html#372

## Breaking Changes

Public interfaces using tokio_util::task::LocalPoolHandle will now use
our own LocalPool/LocalPoolHandle.

## Notes & open questions

Should we use an unbounded channel like tokio::spawn or
LocalPoolHandle::spawn_pinned? Seems like a big footgun. But if not, we
need to somehow handle when the queue is full.

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] 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.
- [x] Tests if relevant.
- [x] All breaking changes documented.
2024-07-22 14:02:53 +00:00
Friedel Ziegelmayer 4c11c581c7 feat(iroh-cli)!: realign cli commands with library (#2522)
## Description

We had quite a few missmatches between CLI and library naming, this
aligns it.

## Breaking Changes

- cli:
  -  `author` -> `authors`
  - `blob` -> `blobs`
  - `doc` -> `docs`
  - `tag` -> `tags`
  - `new` -> `create`

## Notes & open questions

- Depends on https://github.com/n0-computer/chuck/pull/61

## Change checklist

- [x] Self-review.
- [x] 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.
- [x] Tests if relevant.
- [x] All breaking changes documented.
2024-07-22 10:11:11 +00:00
Philipp Krüger d17ffa3e2e test(iroh-cli): Improve bao_store_migration test logging (#2483)
## Description

We didn't get good logs on the `cli_bao_store_migration` test so far.
Here's what it's output was in a failure case:
```
--- STDOUT:              iroh-cli::cli cli_bao_store_migration ---

running 1 test
|Iroh is running
|Node ID: cnzuojj4sbo2ulpqoo2riyrdsn2j4pnp3b5bgrjubsft72nutlca
iroh started up.
test cli_bao_store_migration ... FAILED

failures:

failures:
    cli_bao_store_migration

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 12 filtered out; finished in 2.71s


--- STDERR:              iroh-cli::cli cli_bao_store_migration ---
thread 'cli_bao_store_migration' panicked at iroh-cli/tests/cli.rs:394:5:
assertion `left == right` failed
  left: ""
 right: "4yny3v7anmzzsajv2amm3nxpqd2owfw4dqnjwq6anv7nj2djmt2q (0 B)\n"
 ```
 
 This was only capturing stdout from one of the four iroh commands.
 
 This PR changes that. Now stdout and stderr are captured by all iroh commands in the `cli_bao_store_migration` test.

## Breaking Changes

None

## Notes & open questions

I've also switched `PathBuf::to_string_lossy()` calls to be `PathBuf::display()` calls.

## Change checklist

- [x] 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.~~
2024-07-16 12:47:58 +00:00
dignifiedquire 264848c72d chore: Release 2024-07-09 14:41:03 +02:00
Philipp Krüger 9dddafcfcf test(iroh-cli): Also test for "minutes" in transfer time regex 😬 (#2475)
## Description

Windows CI was so slow, the transfer was measured in *minutes*, not
*seconds* and printed as such to the CLI.

The CLI tests only expected "seconds" to be printed though. 😬 

Also went ahead and improved performance of `make_test_file` because
damn this test is already slow enough.

## Breaking Changes

None

## Notes & open questions

Idk, do you have any? :P

## Change checklist

- [X] 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.~~
2024-07-08 15:26:50 +00:00
Philipp Krüger aff81520f8 fix(iroh-net): unexpected cfg condition values / possible fix on netbsd (#2476)
## Description

We had some CLI tests that had `#[cfg(feature = "fs-store")]`, but that
feature doesn't exist in `iroh-cli`... so they were never compiled (and
some related code needed for these tests was deleted. I reintroduced
it).

This also fixes what is likely a bug, where `#[cfg(target_arch =
"netbsd")]` was used, but there is no "architecture" netbsd. Only an
*OS* netbsd.

## Breaking Changes

None

## Notes & open questions

--

## Change checklist

- [X] 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.~~
- [X] All breaking changes documented.
2024-07-08 15:03:13 +00:00
Asmir Avdicevicanddignifiedquire debc4fb8c2 feat: docker images for iroh (#2404)
## Description

- Enable binding of the RPC endpoint to arbitrary addresses
- Add Dockerfile for iroh

## Breaking Changes

- changed `iroh::node::Node::my_rpc_port` is now `my_rpc_addr` and
returns `Option<SocketAddr>`
- `iroh::node::Builder::rpc_endpoint` takes `Option<SocketAddr> instead
of `Option<u16>`
- added `iroh::node::Builder::enable_rpc_with_addr` allowing to specify
on which address + port to bind to

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] Documentation updates if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.

---------

Co-authored-by: dignifiedquire <me@dignifiedquire.com>
2024-07-08 11:17:31 +00:00