Expand description
§rustchain-client
An HTTP client for the RustChain Proof-of-Antiquity blockchain API.
RustChain is the first blockchain that rewards vintage hardware (PowerPC G4, IBM POWER8, Pentium 4, etc.) for being old — not fast. This crate provides a typed Rust client for querying the RustChain node API.
§Quick Start
use rustchain_client::RustChainClient;
#[tokio::main]
async fn main() -> Result<(), rustchain_client::Error> {
let client = RustChainClient::new("https://rustchain.org")?;
// Check node health
let health = client.health().await?;
println!("Node status: {}", health.status);
// Get current epoch
let epoch = client.epoch().await?;
println!("Current epoch: {}", epoch.epoch);
// List active miners
let miners = client.miners().await?;
println!("Active miners: {}", miners.len());
Ok(())
}§Features
- Query node health, uptime, and version
- Get current epoch information and reward pools
- List active miners with hardware details and antiquity multipliers
- Check wallet balances
- Submit and query attestations
- List and vote on governance proposals
- Uses
rustlsfor TLS (no OpenSSL dependency) - Supports self-signed certificates (common on RustChain nodes)
Structs§
- Agent
Job - Agent Economy job listing.
- Agent
Jobs Response - Agent Economy jobs list response.
- Attestation
Response - Response after submitting an attestation.
- Attestation
Submit - Attestation submission payload.
- Epoch
Response - Response from the
/epochendpoint. - Health
Response - Response from the
/healthendpoint. - Miner
- A single miner entry from the
/api/minersendpoint. - Proposal
- A governance proposal.
- Rust
Chain Client - The main RustChain API client.
- Vote
- Governance vote payload.
- Vote
Response - Vote submission response.
- Wallet
Balance - Wallet balance response.
Enums§
- Error
- Errors that can occur when using the RustChain API client.