![]() |
![]()
| ![]() |
![]()
NAMElightning-listpeers -- Command returning data on connected lightning nodes SYNOPSISlistpeers [id] [level] DESCRIPTIONThe listpeers RPC command returns data on nodes that are connected or are not connected but have open channels with this node. Once a connection to another lightning node has been established, using the connect command, data on the node can be returned using listpeers and the id that was used with the connect command. If no id is supplied, then data on all lightning nodes that are connected, or not connected but have open channels with this node, are returned. 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 connected attribute of the node will be "false". 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.
RETURN VALUEOn success, an object containing peers is returned. It is an array of objects, where each object contains:
If connected is true: - netaddr (array of strings): A single entry array.: - (string, optional): Address, e.g. 1.2.3.4:1234. - features (hex): Bitmap of BOLT #9 features from peer's INIT message. - remote_addr (string, optional): The public IPv4/6 address the peer sees us from, e.g. 1.2.3.4:1234. ERRORSOn error the returned object will contain code and message properties, with code being one of the following:
AUTHORMichael Hawkins <michael.hawkins@protonmail.com>. SEE ALSOlightning-connect(7), lightning-fundchannel_start(7), lightning-setchannel(7) RESOURCESMain web site: https://github.com/ElementsProject/lightning Lightning RFC site (BOLT #9): https://github.com/lightning/bolts/blob/master/09-features.md EXAMPLESExample 1: Request: $ lightning-cli listpeers -k "id"="nodeid030303030303030303030303030303030303030303030303030303030303" { Response: { Example 2: Request: $ lightning-cli listpeers { Response: {
|