#![recursion_limit = "256"]
#[macro_use]
extern crate log;
use clap::Parser;
use microservices::error::BootstrapError;
use microservices::shell::LogLevel;
use stored::opts::Opts;
use stored::{Config, LaunchError};
fn main() -> Result<(), BootstrapError<LaunchError>> {
println!("stored: storage microservice");
let opts = Opts::parse();
LogLevel::from_verbosity_flag_count(opts.verbose).apply();
trace!("Command-line arguments: {:?}", &opts);
let mut config = Config {
data_dir: opts.data_dir,
rpc_endpoint: opts.rpc_endpoint,
verbose: opts.verbose,
databases: opts.tables.iter().cloned().collect(),
};
trace!("Daemon configuration: {:?}", config);
config.process();
trace!("Processed configuration: {:?}", config);
debug!("CTL RPC socket {}", config.rpc_endpoint);
debug!("Starting runtime ...");
stored::service::run(config).expect("running stored runtime");
unreachable!()
}