core-lightning/doc/lightning-listnodes.7

105 lines
2.3 KiB
Groff
Raw Normal View History

.TH "LIGHTNING-LISTNODES" "7" "" "" "lightning-listnodes"
.SH NAME
lightning-listnodes - Command to get the list of nodes in the known network\.
.SH SYNOPSIS
\fBlistnodes\fR [id]
.SH DESCRIPTION
The \fBlistnodes\fR command returns nodes the node has learned about via gossip messages, or a single one if the node \fIid\fR was specified\.
.SH EXAMPLE JSON REQUEST
.nf
.RS
{
"id": 82,
"method": "listnodes",
"params": {
"id": "02e29856dab8ddd9044c18486e4cab79ec717b490447af2d4831e290e48d57638a"
}
}
.RE
.fi
.SH RETURN VALUE
On success, an object containing \fBnodes\fR is returned\. It is an array of objects, where each object contains:
.RS
.IP \[bu]
\fBnodeid\fR (pubkey): the public key of the node
.IP \[bu]
\fBlast_update\fR (u32, optional): A node_announcement has been received for this node (UNIX timestamp)
.RE
If \fBlast_update\fR is present:
.RS
.IP \[bu]
\fBalias\fR (string): The fun alias this node advertized (up to 32 characters)
.IP \[bu]
\fBcolor\fR (hex): The favorite RGB color this node advertized (always 6 characters)
.IP \[bu]
\fBfeatures\fR (hex): BOLT #9 features bitmap this node advertized
.IP \[bu]
\fBaddresses\fR (array of objects): The addresses this node advertized:
.RS
.IP \[bu]
\fBtype\fR (string): Type of connection (one of "ipv4", "ipv6", "torv2", "torv3")
.IP \[bu]
\fBaddress\fR (string): address in expected format for \fItype\fR
.IP \[bu]
\fBport\fR (u16): port number
.RE
.RE
On failure, one of the following error codes may be returned:
.RS
.IP \[bu]
-32602: Error in given parameters\.
.RE
.SH EXAMPLE JSON RESPONSE
.nf
.RS
{
"nodes": [
{
"nodeid": "02e29856dab8ddd9044c14586e4cab79ec717b490447af2d4831e290e48d58638a",
"alias": "some_alias",
"color": "68f442",
"last_timestamp": 1597213741,
"features": "02a2a1",
"addresses": [
{
"type": "ipv4",
"address": "zzz.yy.xx.xx",
"port": 9735
}
]
}
]
}
.RE
.fi
.SH AUTHOR
Vincenzo Palazzo \fI<vincenzo.palazzo@protonmail.com\fR> wrote the initial version of this man page, but many others did the hard work of actually implementing this rpc command\.
.SH SEE ALSO
FIXME:
.SH RESOURCES
Main web site: \fIhttps://github.com/ElementsProject/lightning\fR
\" SHA256STAMP:4366d5c238bccc06cfafc4c2d375dd417049b0b6224f13b2dcc9f25139587649