LIGHTNING-PING(7)
π LIGHTNING-PING(7) π
okay so bestie, welcome to the lightning-ping(7) page β this is the manual for the ping command, and honestly? it's a whole vibe check for your node friends π«Ά
β¨ NAME β¨
ping β the command that checks if a node is up. literally just "u alive??" but for Lightning peers π
π SYNOPSIS π
ping id [len] [pongbytes]
πΈ DESCRIPTION πΈ
okay so here's the tea: the ping command checks if the node with id is ready to talk. simple as that. but β and this is the important part, don't come for me β it only works for peers we are currently connected with. no connection, no pinging. that's just how it is π€·ββοΈ
id(pubkey) β the pubkey of the node to ping. this is you @-ing them, basically.len(u16, optional) β the length of the ping. the default is128.pongbytes(u16, optional) β the length of the reply. a value of65532to65535means don't reply. the default is128. so like... you can absolutely send a ping with "no response needed" energy π
β RETURN VALUE β
on success, an object is returned, containing:
totlen(u16) β the answer length of the reply message (including header:0means no reply expected). iykyk π
π ERRORS π
on failure, one of the following error codes may be returned. it's giving "small oops":
-32602β error in given parameters, or we're already waiting for a ping response from peer. yeah, you can't double-ping. one at a time, bestie, patience is a virtue π
π 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. infinite respect to the whole crew, fr fr π«Ά
π¦ SEE ALSO π¦
lightning-connect(7)β go connect first, then come back and ping π
π RESOURCES π
main web site: https://github.com/ElementsProject/lightning β the mothership, go say hi β¨
π EXAMPLES π
β¨ Example 1 β¨
request:
$ lightning-cli ping -k "id"="nodeid010101010101010101010101010101010101010101010101010101010101" "len"=128 "pongbytes"=128
{
"id": "example:ping#1",
"method": "ping",
"params": {
"id": "nodeid010101010101010101010101010101010101010101010101010101010101",
"len": 128,
"pongbytes": 128
}
}
response:
{
"totlen": 132
}
π§ Example 2 π§
request:
$ lightning-cli ping -k "id"="nodeid030303030303030303030303030303030303030303030303030303030303" "len"=1000 "pongbytes"=65535
{
"id": "example:ping#2",
"method": "ping",
"params": {
"id": "nodeid030303030303030303030303030303030303030303030303030303030303",
"len": 1000,
"pongbytes": 65535
}
}
response:
{
"totlen": 0
}
see how pongbytes=65535 gave us totlen = 0? that's the "no reply expected" situation, iconic behavior tbh π
this has been Core Lightning v26.06.9, dated, and yes β that's the LIGHTNING-PING(7) manual page, wrapped with so much love π slay, go ping your friends, and remember: only connected peers, always. periodt. π
π¦ where this page comes from
- nixpkgs unstable: clightning 26.06.9
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms