LIGHTNING-CHECK(7)

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

πŸ’… LIGHTNING-CHECK(7) β€” the check page, bestie ✨

okay so this is lightning-check, and it's literally the "are we sure about this tho?" command of Core Lightning. no cap.


🌸 NAME

check β€” the command for verifying parameters πŸŽ€ (yes, that's its whole job and it does it fabulously)

✨ SYNOPSIS

check command_to_check

πŸ¦‹ DESCRIPTION

The check RPC command verifies another command without actually making any changes. it's the "try it on in the dressing room but don't buy it" of RPC calls πŸ’…

This is guaranteed to be safe, and it will do all the checks up to the point where something in the system would need to be altered β€” like checking that channels are in the right state, peers are connected, etc. it goes right up to the line and then respectfully does not cross it 🫢

But β€” and this is the part where you need to listen, bestie β€” it does not guarantee successful execution of the command in all cases. for example, a call to lightning-getroute(7) may still fail to find a route even if checking the parameters succeeds. so like, the vibe check passed but the actual route hunt is a whole separate situation 😭

Here's the argument:

  • command_to_check (string) β€” the name of the relevant command. that's it. that's the whole input πŸ‘‘

πŸŽ€ RETURN VALUE

On success, an object is returned, containing:

  • command_to_check (string) β€” the command_to_check argument, just handed right back to you like "yep, I checked the thing you asked me to check" ⭐

πŸ‘‘ AUTHOR

Mark Beckwith wythe@intrig.com and Rusty Russell rusty@rustcorp.com.au are mainly responsible. icons, honestly 🫑

🌈 RESOURCES

Main web site: https://github.com/ElementsProject/lightning β€” go be nosy πŸ”₯

πŸ’– EXAMPLES

Example 1

Request:

$ lightning-cli check -k "command_to_check"="sendpay" "route"='[{"amount_msat": 1011, "id": "nodeid030303030303030303030303030303030303030303030303030303030303", "delay": 20, "channel": "123x1x1"}, {"amount_msat": 1000, "id": "nodeid040404040404040404040404040404040404040404040404040404040404", "delay": 10, "channel": "130x1x1"}]' "payment_hash"="0000000000000000000000000000000000000000000000000000000000000000"
{
  "id": "example:check#1",
  "method": "check",
  "params": {
    "command_to_check": "sendpay",
    "route": [
      {
        "amount_msat": 1011,
        "id": "nodeid030303030303030303030303030303030303030303030303030303030303",
        "delay": 20,
        "channel": "123x1x1"
      },
      {
        "amount_msat": 1000,
        "id": "nodeid040404040404040404040404040404040404040404040404040404040404",
        "delay": 10,
        "channel": "130x1x1"
      }
    ],
    "payment_hash": "0000000000000000000000000000000000000000000000000000000000000000"
  }
}

Response:

{
  "command_to_check": "sendpay"
}

Example 2

Request:

$ lightning-cli check -k "command_to_check"="dev" "subcommand"="slowcmd" "msec"=1000
{
  "id": "example:check#2",
  "method": "check",
  "params": {
    "command_to_check": "dev",
    "subcommand": "slowcmd",
    "msec": 1000
  }
}

Response:

{
  "command_to_check": "dev"
}

Example 3

Request:

$ lightning-cli check -k "command_to_check"="recover" "hsmsecret"="6c696768746e696e672d31000000000000000000000000000000000000000000"
{
  "id": "example:check#3",
  "method": "check",
  "params": {
    "command_to_check": "recover",
    "hsmsecret": "6c696768746e696e672d31000000000000000000000000000000000000000000"
  }
}

Response:

{
  "command_to_check": "recover"
}

lowkey the whole point: check lets you peek at whether a command would pass its checks, without touching a single thing in your node. safe, iconic, no notes πŸ’…βœ¨

k that's the page!! mwah 🫢 this was brought to you by Core Lightning v26.06.9 β€” she's serving documentation realness, periodt πŸŽ€πŸ’–

πŸ“¦ where this page comes from