diff --git a/bin/tau/tau-cli/src/main.rs b/bin/tau/tau-cli/src/main.rs index dc4ab71ed..1a753b2e6 100644 --- a/bin/tau/tau-cli/src/main.rs +++ b/bin/tau/tau-cli/src/main.rs @@ -168,7 +168,10 @@ async fn main() -> Result<()> { spawn_config(&config_path, CONFIG_FILE_CONTENTS)?; - let config: TauConfig = Config::::load(config_path)?; + let config: TauConfig = match Config::::load(config_path) { + Ok(c) => c, + Err(_) => TauConfig::default(), + }; start(args, config).await } diff --git a/bin/tau/tau-cli/src/util.rs b/bin/tau/tau-cli/src/util.rs index 9b0aa7c2e..29cbb4c52 100644 --- a/bin/tau/tau-cli/src/util.rs +++ b/bin/tau/tau-cli/src/util.rs @@ -2,7 +2,7 @@ use std::{ env::{temp_dir, var}, fs::{self, File}, io::{self, Read, Write}, - net::SocketAddr, + net::{IpAddr, Ipv4Addr, SocketAddr}, ops::Index, process::Command, }; @@ -24,6 +24,12 @@ pub struct TauConfig { pub rpc_listen: SocketAddr, } +impl Default for TauConfig { + fn default() -> Self { + Self { rpc_listen: SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 11055) } + } +} + #[derive(Subcommand)] pub enum CliTauSubCommands { /// Add a new task