diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index d9bb511..4c112fe 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -891,6 +891,24 @@ fn withdraw_rewards(valoper_address: String, wallet_name: String) -> Result Result { + let my_boxed_session = + unsafe { GLOBAL_STRUCT.as_ref() }.ok_or("There is no active session. Timed out.")?; + let mut channel = my_boxed_session + .open_session + .channel_session() + .map_err(|e| e.to_string())?; + channel.exec(&format!( + "yes '{password}' | bash -c -l '$EXECUTE create-bls-key $($EXECUTE keys show {wallet_name} -a) 2>&1'", + password = my_boxed_session.walletpassword, + )).map_err(|e| e.to_string())?; + let mut s = String::new(); + channel.read_to_string(&mut s).map_err(|e| e.to_string())?; + channel.close().map_err(|e| e.to_string())?; + Ok(s) +} + fn main() { tauri::Builder::default() .setup(|app| { @@ -938,6 +956,7 @@ fn main() { stop_installation, check_logs, stop_check_logs, + create_bls_key, ]) .run(tauri::generate_context!()) .expect("error while running tauri application"); diff --git a/src/app.html b/src/app.html index 86d2376..10e697a 100644 --- a/src/app.html +++ b/src/app.html @@ -366,6 +366,7 @@


+