Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions crates/aleph-cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,10 @@ pub struct NodeListArgs {
#[arg(long, value_enum, rename_all = "lowercase")]
pub r#type: Option<NodeTypeCli>,

/// Address of the corechannel aggregate owner. Defaults to the mainnet address.
#[arg(long)]
pub corechannel_address: Option<String>,

#[command(flatten)]
pub signing: SigningArgs,
}
Expand Down
9 changes: 6 additions & 3 deletions crates/aleph-cli/src/commands/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use aleph_sdk::aggregate_models::corechannel::{CORECHANNEL_ADDRESS, CcnInfo, Crn
use aleph_sdk::client::{AlephAggregateClient, AlephClient};
use aleph_sdk::corechannel::{self, AmendDetails};
use aleph_types::account::Account;
use aleph_types::chain::Address;
use serde::Serialize;
use url::Url;

Expand Down Expand Up @@ -105,9 +106,11 @@ async fn list_nodes(
}
};

let aggregate = aleph_client
.get_corechannel_aggregate(&CORECHANNEL_ADDRESS)
.await?;
let cc_address = match &args.corechannel_address {
Some(addr) => Address::from(addr.clone()),
None => CORECHANNEL_ADDRESS.clone(),
};
let aggregate = aleph_client.get_corechannel_aggregate(&cc_address).await?;

let mut nodes: Vec<NodeInfo> = Vec::new();

Expand Down
4 changes: 3 additions & 1 deletion crates/aleph-sdk/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2044,7 +2044,9 @@ impl AlephAggregateClient for AlephClient {
.get(url)
.query(&[("keys", key)])
.send()
.await?;
.await?
.error_for_status()
.map_err(reqwest_middleware::Error::from)?;
let aggregate_response: AggregateResponse<T> = response
.json()
.await
Expand Down
Loading