node: Minor logging improvements

This commit is contained in:
Alexis Sellier 2023-03-06 12:26:40 +01:00
parent 35f22ba37a
commit 54dc34d4b9
No known key found for this signature in database
1 changed files with 6 additions and 2 deletions

View File

@ -5,6 +5,7 @@ use crossbeam_channel as chan;
use cyphernet::addr::PeerAddr;
use localtime::LocalDuration;
use radicle::prelude::Signer;
use radicle::profile;
use radicle_node::crypto::ssh::keystore::{Keystore, MemorySigner};
use radicle_node::prelude::{Address, NodeId};
@ -112,17 +113,20 @@ impl Options {
fn execute() -> anyhow::Result<()> {
logger::init(log::Level::Debug)?;
log::info!("Starting node..");
log::info!(target: "node", "Starting node..");
let options = Options::from_env()?;
let home = profile::home()?;
log::info!("Unlocking node keystore..");
log::info!(target: "node", "Unlocking node keystore..");
let passphrase = term::io::passphrase(profile::env::RAD_PASSPHRASE)
.context(format!("`{}` must be set", profile::env::RAD_PASSPHRASE))?;
let keystore = Keystore::new(&home.keys());
let signer = MemorySigner::load(&keystore, passphrase)?;
log::info!(target: "node", "Node ID is {}", signer.public_key());
let config = service::Config {
connect: options.connect.into_iter().collect(),
external_addresses: options.external_addresses,