feat(cli): add persistent peers (#1167)

Co-authored-by: lambdaclass-user <github@lambdaclass.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
This commit is contained in:
Tomás
2023-02-08 15:36:06 -03:00
committed by GitHub
parent 4cbd199016
commit 4df228a87e
10 changed files with 118 additions and 14 deletions

View File

@ -68,6 +68,19 @@ impl XdgPath for ConfigPath {
}
}
/// Returns the path to the default reth known peers file.
///
/// Refer to [dirs_next::config_dir] for cross-platform behavior.
#[derive(Default, Debug, Clone)]
#[non_exhaustive]
pub struct KnownPeersPath;
impl XdgPath for KnownPeersPath {
fn resolve() -> Option<PathBuf> {
database_path().map(|p| p.join("known-peers.json"))
}
}
/// Returns the path to the reth logs directory.
///
/// Refer to [dirs_next::cache_dir] for cross-platform behavior.