-
Notifications
You must be signed in to change notification settings - Fork 396
Expand file tree
/
Copy pathmain.rs
More file actions
31 lines (25 loc) · 960 Bytes
/
main.rs
File metadata and controls
31 lines (25 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use std::env;
use proof_aggregator::backend::{config::Config, ProofAggregator};
use tracing_subscriber::FmtSubscriber;
fn read_config_filepath_from_args() -> String {
let args: Vec<String> = env::args().collect();
if args.len() < 2 {
panic!(
"You mus provide a config file. Usage: {} <config-file-path>",
args[0]
);
}
args[1].clone()
}
#[tokio::main]
async fn main() {
let subscriber = FmtSubscriber::builder().finish();
tracing::subscriber::set_global_default(subscriber).expect("setting default subscriber failed");
// load config
let config_file_path = read_config_filepath_from_args();
tracing::info!("Loading config from {}...", config_file_path);
let config = Config::from_file(&config_file_path).expect("Config is valid");
tracing::info!("Config loaded");
let mut proof_aggregator = ProofAggregator::new(&config);
proof_aggregator.start(&config).await;
}