lightning-notifications

lightning-notifications -- Command to set up notifications.

SYNOPSIS

notifications enable

DESCRIPTION

The notifications the RPC command enabled notifications for this JSON-RPC connection. By default (and for backwards-compatibility) notifications are disabled.

Various commands, especially complex and slow ones, offer notifications which indicate their progress.

  • enable (boolean): Whether to enable or disable notifications.

NOTIFICATIONS

Notifications are JSON-RPC objects without an id field. lightningd sends notifications (once enabled 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 unknown method.

Common methods include:
message: param message: a descriptional string indicating something which occurred relating to the command. Param level indicates the level, as per lightning-getlog(7): info and debug are typical.
progress: param num and total, where num starts at 0 and is always less than total. Optional param stage with fields num and total, indicating what stage we are progressing through.

RETURN VALUE

On success, if enable was true, notifications will be forwarded from then on.

ERRORS

On failure, one of the following error codes may be returned:

  • -32602: Error in given parameters.

AUTHOR

Rusty Russell <[email protected]> wrote the initial version of this man page.

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:

{}

Core Lightning (previously c-lightning) is a lightweight, highly customizable and standard compliant implementation of the Lightning Network protocol.

© 2023 Core Lightning
All rights reserved.

Discussion Forum

The official Core Lightning forum is hosted at discuss.corelightning.org

BuildonL2 Community

The official BuildOnL2 community lives at community.corelightning.org. Join us and build the future of bitcoin on lightning.

Mailing List

For general discussions about CLN implementation, use [email protected]. For the Lightning Network, use [email protected]

Telegram

Community-driven telegram group where most of the node operators hang out. Go to https://t.me/lightningd to join.

Discord

Community-driven discord server where the devs flock together. Go to https://discord.gg/w27fMFESMN to join.

Internet Relay Chat

Don't hesitate to reach out to us on IRC at #lightning-dev @ libera.chat, #c-lightning @ libera.chat.