Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): document the health RPC method #61

Merged
merged 5 commits into from
Apr 23, 2022
Merged
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
24 changes: 24 additions & 0 deletions src/methods/health.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
//! Requests the health status of the RPC node.
//!
//! ## Example
//!
//! Returns the current health stauts of the RPC node the client connects to.
//!
//! ```
//! use near_jsonrpc_client::{methods, JsonRpcClient};
//!
//! # #[tokio::main]
//! # async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let client = JsonRpcClient::connect("https://rpc.testnet.near.org");
//!
//! let request = methods::health::RpcHealthRequest;
//!
//! let response = client.call(request).await?;
//!
//! assert!(matches!(
//! response,
//! methods::health::RpcHealthResponse
//! ));
//! # Ok(())
//! # }
//! ```
use super::*;

pub use near_jsonrpc_primitives::types::status::{RpcHealthResponse, RpcStatusError};
Expand Down