Skip to content

Commit

Permalink
Add binaries for demonstrating Actor model flexability (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryardley authored Aug 27, 2024
1 parent a0eda40 commit 64c5059
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/ciphernode/enclave_node/src/bin/aggregator.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use enclave_core::Actor;
use enclave_core::CommitteeManager;
use enclave_core::EventBus;
use enclave_core::Fhe;
use enclave_core::P2p;
use enclave_core::SimpleLogger;
use std::error::Error;

#[actix_rt::main]
async fn main() -> Result<(), Box<dyn Error>> {
let fhe = Fhe::try_default()?.start();
let bus = EventBus::new(true).start();
SimpleLogger::attach(bus.clone());
CommitteeManager::attach(bus.clone(), fhe.clone());
let (_, h) = P2p::spawn_libp2p(bus.clone())?;
println!("Aggregator");
let _ = tokio::join!(h);
Ok(())
}
21 changes: 21 additions & 0 deletions packages/ciphernode/enclave_node/src/bin/ciphernode-noag.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use enclave_core::Actor;
use enclave_core::Ciphernode;
use enclave_core::Data;
use enclave_core::EventBus;
use enclave_core::Fhe;
use enclave_core::P2p;
use enclave_core::SimpleLogger;
use std::error::Error;

#[actix_rt::main]
async fn main() -> Result<(), Box<dyn Error>> {
let fhe = Fhe::try_default()?.start();
let bus = EventBus::new(true).start();
let data = Data::new(true).start(); // TODO: Use a sled backed Data Actor
SimpleLogger::attach(bus.clone());
Ciphernode::attach(bus.clone(), fhe.clone(), data.clone());
let (_, h) = P2p::spawn_libp2p(bus.clone())?;
println!("Ciphernode");
let _ = tokio::join!(h);
Ok(())
}

0 comments on commit 64c5059

Please sign in to comment.