Skip to main content

retrieve_validated_host_information

Function retrieve_validated_host_information 

Source
pub async fn retrieve_validated_host_information(
    client: &Client,
    node_id: u32,
    expected_ed25519_identity: &Option<String>,
    verify_host_information: bool,
) -> Result<SignedHostInformation, Error>
Expand description

Fetch a node’s SignedHostInformation and optionally validate it.

This is the standalone equivalent of the checks performed inside NymNodeApiClientRetriever::get_client, useful when the caller already holds a crate::api::Client and only needs the host information.

When expected_ed25519_identity is Some, the node’s self-reported identity is compared against it — a mismatch produces crate::error::Error::MismatchedIdentity. When verify_host_information is true, the cryptographic signature on the host information is checked — an invalid signature produces crate::error::Error::MissignedHostInformation.