2020-09-07 12:46:28 +02:00
lightning-listnodes -- Command to get the list of nodes in the known network.
2020-08-13 18:19:35 +02:00
============================================================
SYNOPSIS
--------
2022-01-26 18:18:49 +01:00
**listnodes** [*id*]
2020-08-13 18:19:35 +02:00
DESCRIPTION
-----------
2020-09-07 12:46:28 +02:00
The **listnodes** command returns nodes the node has learned about via gossip messages, or a single one if the node *id* was specified.
2020-08-13 18:19:35 +02:00
EXAMPLE JSON REQUEST
------------
```json
{
"id": 82,
"method": "listnodes",
"params": {
"id": "02e29856dab8ddd9044c18486e4cab79ec717b490447af2d4831e290e48d57638a"
}
}
```
RETURN VALUE
------------
2021-06-16 03:07:17 +02:00
[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object containing **nodes** is returned. It is an array of objects, where each object contains:
2022-09-05 23:33:09 +02:00
2021-06-16 03:07:17 +02:00
- **nodeid** (pubkey): the public key of the node
2022-11-11 03:03:13 +01:00
- **last\_timestamp** (u32, optional): A node\_announcement has been received for this node (UNIX timestamp)
2021-06-16 03:07:17 +02:00
2022-09-05 23:45:06 +02:00
If **last\_timestamp** is present:
2022-09-05 23:33:09 +02:00
2021-06-16 03:07:17 +02:00
- **alias** (string): The fun alias this node advertized (up to 32 characters)
- **color** (hex): The favorite RGB color this node advertized (always 6 characters)
2022-07-13 17:45:39 +02:00
- **features** (hex): BOLT #9 features bitmap this node advertized
2021-06-16 03:07:17 +02:00
- **addresses** (array of objects): The addresses this node advertized:
2021-10-01 13:47:29 +02:00
- **type** (string): Type of connection (one of "dns", "ipv4", "ipv6", "torv2", "torv3", "websocket")
2021-06-16 03:07:17 +02:00
- **port** (u16): port number
2021-08-31 02:33:12 +02:00
2021-10-01 13:47:29 +02:00
If **type** is "dns", "ipv4", "ipv6", "torv2" or "torv3":
2022-09-05 23:33:09 +02:00
2021-10-15 07:48:44 +02:00
- **address** (string): address in expected format for **type**
2022-09-05 23:45:06 +02:00
If **option\_will\_fund** is present:
2022-09-05 23:33:09 +02:00
2022-09-05 23:45:06 +02:00
- **option\_will\_fund** (object):
- **lease\_fee\_base\_msat** (msat): the fixed fee for a lease (whole number of satoshis)
- **lease\_fee\_basis** (u32): the proportional fee in basis points (parts per 10,000) for a lease
- **funding\_weight** (u32): the onchain weight you'll have to pay for a lease
- **channel\_fee\_max\_base\_msat** (msat): the maximum base routing fee this node will charge during the lease
2022-11-11 03:03:13 +01:00
- **channel\_fee\_max\_proportional\_thousandths** (u32): the maximum proportional routing fee this node will charge during the lease (in thousandths, not millionths like channel\_update)
- **compact\_lease** (hex): the lease as represented in the node\_announcement
2021-09-03 12:07:59 +02:00
2021-06-16 03:07:17 +02:00
[comment]: # (GENERATE-FROM-SCHEMA-END)
2021-10-01 13:47:29 +02:00
2020-08-13 18:19:35 +02:00
On failure, one of the following error codes may be returned:
2021-10-01 13:47:29 +02:00
2020-08-31 14:42:28 +02:00
- -32602: Error in given parameters.
2020-08-13 18:19:35 +02:00
EXAMPLE JSON RESPONSE
-----
```json
{
"nodes": [
{
"nodeid": "02e29856dab8ddd9044c14586e4cab79ec717b490447af2d4831e290e48d58638a",
"alias": "some_alias",
"color": "68f442",
"last_timestamp": 1597213741,
"features": "02a2a1",
"addresses": [
{
"type": "ipv4",
"address": "zzz.yy.xx.xx",
"port": 9735
}
]
}
]
}
```
AUTHOR
------
Vincenzo Palazzo < < vincenzo.palazzo @ protonmail . com > > wrote the initial version of this man page, but many others did the hard work of actually implementing this rpc command.
SEE ALSO
--------
2021-10-01 13:47:29 +02:00
FIXME:
2020-08-13 18:19:35 +02:00
RESOURCES
---------
Main web site: < https: / / github . com / ElementsProject / lightning >
2022-12-09 08:10:12 +01:00
2023-01-30 07:24:16 +01:00
[comment]: # ( SHA256STAMP:99d22f32acd7d5181f731342d7b9245cfa17cc4257c1f87d78eb809fe7c6931d)