2026-09-10 02:43:45 -04:00
|
|
|
#[tokio::main]
|
|
|
|
|
async fn main() {
|
|
|
|
|
if let Err(e) = boot().await {
|
|
|
|
|
eprintln!("onionwire: {e}");
|
|
|
|
|
std::process::exit(1);
|
2026-09-10 01:43:02 -04:00
|
|
|
}
|
2026-09-10 01:02:33 -04:00
|
|
|
}
|
2026-09-10 02:43:45 -04:00
|
|
|
|
|
|
|
|
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())?
|
|
|
|
|
}
|