Unlock seed once at startup, pass identity to all commands

- main.rs unlocks seed once, prompts passphrase once per app launch
- Identity passed as parameter to send, recv, register, chat
- No more redundant load_seed() calls (was prompting passphrase multiple times)
- info command uses pre-unlocked identity directly

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-03-27 07:49:51 +04:00
parent 37a4c3c54f
commit 3ffac0c751
5 changed files with 36 additions and 47 deletions

View File

@@ -1,16 +1 @@
use crate::keystore;
pub fn run() -> anyhow::Result<()> {
let seed = keystore::load_seed()?;
let identity = seed.derive_identity();
let pub_id = identity.public_identity();
println!("Fingerprint: {}", pub_id.fingerprint);
println!("Signing key: {}", hex::encode(pub_id.signing.as_bytes()));
println!(
"Encryption key: {}",
hex::encode(pub_id.encryption.as_bytes())
);
Ok(())
}
// Info is now handled directly in main.rs with the pre-unlocked identity.