Test the Lightning peer protocol with ping and pong

A successful TCP connection does not demonstrate that a peer responds to Lightning messages. A protocol ping tests an already connected session.

Request a small reply

Set PEER to the connected node's public key. Ask for a small ping payload and a 16-byte pong payload. Time the command to capture the overall RPC round-trip observed by the operator.

time lightning-cli ping "$PEER" 32 16

Read the reply length correctly

totlen includes the pong header, so it can exceed the requested payload length. The measured time includes local RPC overhead. A valid reply confirms liveness of this session at this instant. It gives no indication of the peer's willingness or liquidity to forward a payment.

docs.corelightning.org ping