mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-19 19:25:51 +00:00
79 lines
1.1 KiB
Markdown
79 lines
1.1 KiB
Markdown
# ping
|
|
[[Source]<br>](https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/Ping.cpp "Source")
|
|
|
|
The `ping` command returns an acknowledgement, so that clients can test the connection status and latency.
|
|
|
|
## Request Format
|
|
An example of the request format:
|
|
|
|
<!-- MULTICODE_BLOCK_START -->
|
|
|
|
*WebSocket*
|
|
|
|
```
|
|
{
|
|
"id": 1,
|
|
"command": "ping"
|
|
}
|
|
```
|
|
|
|
*JSON-RPC*
|
|
|
|
```
|
|
{
|
|
"method": "ping",
|
|
"params": [
|
|
{}
|
|
]
|
|
}
|
|
```
|
|
|
|
*Commandline*
|
|
|
|
```
|
|
#Syntax: ping
|
|
rippled ping
|
|
```
|
|
|
|
<!-- MULTICODE_BLOCK_END -->
|
|
|
|
[Try it! >](ripple-api-tool.html#ping)
|
|
|
|
The request includes no parameters.
|
|
|
|
## Response Format
|
|
|
|
An example of a successful response:
|
|
|
|
<!-- MULTICODE_BLOCK_START -->
|
|
|
|
*WebSocket*
|
|
|
|
```
|
|
{
|
|
"id": 1,
|
|
"result": {},
|
|
"status": "success",
|
|
"type": "response"
|
|
}
|
|
```
|
|
|
|
*JSON-RPC*
|
|
|
|
```
|
|
200 OK
|
|
{
|
|
"result": {
|
|
"status": "success"
|
|
}
|
|
}
|
|
```
|
|
|
|
<!-- MULTICODE_BLOCK_END -->
|
|
|
|
The response follows the [standard format](#response-formatting), with a successful result containing no fields. The client can measure the round-trip time from request to response as latency.
|
|
|
|
## Possible Errors
|
|
|
|
* Any of the [universal error types][].
|