lightning-listnodes

lightning-listnodes -- Command to get the list of nodes in the known network.

SYNOPSIS

listnodes [id]

DESCRIPTION

The listnodes command returns nodes the node has learned about via gossip messages, or a single one if the node id was specified.

  • id (pubkey, optional): The public key of the node to list.

RETURN VALUE

On success, an object containing nodes is returned. It is an array of objects, where each object contains:

  • nodeid (pubkey): The public key of the node.
  • last_timestamp (u32, optional): A node_announcement has been received for this node (UNIX timestamp).

If last_timestamp is present:

  • alias (string) (up to 32 characters): The fun alias this node advertized.

  • color (hex) (always 6 characters): The favorite RGB color this node advertized.

  • features (hex): BOLT #9 features bitmap this node advertized.

  • addresses (array of objects): The addresses this node advertized.:

    • type (string) (one of "dns", "ipv4", "ipv6", "torv2", "torv3"): Type of connection (until 23.08, websocket was also allowed).
    • port (u16): Port number.

    If type is "dns", "ipv4", "ipv6", "torv2" or "torv3":

    • address (string): Address in expected format for type.

If option_will_fund is present:

  • 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.
    • 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.

ERRORS

On failure, one of the following error codes may be returned:

  • -32602: Error in given parameters.

AUTHOR

Vincenzo Palazzo <[email protected]> wrote the initial version of this man page,
but many others did the hard work of actually implementing this rpc command.

SEE ALSO

lightning-listchannels(7)

RESOURCES

Main web site: https://github.com/ElementsProject/lightning

EXAMPLES

Example 1:

Request:

lightning-cli listnodes -k "id"="035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d"
{
  "id": "example:listnodes#1",
  "method": "listnodes",
  "params": {
    "id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d"
  }
}

Response:

{
  "nodes": [
    {
      "nodeid": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
      "alias": "HOPPINGFIRE--190-g5fd2f9c-modded",
      "color": "035d2b",
      "last_timestamp": 1722303669,
      "features": "88a0802a8a59a1",
      "addresses": []
    }
  ]
}

Example 2:

Request:

lightning-cli listnodes
{
  "id": "example:listnodes#2",
  "method": "listnodes",
  "params": {}
}

Response:

{
  "nodes": [
    {
      "nodeid": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
      "alias": "SILENTARTIST-190-g5fd2f9c-modded",
      "color": "022d22",
      "last_timestamp": 1722303662,
      "features": "88a0802a8a59a1",
      "addresses": []
    },
    {
      "nodeid": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
      "alias": "JUNIORBEAM-5-190-g5fd2f9c-modded",
      "color": "0266e4",
      "last_timestamp": 1722303662,
      "features": "88a0802a8a59a1",
      "addresses": []
    },
    {
      "nodeid": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
      "alias": "HOPPINGFIRE--190-g5fd2f9c-modded",
      "color": "035d2b",
      "last_timestamp": 1722303669,
      "features": "88a0802a8a59a1",
      "addresses": []
    },
    {
      "nodeid": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199",
      "alias": "JUNIORFELONY-190-g5fd2f9c-modded",
      "color": "0382ce",
      "last_timestamp": 1722303669,
      "features": "88a0802a8a59a1",
      "addresses": []
    }
  ]
}

Core Lightning (previously c-lightning) is a lightweight, highly customizable and standard compliant implementation of the Lightning Network protocol.

© 2023 Core Lightning
All rights reserved.

Discussion Forum

The official Core Lightning forum is hosted at discuss.corelightning.org

BuildonL2 Community

The official BuildOnL2 community lives at community.corelightning.org. Join us and build the future of bitcoin on lightning.

Mailing List

For general discussions about CLN implementation, use [email protected]. For the Lightning Network, use [email protected]

Telegram

Community-driven telegram group where most of the node operators hang out. Go to https://t.me/lightningd to join.

Discord

Community-driven discord server where the devs flock together. Go to https://discord.gg/w27fMFESMN to join.

Internet Relay Chat

Don't hesitate to reach out to us on IRC at #lightning-dev @ libera.chat, #c-lightning @ libera.chat.