LIGHTNING-WAITBLOCKHEIGHT(7)
β¨ 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 is60seconds. 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>=theblockheightparameter. 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: iftimeoutseconds is reached without the specifiedblockheightbeing reached, this command will fail with a code of2000. 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 atimeout, and let it cook π³ don't pass no timeout and then act surprised when it hits2000, 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
- nixpkgs unstable: clightning 26.06.9
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms