Skip to content

Commit

Permalink
feat: print out warning if wallet grpc connections fails (#5195)
Browse files Browse the repository at this point in the history
Description
---
This prints out a help message if the Miner's wallet grpc connection fails. This asks if the user has enabled the grpc of the wallet and provides the command to enable it. 

How Has This Been Tested?
---
Manual
  • Loading branch information
SWvheerden committed Feb 21, 2023
1 parent e417e57 commit 4e1cb38
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion applications/tari_miner/src/run_miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,18 @@ async fn connect(config: &MinerConfig) -> Result<(BaseNodeClient<Channel>, Walle
let base_node_addr = multiaddr_to_socketaddr(&config.base_node_grpc_address)?;
info!(target: LOG_TARGET, "🔗 Connecting to base node at {}", base_node_addr);
let node_conn = BaseNodeClient::connect(format!("http://{}", base_node_addr)).await?;
let wallet_conn = connect_wallet(config).await?;

let wallet_conn = match connect_wallet(config).await {
Ok(client) => client,
Err(e) => {
error!(target: LOG_TARGET, "Could not connect to wallet");
error!(
target: LOG_TARGET,
"Is its grpc running? try running it with `--enable-grpc` or enable it in config"
);
return Err(e);
},
};

Ok((node_conn, wallet_conn))
}
Expand Down

0 comments on commit 4e1cb38

Please sign in to comment.