onionwire/src/main.rs

18 lines
548 B
Rust
Raw Normal View History

#[tokio::main]
async fn main() {
if let Err(e) = boot().await {
eprintln!("onionwire: {e}");
std::process::exit(1);
}
}
async fn boot() -> Result<(), String> {
let home = onionwire::Store::home_dir().map_err(|e| e.to_string())?;
eprintln!("onionwire: bootstrapping Arti…");
let node = onionwire::node::Node::start(home).await?;
let handle = tokio::runtime::Handle::current();
tokio::task::spawn_blocking(move || onionwire::tui::run(node, handle))
.await
.map_err(|e| e.to_string())?
}