CantonClientConfiguration

data class CantonClientConfiguration(val host: String, val port: Int = 6865, val useTls: Boolean = true, val accessTokenProvider: suspend () -> String? = null, val tlsTrust: TlsTrust = TlsTrust(), val retryPolicy: RetryPolicy = RetryPolicy.DEFAULT)

Configuration for connecting to a Canton participant's Ledger API.

Constructors

Link copied to clipboard
constructor(host: String, port: Int = 6865, useTls: Boolean = true, accessTokenProvider: suspend () -> String? = null, tlsTrust: TlsTrust = TlsTrust(), retryPolicy: RetryPolicy = RetryPolicy.DEFAULT)

Properties

Link copied to clipboard
val accessTokenProvider: suspend () -> String?

produces a JWT access token for the Ledger API's authorization: Bearer <token> header, or null for unauthenticated (development) ledgers. May suspend — an OIDC refresh belongs here directly. The client caches the token until shortly before its exp claim and re-invokes the provider only then, or when the server rejects a connection for authentication reasons — so the provider must return a current token when asked again, never a stored copy of the one that just failed.

Link copied to clipboard

hostname of the participant node exposing the gRPC Ledger API.

Link copied to clipboard
val port: Int

Ledger API port. Canton's conventional default is 6865.

Link copied to clipboard

backoff applied to retryable ledger errors.

Link copied to clipboard

which certificates to trust when useTls is on. Defaults to the platform trust store; pin an operator's CA to reject interception by a certificate authority the device happens to trust.

Link copied to clipboard

whether to use TLS. Only disable for local development.