Expand description
§High-level RPC client helpers
The user-facing side of the RPC layer. Where
crate::protocol::rpc::rpc_request and
crate::protocol::rpc::rpc_response deal with packet bytes, this module exposes
end-to-end helpers that:
- Encode the request with the right PoW difficulty (higher when the peer is
unknown, lower when the peer is already in the tracker — see
rpc_server_known_with_requisite_pow). - Dispatch over the supplied transport.
- Decode the response, verifying the signature over the request’s
pow_content_hash— so a reply can only have come from the specific server we addressed, not a replay from another peer. - Return typed payloads or an
ErrorResponseV1.
Call sites either use rpc_server_unknown (first contact / bootstrap) or
rpc_server_known (everything else). Trust-sensitive handlers can opt into a
higher PoW floor via the _with_requisite_pow variant.