In c-lightning implementation, what is the difference between the
listnodes commands of lightning-cli?
listpeers returns data on nodes that you have connected with OR the nodes with which you have an open channel. If you have an open channel with a node, but the connection with that node has been lost, then the node will still appear in the output, with
"connected": false. If you are connected with a node but do not have open channels, then it will return the output with
If you want to get information about a particular peer and not all of them, then you can add the node id of the peer like:
lightning-cli listpeers <node_id>. You can also query log entries related to the peer by passing the command:
lightning-cli listpeers <node_id> <level> where level can be
unusual. Log levels can only be queried if a node id is supplied.
listnodes will return the information of all the nodes in your local network view. This information is collected via the gossip network. If you pass the
listnodes command without a node id, then the RPC will return information of ALL the nodes in your view. If you are interested in the information of a particular node id, then you can do so by passing the command:
lightning-cli listnodes <nodeid>.
listpeers show current peers, which means your node has been peered to other nodes that are shown in the command. It also means you are ready to fund channels with these nodes.
listnodes show nodes in your local network information.