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.
- Loading branch information
Showing
9 changed files
with
67 additions
and
14 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -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(()) | ||
} |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.