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
ChiaLightClient— connect,subscribe_coins,subscribe_puzzle_hashes,submit_spend,peak,unsubscribe_coins,reconnect, andas_chain_source_provider.ChiaPeerProvider— the synchronous, fail-closedChainSourceprovider dig-node registers.
§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§
- Chia
Light Client - A connected Chia wallet-protocol light client.
- Chia
Peer Config - Connection + trust configuration for a
ChiaLightClient. - Chia
Peer Provider - A
ChainSourceprovider backed by a subscribing Chia light client. - Peer
Fetcher - A
CoinStateFetcherbacked by a live wallet-protocolPeer. - Provider
Info - The self-description a provider hands the registry when it registers.
Enums§
- Chain
Source Error - The reason a
ChainSourcecould not reliably answer a read. - Chia
Network - The Chia network a client speaks to.
- Chia
Peer Error - The reason a Chia light-client peer read could not complete reliably.
- Provider
Kind - The category of a chain-source provider, so the registry can order and trust-weight providers.
- Submit
Outcome - The outcome of submitting a spend bundle, mapped from the node’s
TransactionAckstatus 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.tomlat build time.
Traits§
- Chain
Source - A reads-only view of Chia chain state — the single canonical contract every provider implements and every consumer depends on.
- Chain
Source Provider - A
ChainSourcethat describes itself to the aggregating registry. - Coin
State Fetcher - The reads a provider issues against a Chia full node when its local cache misses.