feat: accept introcuer details as CLI params
This commit is contained in:
parent
9a9e2888d8
commit
d74e3f9824
1 changed files with 17 additions and 2 deletions
|
@ -23,7 +23,7 @@ use dcache::DcacheTypeConfig;
|
|||
use openraft::Raft;
|
||||
use tracing_subscriber::EnvFilter;
|
||||
|
||||
pub type DcacheRaft = Raft<DcacheTypeConfig, DcacheNetwork, DcacheStore>;
|
||||
//pub type DcacheRaft = Raft<DcacheTypeConfig, DcacheNetwork, DcacheStore>;
|
||||
|
||||
#[derive(Parser, Clone, Debug)]
|
||||
#[clap(author, version, about, long_about = None)]
|
||||
|
@ -33,6 +33,15 @@ pub struct Opt {
|
|||
|
||||
#[clap(long)]
|
||||
pub http_addr: String,
|
||||
|
||||
#[clap(long)]
|
||||
pub introducer_id: u64,
|
||||
|
||||
#[clap(long)]
|
||||
pub introducer_addr: String,
|
||||
|
||||
#[clap(long)]
|
||||
pub cluster_size: usize,
|
||||
}
|
||||
|
||||
#[actix_web::main]
|
||||
|
@ -49,5 +58,11 @@ async fn main() -> std::io::Result<()> {
|
|||
// Parse the parameters passed by arguments.
|
||||
let options = Opt::parse();
|
||||
|
||||
start_example_raft_node(options.id, options.http_addr).await
|
||||
start_example_raft_node(
|
||||
options.id,
|
||||
options.http_addr,
|
||||
options.introducer_addr,
|
||||
options.introducer_id,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue