Skip to main content

Crate chia_peer

Crate chia_peer 

Source
Expand description

§chia-peer — DIG Chia light-client connectivity (dig-node seam 1)

A thin wrapper that CONFIGURES and DRIVES chia_wallet_sdk’s light-client Peer so a DIG node can act as a Chia wallet-protocol client: connect to full nodes, subscribe to coin/puzzle-hash state, track the peak, handle reorgs, and submit spend bundles.

The heavy lifting — the wallet-protocol wire, TLS, DNS-introducer discovery, coin-state subscription, and transaction submission — lives in the SDK. This crate adds only DIG glue: IPv6-first dialing (§5.2), a reorg-aware subscription cache, reconnect-with-re-arm, and a ChainSource read facade.

§Shape

§Reads are fail-closed

Through the provider, Ok(None)/empty means the peer reliably reported absence; any transport/subscription-gap failure is an Err, never a false Ok(None) — the crux of the dig_chainsource_interface contract.

§The SDK version pairing

This crate pins chia-wallet-sdk = 0.30, which shares chia-protocol = 0.26 with dig-chainsource-interface. That single chia-protocol version is REQUIRED: a newer SDK pulls a newer chia-protocol whose types would not unify with the interface the provider implements.

Structs§

ChiaLightClient
A connected Chia wallet-protocol light client.
ChiaPeerConfig
Connection + trust configuration for a ChiaLightClient.
ChiaPeerProvider
A ChainSource provider backed by a subscribing Chia light client.
PeerFetcher
A CoinStateFetcher backed by a live wallet-protocol Peer.
ProviderInfo
The self-description a provider hands the registry when it registers.

Enums§

ChainSourceError
The reason a ChainSource could not reliably answer a read.
ChiaNetwork
The Chia network a client speaks to.
ChiaPeerError
The reason a Chia light-client peer read could not complete reliably.
ProviderKind
The category of a chain-source provider, so the registry can order and trust-weight providers.
SubmitOutcome
The outcome of submitting a spend bundle, mapped from the node’s TransactionAck status byte.

Constants§

DEFAULT_PROVIDER_PRIORITY
The default try-order priority a chia-peer provider registers with (lower = tried earlier).
VERSION
The crate version, sourced from Cargo.toml at build time.

Traits§

ChainSource
A reads-only view of Chia chain state — the single canonical contract every provider implements and every consumer depends on.
ChainSourceProvider
A ChainSource that describes itself to the aggregating registry.
CoinStateFetcher
The reads a provider issues against a Chia full node when its local cache misses.