Skip to main content

Module provider

Module provider 

Source
Expand description

Wallet-filled HTTP provider builder for opening/settling payment channels. 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 and settles payment channels with. The daemon’s boot chain reads and the client’s registry discovery classify a typed chain error with the same classifier.

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.