use clap::Subcommand; use tokio::runtime::Runtime; use cardano_connect::CardanoConnect; use crate::cardano_connect; use crate::env::get_env; #[derive(Subcommand)] /// Cardano api pub enum Cmd { /// Health Health, } pub fn handle(cmd: Cmd) { match cmd { Cmd::Health => { let env = get_env(); let conn = cardano_connect::from_env(&env); let rt = Runtime::new().expect("Failed to create Tokio runtime"); rt.block_on(async { println!("{:?}", conn.health().await); }) } }; }