You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

177 lines
4.6 KiB

'\" t
.\" Title: lightning-listpeers
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/08/2019
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "LIGHTNING\-LISTPEERS" "7" "01/08/2019" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * 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-listpeers \- Command for returning data on connected lightning nodes\&.
.SH "SYNOPSIS"
.sp
\fBlistpeers\fR [\fIid\fR] [\fIlevel\fR]
.SH "DESCRIPTION"
.sp
The \fBlistpeers\fR RPC command returns data on nodes that are connected or are not connected but have open channels with this node\&.
.sp
Once a connection to another lightning node has been established, using the \fBconnect\fR command, data on the node can be returned using \fBlistpeers\fR and the \fIid\fR that was used with the \fBconnect\fR command\&.
.sp
If no \fIid\fR is supplied, then data on all lightning nodes that are connected, or not connected but have open channels with this node, are returned\&.
.sp
Supplying \fIid\fR will filter the results to only return data on a node with a matching \fIid\fR, if one exists\&.
.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"\&.
.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\&.
.SH "RETURN VALUE"
.sp
On success, an object with a "peers" key is returned containing a list of 0 or more objects\&.
.sp
Each object in the list contains the following data:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fIid\fR
: The unique id of the peer
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fIconnected\fR
: A boolean value showing the connection status
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fInetaddr\fR
: A list of network addresses the node is listening on
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fIglobalfeatures\fR
: Bit flags showing supported global features (BOLT #9)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fIlocalfeatures\fR
: Bit flags showing supported local features (BOLT #9)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fIchannels\fR
: An list of channel id\(cqs open on the peer
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.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\&.
.SH "ERRORS"
.sp
If \fIid\fR is not a valid public key, an error message will be returned:
.sp
.if n \{\
.RS 4
.\}
.nf
{ "code" : \-32602, "message" : "\*(Aqid\*(Aq should be a pubkey, not \*(Aq\&.\&.\&.\*(Aq" }
.fi
.if n \{\
.RE
.\}
.sp
If \fIlevel\fR is not a valid log level, an error message will be returned:
.sp
.if n \{\
.RS 4
.\}
.nf
{ "code" : \-32602, "message" "\*(Aqlevel\*(Aq should be \*(Aqio\*(Aq, \*(Aqdebug\*(Aq, \*(Aqinfo\*(Aq, or \*(Aqunusual\*(Aq, not \*(Aq\&.\&.\&.\*(Aq" }
.fi
.if n \{\
.RE
.\}
.SH "AUTHOR"
.sp
Michael Hawkins <michael\&.hawkins@protonmail\&.com>\&.
.SH "SEE ALSO"
.sp
lightning\-connect(7)
.SH "RESOURCES"
.sp
Main web site: https://github\&.com/ElementsProject/lightning Lightning RFC site (BOLT #9): https://github\&.com/lightningnetwork/lightning\-rfc/blob/master/09\-features\&.md