mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-23 09:41:38 +00:00
Add \health
rpc endpoint (#1306)
* Init `\health` rpc endpoint * remove additional info from `\health` rpc endpoint * Cleanup imports * Added time threshold for health check * Update rpc doc * Remove unnecessary checks for blocktime creation lag * Clean up of unnecessary config usage
This commit is contained in:
committed by
Anton Kaliaev
parent
20b198681b
commit
152290db7e
30
rpc/core/health.go
Normal file
30
rpc/core/health.go
Normal file
@ -0,0 +1,30 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
)
|
||||
|
||||
// Get node health. Checks whether new blocks are created.
|
||||
//
|
||||
// ```shell
|
||||
// curl 'localhost:46657/health'
|
||||
// ```
|
||||
//
|
||||
// ```go
|
||||
// client := client.NewHTTP("tcp://0.0.0.0:46657", "/websocket")
|
||||
// result, err := client.Health()
|
||||
// ```
|
||||
//
|
||||
// > The above command returns JSON structured like this:
|
||||
//
|
||||
// ```json
|
||||
// {
|
||||
// "error": "",
|
||||
// "result": {},
|
||||
// "id": "",
|
||||
// "jsonrpc": "2.0"
|
||||
// }
|
||||
// ```
|
||||
func Health() (*ctypes.ResultHealth, error) {
|
||||
return &ctypes.ResultHealth{}, nil
|
||||
}
|
Reference in New Issue
Block a user