generated from PaulRBerg/hardhat-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add binaries for demonstrating Actor model flexability (#23)
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
21
packages/ciphernode/enclave_node/src/bin/ciphernode-noag.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(()) | ||
} |