[Fix] IPC, cli, daemon

This commit is contained in:
Alex-Emmet 2026-07-21 23:05:34 +02:00
commit 56aad3a023
32 changed files with 1356 additions and 399 deletions

View file

@ -6,3 +6,4 @@ edition = "2024"
[dependencies]
iota-cli = { path = "../iota-cli" }
tokio = { version = "1.50.0", features = ["full"] }
tokio-util = { version = "0.7", features = ["rt"] }

View file

@ -10,16 +10,18 @@ fn socket_path() -> PathBuf {
#[tokio::main(flavor = "multi_thread")]
async fn main() {
let path = socket_path();
let ipc = match IpcClient::connect(&path).await {
let ipc = match IpcClient::connect_or_activate(&path).await {
Ok(client) => client,
Err(error) => {
eprintln!(
"Cannot connect to iota-daemon at {}: {error}",
path.display()
);
eprintln!("Ensure iota-daemon.socket is enabled or iota-daemon is running.");
std::process::exit(1);
}
};
ipc.spawn_reconnector();
let ui = start_tui(ipc);
ui.set_screen(Box::new(MainScreen::new(ui.clone()).await))
.await;