Skip to content

Commit

Permalink
Fix formating
Browse files Browse the repository at this point in the history
  • Loading branch information
ryardley committed Nov 23, 2024
1 parent 5e8c884 commit 3a28889
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 2 additions & 3 deletions packages/ciphernode/config/src/app_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub struct AppConfig {
/// Ethereum Address for the node
address: Option<Address>,
/// A list of libp2p multiaddrs to dial to as peers when joining the network
peers: Vec<String>
peers: Vec<String>,
}

impl Default for AppConfig {
Expand All @@ -86,7 +86,7 @@ impl Default for AppConfig {
config_file: PathBuf::from("config.yaml"), // ~/.config/enclave/config.yaml
cwd: env::current_dir().unwrap_or_default(),
peers: vec![], // NOTE: This should remain empty and we should look at config
// generation via ipns fetch for the latest nodes
// generation via ipns fetch for the latest nodes
address: None,
}
}
Expand Down Expand Up @@ -163,7 +163,6 @@ impl AppConfig {
pub fn peers(&self) -> Vec<String> {
self.peers.clone()
}

}

/// Load the config at the config_file or the default location if not provided
Expand Down
3 changes: 2 additions & 1 deletion packages/ciphernode/enclave_node/src/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ pub async fn setup_aggregator(
.build()
.await?;

let (_, join_handle, peer_id) = P2p::spawn_libp2p(bus.clone(), config.peers()).expect("Failed to setup libp2p");
let (_, join_handle, peer_id) =
P2p::spawn_libp2p(bus.clone(), config.peers()).expect("Failed to setup libp2p");

if let Some(path) = pubkey_write_path {
PublicKeyWriter::attach(path, bus.clone());
Expand Down
3 changes: 2 additions & 1 deletion packages/ciphernode/enclave_node/src/ciphernode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ pub async fn setup_ciphernode(
.build()
.await?;

let (_, join_handle, peer_id) = P2p::spawn_libp2p(bus.clone(), config.peers()).expect("Failed to setup libp2p");
let (_, join_handle, peer_id) =
P2p::spawn_libp2p(bus.clone(), config.peers()).expect("Failed to setup libp2p");

let nm = format!("CIPHER({})", &address.to_string()[0..5]);
SimpleLogger::attach(&nm, bus.clone());
Expand Down
2 changes: 1 addition & 1 deletion packages/ciphernode/p2p/src/p2p.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl P2p {
/// Spawn a Libp2p instance. Calls spawn and listen
pub fn spawn_libp2p(
bus: Addr<EventBus>,
peers: Vec<String>
peers: Vec<String>,
) -> Result<(Addr<Self>, tokio::task::JoinHandle<()>, String), Box<dyn Error>> {
let (mut libp2p, tx, rx) = EnclaveRouter::new()?;
let keypair = libp2p::identity::Keypair::generate_ed25519();
Expand Down

0 comments on commit 3a28889

Please sign in to comment.