## 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>
Bytes, Distributed.
Iroh is a protocol for syncing & moving bytes. Bytes of any size, on any device. At its core, it's a peer-2-peer network built on a magic socket that establishes QUIC connections between peers. Peers request and provide blobs of opaque bytes that are incrementally verified by their BLAKE3 hash during transfer.
Using Iroh
Iroh is delivered as a Rust library and a CLI.
Library
Run cargo add iroh, to add iroh to your project.
CLI
Check out https://iroh.computer/docs/install to get started.
The implementation lives in the iroh-cli crate.
License
Copyright 2024 N0, INC.
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.