LIGHTNING-NOTIFICATIONS(7)
π LIGHTNING-NOTIFICATIONS(7) π
okay bestie, welcome to LIGHTNING-NOTIFICATIONS(7) β the manual page for notifications, the RPC command that literally just turns notification delivery on (or off) for your JSON-RPC connection. yes, that's the whole vibe. let's get into it π«Ά
β¨ NAME β¨
notifications β the command to set up notifications, periodt π
πΈ SYNOPSIS πΈ
notifications enable
π¦ DESCRIPTION π¦
so the notifications RPC command enables notifications for this JSON-RPC connection. that's it. that's the girlboss move β¨
by default β and honestly for backwards-compatibility reasons β notifications are disabled. so if you want the tea, you gotta ask for it π
various commands, especially the complex and slow ones, offer notifications that indicate their progress. think of it like a little progress bar that slid into your group chat π
enable(boolean) β whether to enable or disable notifications. true = let me in, false = leave me alone π
π NOTIFICATIONS π
notifications are JSON-RPC objects without an id field. huge. iconic. no cap.
lightningd sends notifications (once you've enabled them with this notifications command) with a params id field indicating which command the notification refers to π
implementations should ignore notifications without an id parameter, or with an unknown method. don't be nosy, don't be confused, just skip it π§
common methods include:
messageβ parammessage: a descriptional string indicating something which occurred relating to the command. paramlevelindicates the level, as perlightning-getlog(7):infoanddebugare typical β¨progressβ paramnumandtotal, wherenumstarts at0and is always less thantotal. optional paramstagewith fieldsnumandtotal, indicating what stage we are progressing through π
π« RETURN VALUE π«
on success, if enable was true, notifications will be forwarded from then on. slay π₯
π ERRORS π
on failure, one of the following error codes may be returned:
-32602β error in given parameters. classic. (derogatory) π
π AUTHOR π
Rusty Russell rusty@blockstream.com wrote the initial version of this man page. king behavior π
β RESOURCES β
main web site: https://github.com/ElementsProject/lightning
π EXAMPLE NOTIFICATIONS π
notification 1:
{
"method": "message",
"params": {
"id": 1,
"message": "This is a test message",
"level": "DEBUG"
}
}
notification 2:
{
"method": "progress",
"params": {
"id": 2,
"num": 0,
"total": 30,
"stage": {
"num": 0,
"total": 2
}
}
}
π EXAMPLES π
example 1:
request:
$ lightning-cli notifications -k "enable"=True
{
"id": "example:notifications#1",
"method": "notifications",
"params": {
"enable": true
}
}
response:
{}
example 2:
request:
$ lightning-cli notifications -k "enable"=False
{
"id": "example:notifications#2",
"method": "notifications",
"params": {
"enable": false
}
}
response:
{}
and that's the whole page bestie, you ate that π this chaos was brought to you by Core Lightning v26.06.9 β go forth and enable your notifications responsibly, mwah πβ¨π¦
π¦ 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