-
Notifications
You must be signed in to change notification settings - Fork 198
Expand file tree
/
Copy pathmain.rs
More file actions
30 lines (25 loc) · 751 Bytes
/
main.rs
File metadata and controls
30 lines (25 loc) · 751 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
use clap::Parser;
use raft_kv_fjall::start_example_raft_node;
use tracing_subscriber::EnvFilter;
#[derive(Parser, Clone, Debug)]
#[clap(author, version, about, long_about = None)]
pub struct Opt {
#[clap(long)]
pub id: u64,
#[clap(long)]
pub addr: String,
}
#[actix_web::main]
async fn main() -> std::io::Result<()> {
// Setup the logger
tracing_subscriber::fmt()
.with_target(true)
.with_thread_ids(true)
.with_level(true)
.with_ansi(false)
.with_env_filter(EnvFilter::from_default_env())
.init();
// Parse the parameters passed by arguments.
let options = Opt::parse();
start_example_raft_node(options.id, format!("{}.db", options.addr), options.addr).await
}