A Health API Client. HealthApiClient
Returns the last set of health check results for the node. This includes checks for all chains, network, database, and other components.
import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const healthStatus = await client.health.health({
tags: ["11111111111111111111111111111111LpoYY", "29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL"]
})
Returns a simple health check indicating if the node is alive and can handle requests. This is a lightweight check that always returns healthy if the endpoint is available.
Returns the last evaluation of the startup health check results. This indicates if the node has finished initializing and is ready to handle requests.
import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const readinessStatus = await client.health.readiness({
tags: ["11111111111111111111111111111111LpoYY"]
})
Creates a Health API Client with a given transport configured for a Chain.
The Health API Client is an interface to interact with the Health API through Avalanche-specific JSON-RPC API methods.