feat: accept introcuer details as CLI params

This commit is contained in:
Aravinth Manivannan 2023-12-17 19:22:04 +05:30
parent 9a9e2888d8
commit d74e3f9824
Signed by: realaravinth
GPG key ID: F8F50389936984FF

View file

@ -23,7 +23,7 @@ use dcache::DcacheTypeConfig;
use openraft::Raft; use openraft::Raft;
use tracing_subscriber::EnvFilter; use tracing_subscriber::EnvFilter;
pub type DcacheRaft = Raft<DcacheTypeConfig, DcacheNetwork, DcacheStore>; //pub type DcacheRaft = Raft<DcacheTypeConfig, DcacheNetwork, DcacheStore>;
#[derive(Parser, Clone, Debug)] #[derive(Parser, Clone, Debug)]
#[clap(author, version, about, long_about = None)] #[clap(author, version, about, long_about = None)]
@ -33,6 +33,15 @@ pub struct Opt {
#[clap(long)] #[clap(long)]
pub http_addr: String, 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] #[actix_web::main]
@ -49,5 +58,11 @@ async fn main() -> std::io::Result<()> {
// Parse the parameters passed by arguments. // Parse the parameters passed by arguments.
let options = Opt::parse(); 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
} }