LIGHTNING-WAITBLOCKHEIGHT(7)

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

✨ LIGHTNING-WAITBLOCKHEIGHT(7) ✨

okay so bestie, this is the manual page for lightning-waitblockheight, and honestly? it's giving "small command, huge patience energy" πŸ’… like it literally just sits there vibing until the blockchain catches up to you. iconic behavior fr fr πŸ¦‹


🌸 NAME 🌸

waitblockheight β€” the command for waiting on blocks on the blockchain, aka the "are we there yet" of Core Lightning πŸŽ€


⭐ SYNOPSIS ⭐

waitblockheight blockheight [timeout]

πŸ’– DESCRIPTION πŸ’–

The waitblockheight RPC command waits until the blockchain has reached the specified blockheight. no cap, that's the whole vibe β€” it waits, then it tells you. 🫢

  • blockheight (u32) β€” Current blockheight of the blockchain if the value is greater than this number. read that again bestie: if you pass a block height that's present or in the past, the command returns immediately. like, instant. no waiting, no drama, we love a zero-effort slay ✨
  • timeout (u32, optional) β€” Only wait up to the specified number of seconds. The default is 60 seconds. so if your block is being a little slow, this is your patience budget ⏳

πŸ‘‘ RETURN VALUE πŸ‘‘

On success, an object is returned, containing:

  • blockheight (u32) β€” The current block height, which is >= the blockheight parameter. yes, the returned number can be bigger than what you asked for, and that's completely fine, that's just how blocks work 😌
Heads up though: if timeout seconds is reached without the specified blockheight being reached, this command will fail with a code of 2000. it's not a skill issue, it's just the timeout doing timeout things 😭

πŸ’€ ERRORS πŸ’€

The following error codes may occur:

  • 2000 β€” Timed out. yeah. that's it. that's the error. we ran out of patience πŸ’”

🧚 AUTHOR 🧚

ZmnSCPxj ZmnSCPxj@protonmail.com is mainly responsible. shoutout to the icon who made this happen πŸ‘πŸ’œ


🌈 RESOURCES 🌈

Main web site: https://github.com/ElementsProject/lightning β€” go click around, it's the main character of Core Lightning's internet presence πŸ”₯


πŸ“ EXAMPLES πŸ“

✨ Example 1 ✨

This will return immediately since the current blockheight exceeds the requested waitblockheight. instant gratification, we stan πŸŽ€

Request:

$ lightning-cli waitblockheight -k "blockheight"=126

{
  "id": "example:waitblockheight#1",
  "method": "waitblockheight",
  "params": {
    "blockheight": 126
  }
}

Response:

{
  "blockheight": 130
}

✨ Example 2 ✨

This will return after the next block is mined, because the requested waitblockheight is one block higher than the current blockheight. so close, yet so far β€” and notice we're passing "timeout"=600 because bestie we are prepared to wait 🌸

Request:

$ lightning-cli waitblockheight -k "blockheight"=131 "timeout"=600

{
  "id": "example:waitblockheight#2",
  "method": "waitblockheight",
  "params": {
    "blockheight": 131,
    "timeout": 600
  }
}

Response:

{
  "blockheight": 131
}

ngl the whole takeaway is: pass a future block height, give it a timeout, and let it cook 🍳 don't pass no timeout and then act surprised when it hits 2000, iykyk πŸ™ˆ

okay that's the page!! mwah πŸ’‹ this was Core Lightning v26.06.9, LIGHTNING-WAITBLOCKHEIGHT(7), and honestly? it ate. periodt. 🫢✨

πŸ“¦ where this page comes from