Skip to main content

Crate rustchain_client

Crate rustchain_client 

Source
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 rustls for TLS (no OpenSSL dependency)
  • Supports self-signed certificates (common on RustChain nodes)

Structs§

AgentJob
Agent Economy job listing.
AgentJobsResponse
Agent Economy jobs list response.
AttestationResponse
Response after submitting an attestation.
AttestationSubmit
Attestation submission payload.
EpochResponse
Response from the /epoch endpoint.
HealthResponse
Response from the /health endpoint.
Miner
A single miner entry from the /api/miners endpoint.
Proposal
A governance proposal.
RustChainClient
The main RustChain API client.
Vote
Governance vote payload.
VoteResponse
Vote submission response.
WalletBalance
Wallet balance response.

Enums§

Error
Errors that can occur when using the RustChain API client.