Skip to main content

Crate chia_query

Crate chia_query 

Source
Expand description

§chia-query

Query the Chia blockchain through decentralized peer connections with automatic fallback to the coinset.org HTTP API.

No Chia installation is required. The peer TLS client identity is generated in memory by default (TlsIdentity::Generated), so a client works from a service account with no home directory of its own.

use chia_query::{ChiaQuery, ChiaQueryConfig};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = ChiaQuery::new(ChiaQueryConfig::default()).await?;
    let record = client.get_coin_record_by_name("0xabc...").await?;
    println!("{:?}", record);
    Ok(())
}

Re-exports§

pub use types::*;

Modules§

coinset
Thin HTTP wrapper around the coinset.org REST API.
drift
coinset.org API drift detection.
peer
provider_registry
provider_registry — chia-query as the aggregating [ChainSource] registry.
router
QueryRouter – dispatches each request to the peer backend first (with one retry on a different peer) and falls back to the coinset.org HTTP API if both peer attempts fail.
types

Structs§

ChiaQuery
ChiaQueryConfig

Enums§

NetworkType
TlsIdentity
Where the peer-protocol TLS client identity comes from.