lightning-disconnect

lightning-disconnect -- Command for disconnecting from another lightning node

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 it doesn't have an active channel.

  • id (pubkey): The public key of the peer to terminate the connection. It can be discovered as peer_id in the output of the listpeerchannels command.
  • force (boolean, optional): If set to True, it will disconnect even with an active channel.

RETURN VALUE

On success, an empty object is returned.

ERRORS

On error the returned object will contain code and message properties, with code being one of the following:

  • -32602: If the given parameters are wrong.
  • -1: Catchall nonspecific error.

AUTHOR

Michael Hawkins <[email protected]>.

SEE ALSO

lightning-connect(7), lightning-listpeerchannels(7)

RESOURCES

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

EXAMPLES

Example 1:

Request:

lightning-cli disconnect -k "id"="nodeid040404040404040404040404040404040404040404040404040404040404" "force"=False
{
  "id": "example:disconnect#1",
  "method": "disconnect",
  "params": {
    "id": "nodeid040404040404040404040404040404040404040404040404040404040404",
    "force": false
  }
}

Response:

{}

Example 2:

Request:

lightning-cli disconnect -k "id"="nodeid050505050505050505050505050505050505050505050505050505050505" "force"=True
{
  "id": "example:disconnect#2",
  "method": "disconnect",
  "params": {
    "id": "nodeid050505050505050505050505050505050505050505050505050505050505",
    "force": true
  }
}

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.