core-lightning/doc/schemas/lightning-ping.json
ShahanaFarooqui 976c0c90bc docs: Changes examples format
- Changed ALL `doc/schemas/lightning-*.json` file's `json_example` to `examples`
- Change the heading from example to examples
- Bring shell command before the json command
- Move Example to the end of the page
- Remove horizontal line from Example
2024-06-22 17:02:33 +02:00

94 lines
2.2 KiB
JSON

{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"additionalProperties": false,
"rpc": "ping",
"title": "Command to check if a node is up.",
"description": [
"The **ping** command checks if the node with *id* is ready to talk. It currently only works for peers we have a channel with."
],
"request": {
"required": [
"id"
],
"properties": {
"id": {
"type": "pubkey",
"description": [
"The pubkey of the node to ping."
]
},
"len": {
"type": "u16",
"description": [
"The length of the ping."
],
"default": "128"
},
"pongbytes": {
"type": "u16",
"description": [
"The length of the reply. A value of 65532 to 65535 means `don't reply`."
],
"default": "128"
}
}
},
"response": {
"required": [
"totlen"
],
"properties": {
"totlen": {
"type": "u16",
"description": [
"The answer length of the reply message (including header: 0 means no reply expected)."
]
}
}
},
"errors": [
"On failure, one of the following error codes may be returned:",
"",
"- -32602: Error in given parameters or we're already waiting for a ping response from peer."
],
"author": [
"Vincenzo Palazzo <<vincenzo.palazzo@protonmail.com>> wrote the initial version of this man page,",
"but many others did the hard work of actually implementing this rpc command."
],
"see_also": [
"lightning-connect(7)"
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:ping#1",
"method": "ping",
"params": {
"len": 128,
"pongbytes": 128
}
},
"response": {
"totlen": 132
}
},
{
"request": {
"id": "example:ping#2",
"method": "ping",
"params": {
"id": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
"len": 1000,
"pongbytes": 65535
}
},
"response": {
"totlen": 0
}
}
]
}