Skip to content

Add SDK health check method with RPC connectivity report #395

Description

@Kingsman-99

Overview

There is no way for an app to verify that the SDK can reach the configured RPC endpoint before making real calls. Add a healthCheck() method that probes connectivity and returns a diagnostic report.

Acceptance Criteria

  • sdk.healthCheck() returns Promise<HealthCheckResult>
  • HealthCheckResult: { rpcReachable: boolean, latencyMs: number, network: string, contractDeployed: boolean, error?: string }
  • rpcReachable: whether the RPC endpoint responded to a getLatestLedger call
  • latencyMs: round-trip time for the probe call
  • contractDeployed: whether get_contract_data returns a result for the configured contract ID
  • error: human-readable message if any check failed
  • healthCheck() has a 5-second timeout; times out with HealthCheckTimeoutError
  • Useful for app startup checks and connection debugging
  • Does not throw on failure — returns the result object with rpcReachable: false

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions