aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 1ac1f35..28d18e5 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -83,6 +83,15 @@ pub async fn run() -> Result<()> {
logging::init();
let config = config::load()?;
+ if let Some((file, create)) = &config.node_id {
+ let new = !file.exists();
+ let key = identity::NodeKey::load(file, *create)?;
+ if new {
+ eprintln!("a new node key in {}: a new node", file.display());
+ }
+ println!("{}", key.id());
+ return Ok(());
+ }
if config.print_only {
println!(
"{}",