forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lightning-listpeers.7
177 lines (177 loc) · 4.63 KB
/
lightning-listpeers.7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
'\" 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