From 2a19f91e99a4d4d83916fed1fa028fd8683b5ba5 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 9 May 2016 12:04:00 +0100 Subject: [PATCH] Fix --geth IPC for MacOS. (#1062) --- parity/configuration.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/parity/configuration.rs b/parity/configuration.rs index 7a797a2be..8d0eea9bb 100644 --- a/parity/configuration.rs +++ b/parity/configuration.rs @@ -266,11 +266,19 @@ impl Configuration { pub fn rpc_cors(&self) -> Option { self.args.flag_jsonrpc_cors.clone().or(self.args.flag_rpccorsdomain.clone()) } + + fn geth_ipc_path() -> &'static str { + if cfg!(target_os = "macos") { + "$HOME/Library/Ethereum/geth.ipc" + } else { + "$HOME/.ethereum/geth.ipc" + } + } pub fn ipc_settings(&self) -> IpcConfiguration { IpcConfiguration { enabled: !(self.args.flag_ipcdisable || self.args.flag_ipc_off), - socket_addr: if self.args.flag_geth { "$HOME/.ethereum/geth.ipc".to_owned() } else { self.args.flag_ipcpath.clone().unwrap_or(self.args.flag_ipc_path.clone()) } + socket_addr: if self.args.flag_geth { Self::geth_ipc_path().to_owned() } else { self.args.flag_ipcpath.clone().unwrap_or(self.args.flag_ipc_path.clone()) } .replace("$HOME", env::home_dir().unwrap().to_str().unwrap()), apis: self.args.flag_ipcapi.clone().unwrap_or(self.args.flag_ipc_apis.clone()), }