lightning-listpeers \- Command for returning data on connected lightning nodes\&.
lightning-listpeers \- Command for returning data on connected lightning nodes\&.
.SH"SYNOPSIS"
.SH"SYNOPSIS"
.sp
.sp
\fBlistpeers\fR [\fIid\fR]
\fBlistpeers\fR [\fIid\fR] [\fIlevel\fR]
.SH"DESCRIPTION"
.SH"DESCRIPTION"
.sp
.sp
The \fBlistpeers\fR RPC command returns data on nodes that are connected or are not connected but have open channels with this node\&.
The \fBlistpeers\fR RPC command returns data on nodes that are connected or are not connected but have open channels with this node\&.
@ -42,6 +42,8 @@ If no \fIid\fR is supplied, then data on all lightning nodes that are connected,
.sp
.sp
Supplying \fIid\fR will filter the results to only return data on a node with a matching \fIid\fR, if one exists\&.
Supplying \fIid\fR will filter the results to only return data on a node with a matching \fIid\fR, if one exists\&.
.sp
.sp
Supplying \fIlevel\fR will show log entries related to that peer at the given log level\&. Valid log levels are "io", "debug", "info", and "unusual"\&.
.sp
If a channel is open with a node and the connection has been lost, then the node will still appear in the output of the command and the value of the \fIconnected\fR attribute of the node will be "false"\&.
If a channel is open with a node and the connection has been lost, then the node will still appear in the output of the command and the value of the \fIconnected\fR attribute of the node will be "false"\&.
.sp
.sp
The channel will remain open for a set blocktime, after which if the connection has not been re\-established, the channel will close and the node will no longer appear in the command output\&.
The channel will remain open for a set blocktime, after which if the connection has not been re\-established, the channel will close and the node will no longer appear in the command output\&.
@ -123,6 +125,21 @@ Each object in the list contains the following data:
: An list of channel id\(cqs open on the peer
: An list of channel id\(cqs open on the peer
.RE
.RE
.sp
.sp
.RS4
.ien\{\
\h'-04'\(bu\h'+03'\c
.\}
.el\{\
.sp-1
.IP\(bu2.3
.\}
\fIlog\fR
: Only present if
\fIlevel\fR
is set\&. List logs related to the peer at the specified
\fIlevel\fR
.RE
.sp
If \fIid\fR is supplied and no matching nodes are found, a "peers" object with an empty list is returned\&.
If \fIid\fR is supplied and no matching nodes are found, a "peers" object with an empty list is returned\&.
.SH"ERRORS"
.SH"ERRORS"
.sp
.sp
@ -137,6 +154,18 @@ If \fIid\fR is not a valid public key, an error message will be returned:
.ifn\{\
.ifn\{\
.RE
.RE
.\}
.\}
.sp
If \fIlevel\fR is not a valid log level, an error message will be returned:
.sp
.ifn\{\
.RS4
.\}
.nf
{ "code" : \-32602, "message" "\*(Aqlevel\*(Aq should be \*(Aqio\*(Aq, \*(Aqdebug\*(Aq, \*(Aqinfo\*(Aq, or \*(Aqunusual\*(Aq, not \*(Aq\&.\&.\&.\*(Aq" }
.fi
.ifn\{\
.RE
.\}
.SH"AUTHOR"
.SH"AUTHOR"
.sp
.sp
Michael Hawkins <michael\&.hawkins@protonmail\&.com>\&.
Michael Hawkins <michael\&.hawkins@protonmail\&.com>\&.