Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion anchor/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use signature_collector::SignatureCollectorManager;
use slashing_protection::SlashingDatabase;
use slot_clock::{SlotClock, SystemTimeSlotClock};
use ssv_types::OperatorId;
use std::fs;
use std::fs::File;
use std::io::{ErrorKind, Read};
use std::net::SocketAddr;
Expand Down Expand Up @@ -93,6 +94,10 @@ impl Client {
}
};

// Try and create the data directory if it doesn't exist.
fs::create_dir_all(&config.data_dir)
.map_err(|e| format!("Failed to create data directory: {e}"))?;

info!(
beacon_nodes = format!("{:?}", &config.beacon_nodes),
execution_nodes = format!("{:?}", &config.execution_nodes),
Expand Down Expand Up @@ -759,8 +764,13 @@ fn read_or_generate_private_key(path: &Path) -> Result<Rsa<Private>, String> {

info!(path = %path.as_os_str().to_string_lossy(), "Creating private key");

// Keygen requires a directory and not the file, so we send the parent path here.
let Some(parent_dir) = path.parent() else {
return Err(format!("Invalid RSA key path: {path:?}"));
};

let key = run_keygen(Keygen {
output_path: Some(path.to_string_lossy().to_string()),
output_path: Some(parent_dir.to_string_lossy().to_string()),
force: false,
})
.map_err(|e| format!("Unable to write private key: {e:?}"))?;
Expand Down
1 change: 1 addition & 0 deletions anchor/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ fn start_anchor(anchor_config: Node, mut environment: Environment) {
return;
}
};

config.network.domain_type = config.ssv_network.ssv_domain_type.clone();

// Build the core task executor
Expand Down
Loading