core-lightning/doc/lightning-listchannels.7.md
Rusty Russell 6e636a835f tools/fromschema.py: handle deprecated null field, don't create empty lists.
1. listpeers has a deprecated `"closer": null`, which we need
   to handle in the schema, while trying not to damage our
   documentation too much.

2. Don't print a condition if there are no fields to print.

3. Allow a special "untyped" marker for multifundchannel which returns
   arbitrary JSON in a field.

4. Allow a single field return (for 'stop').

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-06-25 09:49:33 +09:30

2.9 KiB

lightning-listchannels -- Command to query active lightning channels in the entire network

SYNOPSIS

listchannels [short_channel_id] [source]

DESCRIPTION

The listchannels RPC command returns data on channels that are known to the node. Because channels may be bidirectional, up to 2 objects will be returned for each channel (one for each direction).

If short_channel_id is a short channel id, then only known channels with a matching short_channel_id are returned. Otherwise, it must be null.

If source is a node id, then only channels leading from that node id are returned.

If neither is supplied, data on all lightning channels known to this node, are returned. These can be local channels or public channels broadcast on the gossip network.

RETURN VALUE

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

  • source (pubkey): the source node
  • destination (pubkey): the destination node
  • public (boolean): true if this is announced (otherwise it must be our channel)
  • amount_msat (msat): the total capacity of this channel (always a whole number of satoshis)
  • message_flags (u8): as defined by BOLT #7
  • channel_flags (u8): as defined by BOLT #7
  • active (boolean): true unless source has disabled it, or it's a local channel and the peer is disconnected or it's still opening or closing
  • last_update (u32): UNIX timestamp on the last channel_update from source
  • base_fee_millisatoshi (u32): Base fee changed by source to use this channel
  • fee_per_millionth (u32): Proportional fee changed by source to use this channel, in parts-per-million
  • delay (u32): The number of blocks delay required by source to use this channel
  • htlc_minimum_msat (msat): The smallest payment source will allow via this channel
  • features (hex): BOLT #9 features bitmap for this channel
  • htlc_maximum_msat (msat, optional): The largest payment source will allow via this channel comment: # (GENERATE-FROM-SCHEMA-END)

If short_channel_id or source is supplied and no matching channels are found, a "channels" object with an empty list is returned.

On error the returned object will contain code and message properties, with code being one of the following:

  • -32602: If the given parameters are wrong.

AUTHOR

Michael Hawkins <michael.hawkins@protonmail.com>.

SEE ALSO

lightning-fundchannel(7), lightning-listnodes(7)

RESOURCES

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

Lightning RFC site