Expand description
Client-side Ark server connector.
This module provides a managed, version-aware gRPC connection between a Bark client and a paired Ark server. Its responsibilities are:
- Negotiating and enforcing a compatible wire protocol version via a handshake.
- Establishing a gRPC channel (optionally with TLS) with sensible timeouts and keepalives.
- Injecting the negotiated protocol version into every RPC call so the server can route/validate requests correctly.
- Fetching and exposing the server’s runtime configuration (ArkInfo) so the client can adapt its behavior (e.g., network, round cadence, limits).
Overview
- Version negotiation: The client first calls the server’s handshake RPC, which returns the supported protocol version range. The client checks its own supported range (MIN_PROTOCOL_VERSION..=MAX_PROTOCOL_VERSION) and picks the highest mutually supported version.
- Metadata propagation: After negotiation, all subsequent RPCs carry the selected protocol version in the request metadata using a gRPC interceptor.
- TLS: If the server URI is HTTPS, a TLS configuration with the configured crate roots is set up; otherwise the connection proceeds in cleartext.
- Server info: Once connected, the client retrieves ArkInfo to validate that the selected Bitcoin Network matches the wallet and to learn server-side parameters that drive client behavior.
Structs§
- ArkInfo
Handle - A handle to the Ark info.
- ArkService
Interceptor - A gRPC interceptor that attaches ark-specific headers to each request
- Protocol
Version Interceptor Deprecated - A gRPC interceptor that attaches the negotiated protocol version to each request.
- Server
Connection - A managed connection to the Ark server.
- Server
Connection Builder - Server
Info
Enums§
Constants§
- ACCESS_
TOKEN_ HEADER - The HTTP header used for private server access tokens
- MAX_
PROTOCOL_ VERSION - The maximum protocol version supported by the client.
- MIN_
PROTOCOL_ VERSION - The minimum protocol version supported by the client.
- NO_
TRANSPORT_ BACKEND_ MESSAGE - Error text used when no Ark RPC transport backend was compiled into the binary.