fix: also adjust ipc path (#5909)

This commit is contained in:
Matthias Seitz
2023-12-31 23:22:17 +01:00
committed by GitHub
parent cdfdadd6c3
commit 069ca8268e

View File

@@ -195,6 +195,7 @@ impl RpcServerArgs {
/// * The `auth_port` is scaled by a factor of `instance * 100`
/// * The `http_port` is scaled by a factor of `-instance`
/// * The `ws_port` is scaled by a factor of `instance * 2`
/// * The `ipcpath` is appended with the instance number: `/tmp/reth.ipc-<instance>`
///
/// # Panics
/// Warning: if `instance` is zero in debug mode, this will panic.
@@ -212,6 +213,10 @@ impl RpcServerArgs {
self.http_port -= instance - 1;
// ws port is scaled by a factor of instance * 2
self.ws_port += instance * 2 - 2;
// also adjust the ipc path by appending the instance number to the path used for the
// endpoint
self.ipcpath = format!("{}-{}", self.ipcpath, instance);
}
/// Configures and launches _all_ servers.