Add RPC/getHealth
This commit is contained in:
parent
276b3be196
commit
18b50cfa50
|
@ -0,0 +1,18 @@
|
|||
package rpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
// GetHealth returns the current health of the node.
|
||||
// If one or more --trusted-validator arguments are provided
|
||||
// to solana-validator, "ok" is returned when the node has within
|
||||
// HEALTH_CHECK_SLOT_DISTANCE slots of the highest trusted validator,
|
||||
// otherwise an error is returned. "ok" is always returned if no
|
||||
// trusted validators are provided.
|
||||
func (cl *Client) GetHealth(ctx context.Context) (out string, err error) {
|
||||
err = cl.rpcClient.CallFor(&out, "getHealth")
|
||||
return
|
||||
}
|
||||
|
||||
const HealthOk = "ok"
|
Loading…
Reference in New Issue