Skip to content

Commit

Permalink
fix(dre): DRE-147 Do not require neuron id for fetching trustworthy m…
Browse files Browse the repository at this point in the history
…etrics (#251)

* fix(dre): DRE-147 Do not require neuron id for fetching trustworthy metrics

Neuron is not actually required for this operation.

* Improve the comment
  • Loading branch information
sasa-tomic committed Mar 21, 2024
1 parent 6e6a377 commit 03dfe1f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rs/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ async fn main() -> Result<(), anyhow::Error> {
},

cli::Commands::TrustworthyMetrics { wallet, start_at_timestamp, subnet_ids } => {
// Neuron is not actually needed for this operation, we only need other authentication params
// Unfortunately, we need to create a Cli object to get the NNS URL and this object at the moment
// requires a neuron to be set. We set a dummy neuron here to get around this.
let cli_opts = cli::Opts { neuron_id: Some(0), ..cli_opts.clone() };
let cli = cli::Cli::from_opts(&cli_opts, true).await?;
get_node_metrics_history(CanisterId::from_str(wallet)?, subnet_ids.clone(), *start_at_timestamp, match cli.get_neuron() {
Some(neuron) => neuron,
Expand Down

0 comments on commit 03dfe1f

Please sign in to comment.