-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #226 from Concordium/consensus-detailed-status
Add `get_consensus_detailed_status` query.
- Loading branch information
Showing
7 changed files
with
726 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule concordium-base
updated
4 files
+2 −1 | haskell-src/Concordium/Types/Transactions.hs | |
+2 −0 | rust-src/concordium_base/CHANGELOG.md | |
+7 −0 | rust-src/concordium_base/src/hashes.rs | |
+4 −0 | rust-src/concordium_base/src/updates.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//! Test the `GetConsensusDetailedStatus` endpoint. | ||
use anyhow::Context; | ||
use clap::AppSettings; | ||
use concordium_rust_sdk::v2; | ||
use structopt::StructOpt; | ||
|
||
#[derive(StructOpt)] | ||
struct App { | ||
#[structopt( | ||
long = "node", | ||
help = "GRPC interface of the node.", | ||
default_value = "http://localhost:20000" | ||
)] | ||
endpoint: v2::Endpoint, | ||
#[structopt(long = "genesis-index", help = "The genesis index to query.")] | ||
genesis_index: Option<u32>, | ||
} | ||
|
||
#[tokio::main(flavor = "multi_thread")] | ||
async fn main() -> anyhow::Result<()> { | ||
let app = { | ||
let app = App::clap().global_setting(AppSettings::ColoredHelp); | ||
let matches = app.get_matches(); | ||
App::from_clap(&matches) | ||
}; | ||
|
||
let mut client = v2::Client::new(app.endpoint.clone()) | ||
.await | ||
.context("Cannot connect.")?; | ||
|
||
let info = client | ||
.get_consensus_detailed_status(app.genesis_index.map(Into::into)) | ||
.await?; | ||
println!("{:#?}", info); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.