2018-12-03 06:20:25 +01:00
'\" t
. \" Title: lightning-disconnect
. \" Author: [see the "AUTHOR" section]
. \" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
2019-04-04 04:08:23 +02:00
. \" Date: 04/03/2019
2018-12-03 06:20:25 +01:00
. \" Manual: \ \&
. \" Source: \ \&
. \" Language: English
. \"
2019-04-04 04:08:23 +02:00
.TH "LIGHTNING\-DISCONNEC" "7" "04/03/2019" "\ \&" "\ \&"
2018-12-03 06:20:25 +01:00
. \" -----------------------------------------------------------------
. \" * Define some portability stuff
. \" -----------------------------------------------------------------
. \" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
. \" http://bugs.debian.org/507673
. \" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
. \" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n (.g .ds Aq \(aq
.el .ds Aq '
. \" -----------------------------------------------------------------
. \" * set default formatting
. \" -----------------------------------------------------------------
. \" disable hyphenation
.nh
. \" disable justification (adjust text to left margin only)
.ad l
. \" -----------------------------------------------------------------
. \" * MAIN CONTENT STARTS HERE *
. \" -----------------------------------------------------------------
.SH "NAME"
lightning-disconnect \- Command for disconnecting from another lightning node\& .
.SH "SYNOPSIS"
.sp
2019-04-04 04:08:23 +02:00
\fB disconnect\fR \fI id\fR [\fI force\fR ]
2018-12-03 06:20:25 +01:00
.SH "DESCRIPTION"
.sp
2019-04-04 04:08:23 +02:00
The disconnect RPC command closes an existing connection to a peer, identified by \fI id\fR , in the Lightning Network, as long as it doesn\(cq t have an active channel\& . If \fI force\fR is set then it will disconnect even with an active channel\& .
2018-12-03 06:20:25 +01:00
.sp
The \fI id\fR can be discovered in the output of the listpeers command, which returns a set of peers:
.sp
.if n \{ \
.RS 4
. \}
.nf
{
"peers": [
{
"id": "0563aea81\& .\& .\& .",
"connected": true,
\& .\& .\& .
}
]
}
.fi
.if n \{ \
.RE
. \}
.sp
2019-04-04 04:08:23 +02:00
Passing the \fI id\fR attribute of a peer to \fI disconnect\fR will terminate the connection\& .
2018-12-03 06:20:25 +01:00
.SH "RETURN VALUE"
.sp
On success, an empty object is returned\& .
.SH "ERRORS"
.sp
If \fI id\fR is invalid, an error message will be returned:
.sp
.if n \{ \
.RS 4
. \}
.nf
{ "code" : \- 1, "message" : "Peer not connected" }
.fi
.if n \{ \
.RE
. \}
2019-04-04 04:08:23 +02:00
.sp
If the peer has an active channel and \fI force\fR is not set, an error message will be returned:
.sp
.if n \{ \
.RS 4
. \}
.nf
{ "code" : \- 1, "message" : "Peer is in state CHANNELD_NORMAL" }
.fi
.if n \{ \
.RE
. \}
2018-12-03 06:20:25 +01:00
.SH "AUTHOR"
.sp
Michael Hawkins <michael\& .hawkins@protonmail\& .com>\& .
.SH "SEE ALSO"
.sp
lightning\- connect(1), lightning\- listpeers(1)
.SH "RESOURCES"
.sp
Main web site: https://github\& .com/ElementsProject/lightning