mirror of
https://github.com/n0-computer/iroh.git
synced 2026-12-04 08:01:34 +00:00
## Description This adds the notion of a node-wide default author for documents. The default author can be retrieved via `iroh.authors.default()`. On persistent nodes, on first start a new author is created and its public key is saved to `IROH_DATA_DIR/default-author` (as a base32 string). For in-memory nodes, a new author is created. When trying to delete the default author via `iroh.authors.delete`, an error is returned, stating that the default author may not be deleted. The default author can be changed with `iroh.authors.set_default`. If the `default-author` file is deleted manually, a new default author will be created on the next start. ## Breaking Changes * Added `iroh.authors.default()`, which returns the author id of a single default author per node * Added `iroh.authors.set_default(&self, author_id: AuthorId)`, which allows to set the default author for the node * `iroh::util::path::IrohPaths` enum gained new variant `DefaultAuthor` ## Notes & open questions There are certainly other ways to go around the interactions between the iroh-local notion of a default author and the author database in the iroh-docs store. Quoting from discord (this PR implements option B.1): > if you delete the default author with the author api, what should happen? >* A: default author remains in place, further operations with it fail > * A.1: on next start new default author is created automatically > * A.2: next start fails, says "delete default_author file by hand" >* B: deletion of default author fails. > * B1: that's the way it is, only way to delete it is to delete `default-author` file by hand and restart the node > * B2: add `set_default_author` rpc call >* C: a new default author is created and set always & automatically ## Change checklist - [x] Self-review. - [x] Documentation updates if relevant. - [x] Tests if relevant. - [x] All breaking changes documented. --------- Co-authored-by: dignifiedquire <me@dignifiedquire.com>
iroh-cli
The CLI for
iroh.
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.