Skip to content

Commit

Permalink
Add OWO
Browse files Browse the repository at this point in the history
  • Loading branch information
ryardley committed Oct 3, 2024
1 parent 641aee1 commit 66b79ae
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 14 deletions.
15 changes: 11 additions & 4 deletions packages/ciphernode/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions packages/ciphernode/enclave/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ repository = "https://github.com/gnosisguild/enclave/packages/ciphernode"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
async-std = "1.12.0"
fhe = { git = "https://github.com/gnosisguild/fhe.rs", version = "0.1.0-beta.7" }
fhe-traits = { git = "https://github.com/gnosisguild/fhe.rs", version = "0.1.0-beta.7" }
fhe-util = { git = "https://github.com/gnosisguild/fhe.rs", version = "0.1.0-beta.7" }
enclave_node = { path = "../enclave_node" }
alloy = { version = "0.3.3", features = ["full"] }
clap = { version = "4.5.17", features = ["derive"] }
actix-rt = "2.10.0"
tokio = { version = "1.38", features = ["full"] }
File renamed without changes.
51 changes: 45 additions & 6 deletions packages/ciphernode/enclave/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,48 @@
fn main() {
// read cli inputs and or config options
use alloy::primitives::Address;
use clap::Parser;
use enclave_node::MainCiphernode;

// any preflight checks
const OWO: &str = r#"
___ ___ ___ ___ ___
/\__\ /\ \ /\__\ /\ \ ___ /\__\
/:/ _/_ \:\ \ /:/ / /::\ \ /\ \ /:/ _/_
/:/ /\__\ \:\ \ /:/ / /:/\:\ \ \:\ \ /:/ /\__\
/:/ /:/ _/_ _____\:\ \ /:/ / ___ ___ ___ /:/ /::\ \ \:\ \ /:/ /:/ _/_
/:/_/:/ /\__\ /::::::::\__\ /:/__/ /\__\ /\ \ /\__\ /:/_/:/\:\__\ ___ \:\__\ /:/_/:/ /\__\
\:\/:/ /:/ / \:\~~\~~\/__/ \:\ \ /:/ / \:\ \ /:/ / \:\/:/ \/__/ /\ \ |:| | \:\/:/ /:/ /
\::/_/:/ / \:\ \ \:\ /:/ / \:\ /:/ / \::/__/ \:\ \|:| | \::/_/:/ /
\:\/:/ / \:\ \ \:\/:/ / \:\/:/ / \:\ \ \:\__|:|__| \:\/:/ /
\::/ / \:\__\ \::/ / \::/ / \:\__\ \::::/__/ \::/ /
\/__/ \/__/ \/__/ \/__/ \/__/ ~~~~ \/__/
"#;

// launch production ready enclave node
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
struct Args {
#[arg(short = 'a', long)]
address: String,
#[arg(short = 'r', long)]
rpc: String,
#[arg(short = 'e', long = "enclave-contract")]
enclave_contract: String,
#[arg(short = 'c', long = "registry-contract")]
registry_contract: String,
}

println!("Hello, cipher world!");
}
#[actix_rt::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("\n\n\n\n\n{}", OWO);
println!("\n\n\n\n");
let args = Args::parse();
let address = Address::parse_checksummed(&args.address, None).expect("Invalid address");
println!("LAUNCHING CIPHERNODE: ({})", address);
let registry_contract =
Address::parse_checksummed(&args.registry_contract, None).expect("Invalid address");
let enclave_contract =
Address::parse_checksummed(&args.enclave_contract, None).expect("Invalid address");
let (_, handle) =
MainCiphernode::attach(address, &args.rpc, enclave_contract, registry_contract).await;
let _ = tokio::join!(handle);
Ok(())
}
6 changes: 6 additions & 0 deletions packages/ciphernode/test_helpers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@ edition = "2021"
[dependencies]
actix = "0.13.5"
enclave-core = { path = "../core" }
fhe = { path = "../fhe" }
bincode = "1.3.3"
clap = { version = "4.5.17", features = ["derive"] }
fhe_rs = { package = "fhe", git = "https://github.com/gnosisguild/fhe.rs", version = "0.1.0-beta.7" }
fhe-traits = { git = "https://github.com/gnosisguild/fhe.rs", version = "0.1.0-beta.7" }
rand_chacha = "0.3.1"
rand = "0.8.5"

0 comments on commit 66b79ae

Please sign in to comment.