lightning-ping

lightning-ping -- Command to check if a node is up.

SYNOPSIS

ping id [len] [pongbytes]

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.

  • id (pubkey): The pubkey of the node to ping.
  • 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.

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).

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 <[email protected]> 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

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
}

Core Lightning (previously c-lightning) is a lightweight, highly customizable and standard compliant implementation of the Lightning Network protocol.

© 2023 Core Lightning
All rights reserved.

Discussion Forum

The official Core Lightning forum is hosted at discuss.corelightning.org

BuildonL2 Community

The official BuildOnL2 community lives at community.corelightning.org. Join us and build the future of bitcoin on lightning.

Mailing List

For general discussions about CLN implementation, use [email protected]. For the Lightning Network, use [email protected]

Telegram

Community-driven telegram group where most of the node operators hang out. Go to https://t.me/lightningd to join.

Discord

Community-driven discord server where the devs flock together. Go to https://discord.gg/w27fMFESMN to join.

Internet Relay Chat

Don't hesitate to reach out to us on IRC at #lightning-dev @ libera.chat, #c-lightning @ libera.chat.