Skip to main content

Module provider

Module provider 

Source
Expand description

Wallet-filled HTTP provider builder for opening, topping up, closing and reclaiming payment pools. HTTP provider builders for the decdn CLI and SDK clients — a wallet-filled builder that signs and sends transactions, and a wallet-free builder for reads that run before a keystore is unlocked — plus the retryable-vs-permanent classifier for a failed chain read (is_permanent_contract_error, is_permanent_rpc_error).

It lives in the SDK so any client of the cdn/client/v1 data plane — not just the decdn CLI bin crate — can build the signing provider it opens, tops up, closes and reclaims payment pools with. The daemon’s boot chain reads and the client’s registry discovery classify a typed chain error with the same classifier.

Both builders install ring as the process-wide rustls provider first (decdn_common::tls::install_crypto_provider): alloy’s HTTP transport builds a reqwest client, which panics without one. An SDK host that never installs a provider itself still gets a working chain client.

Functions§

build_provider
Build a wallet-filled HTTP provider that signs and sends transactions as signer. It reads the pending nonce on every send, so it stays correct after a send that pins its own nonce (crate::buyer_pool::top_up) or a transaction sent from elsewhere.
build_read_provider
Build a wallet-free HTTP provider for read-only calls. It lets a command read chain state before it unlocks a keystore, so a check that fails asks for no password.