myc

Self-custodial remote signer for Radroots apps
git clone https://radroots.dev/git/myc.git
Log | Files | Refs | README | LICENSE

main.rs (988B)


      1 #![forbid(unsafe_code)]
      2 
      3 use serde_json::json;
      4 
      5 #[tokio::main]
      6 async fn main() {
      7     if let Err(err) = myc::run_cli().await {
      8         eprintln!("myc: {err}");
      9         if let Some(attempt_id) = err.discovery_refresh_attempt_id() {
     10             eprintln!("myc: discovery repair attempt id: {attempt_id}");
     11             eprintln!(
     12                 "myc: inspect with `myc audit discovery-repair-attempt --attempt-id {attempt_id}`"
     13             );
     14             let hint = json!({
     15                 "attempt_id": attempt_id,
     16                 "inspect_args": ["audit", "discovery-repair-attempt", "--attempt-id", attempt_id],
     17             });
     18             match serde_json::to_string(&hint) {
     19                 Ok(value) => eprintln!("myc: discovery repair attempt json: {value}"),
     20                 Err(json_error) => eprintln!(
     21                     "myc: failed to serialize discovery repair attempt hint json: {json_error}"
     22                 ),
     23             }
     24         }
     25         std::process::exit(1);
     26     }
     27 }