use keyfork_mnemonic_util::Mnemonic; use tokio::io::{self, AsyncBufReadExt, BufReader}; #[cfg(feature = "tracing")] use tracing::debug; type Result> = std::result::Result; async fn load_mnemonic() -> Result { let mut stdin = BufReader::new(io::stdin()); let mut line = String::new(); stdin.read_line(&mut line).await?; Ok(line.parse()?) } #[cfg_attr(feature = "multithread", tokio::main)] #[cfg_attr(not(feature = "multithread"), tokio::main(flavor = "current_thread"))] async fn main() -> Result<(), Box> { #[cfg(feature = "tracing")] keyforkd::setup_registry(); #[cfg(feature = "tracing")] debug!("reading mnemonic from standard input"); let mnemonic = load_mnemonic().await?; keyforkd::start_and_run_server(mnemonic).await }