On this page

latest contributor to this doc

Last Edit:

@gcharang

Lightning Network Methods

Lightning methods are currently only available using the native Komodo DeFi Framework. WASM support should be available in late 2023.

Any methods with a task:: prefix will be linked to a numeric task_id value which is used to query the status or outcome of the task.

Once you:

You can get an invoice for a coffee from https://starblocks.acinq.co!

Then you can:

Follow the flowchart below to visualize the process:

Lighning Network Flowchart

Some configurations are set per coin, and some are set per channel. The counterparty_channel_config_limits param must be set in the coins configuration file, and aplies to all channels opened by counterparty nodes. The our_channels_config and channel_options parameters are set per channel. These can be defined in the coins configuration file to act as the default for all opened channels, and optionally overwritten or updated using the open_channel or update_channel methods.

ParameterTypeDescription
coinobjectThe ticker of the coin you will use lightning network with, suffixed with -lightning
mm2integerDefaults to 0. A value of 1, indicates the coin is atomic swap compatible.
decimalsintegerThe decimal precision of the coin you will use the lightning network with.
protocolobjectA standard CoinProtocol object.
accept_inbound_channelsbooleanOptional, defaults to true. If this is set to false, we do not accept inbound requests to open a new channel.
accept_forwards_to_priv_channelsbooleanOptional, defaults to false. When set to false, any HTLCs which were to be forwarded over private channels will be rejected. This prevents us from taking on HTLC-forwarding risk when we intend to run as a node which is not online reliably (e.g. GUI wallet apps). Generally, private channels are used for non-routing purposes only.
counterparty_channel_config_limitsobjectOptional. A standard CounterpartyChannelConfig object.
channel_optionsobjectOptional. A standard LightningChannelOptions object.
our_channels_configobjectOptional. A standard LightningChannelConfig object.

For GUIs and wallet apps, it is recommended to set accept_forwards_to_priv_channels to false. This prevents users from taking on HTLC-forwarding risk when a node is expected to not be reliably online. our_channels_config::announced_channel should also be set to false for GUIs and wallet apps.