LIGHTNING-DISCONNECT(7)

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

πŸ’… LIGHTNING-DISCONNECT β€” the disconnect command, bestie

okay so this is the manual page for lightning-disconnect, from the Core Lightning set of docs (LIGHTNING-DISCONNECT(7) if you're being formal about it). It's short, it's sweet, and it's literally just "hey, go away" for the Lightning Network. Let's get into it 🫢


✨ NAME ✨

disconnect β€” the command for disconnecting from another lightning node. That's it. That's the whole vibe. Bye bestie πŸ‘‹


πŸŽ€ SYNOPSIS πŸŽ€

disconnect id [force]

🌸 DESCRIPTION 🌸

The disconnect RPC command closes an existing connection to a peer β€” identified by id β€” in the Lightning Network, as long as that peer doesn't have an active channel. It's giving "we need to talk… actually no we don't" energy πŸ’€

  • id (pubkey) β€” the public key of the peer whose connection you're terminating. You can find it as peer_id in the output of the listpeerchannels command. That's your golden ticket, iykyk 🎫
  • force (boolean, optional) β€” if you set this to True, it will disconnect even with an active channel. So like, the channel's still there, but the connection? Gone. Use with intention, bestie πŸ™ˆ

πŸ’– RETURN VALUE πŸ’–

On success, an empty object is returned.

{}

Iconic. Minimalist. Nothing to say, and it said it ✨


⭐ ERRORS ⭐

So if things go sideways (😭), the returned object will contain code and message properties, and that code is gonna be one of these:

  • -32602 β€” if the given parameters are wrong. Check your id, check your force, do the vibe check 🌈
  • -1 β€” catchall nonspecific error. The "something happened but honestly who knows" of error codes πŸ’€

πŸ‘‘ AUTHOR πŸ‘‘

Michael Hawkins <michael.hawkins@protonmail.com>. Shoutout to the main character who wrote this 🫢


πŸ¦‹ SEE ALSO πŸ¦‹


🌈 RESOURCES 🌈

Main web site: https://github.com/ElementsProject/lightning

Go look, it's got the whole collection of docs and code, no cap πŸ”₯


πŸ“ EXAMPLES πŸ“

Example 1: the gentle disconnect (no force, we're being polite)

Request:

$ lightning-cli disconnect -k "id"="nodeid040404040404040404040404040404040404040404040404040404040404" "force"=False

{
  "id": "example:disconnect#1",
  "method": "disconnect",
  "params": {
    "id": "nodeid040404040404040404040404040404040404040404040404040404040404",
    "force": false
  }
}

Response:

{}

Ate. Clean exit, no mess ✨

Example 2: the forceful disconnect (yes, even with a channel, don't come at me)

Request:

$ lightning-cli disconnect -k "id"="nodeid050505050505050505050505050505050505050505050505050505050505" "force"=True

{
  "id": "example:disconnect#2",
  "method": "disconnect",
  "params": {
    "id": "nodeid050505050505050505050505050505050505050505050505050505050505",
    "force": true
  }
}

Response:

{}

Again with the empty object. It really said "no thoughts, head empty" and honestly? Same πŸ’…

quick reminder bestie: force True means it'll disconnect even with an active channel. That's the spicy one. Don't @ me if you didn't read it πŸ™ˆ

and that's the whole page, babe πŸŽ€ stay connected (or don't, your call), and remember β€” this was the docs for lightning-disconnect, shipped as part of Core Lightning v26.06.9, in the LIGHTNING-DISCONNECT(7) manual. now go forth and disconnect responsibly πŸ¦‹βœ¨

πŸ“¦ where this page comes from