LIGHTNING-PING(7)

πŸ“¦
version 26.06.9 Β· 2 versions
, in nixpkgs unstable

πŸ’– 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 is 128.
  • pongbytes (u16, optional) β€” the length of the reply. a value of 65532 to 65535 means don't reply. the default is 128. 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: 0 means 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 πŸ¦‹


🌈 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