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"="0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518" "force"=False
{
  "id": "example:disconnect#1",
  "method": "disconnect",
  "params": {
    "id": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
    "force": false
  }
}

Response:

{}

Example 2:

Request:

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

Response:

{}