On this page

latest contributor to this doc

Last Edit:

@gcharang

Lightning Network Initialization Tasks

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

API-v2task::enable_lightning::init

The task::enable_lightning::init request a task to run a lightning node. Use the returned task_id as an input to check the status of the lightning node (i.e, running or still initiating). An error will be returned if a lightning node was already running for the requested ticker.

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.

ParameterTypeDescription
tickerstringTicker of coin to activate
activation_paramsobjectA standard LightningActivationParams object.

Initialize Lightning

POST
task::enable_lightning::init
{
  "method": "task::enable_lightning::init",
  "userpass": "RPC_UserP@SSW0RD",
  "mmrpc": "2.0",
  "params": {
    "ticker": "tBTC-lightning",
    "activation_params": {
      "name": "KomoDeFi-Docs-Node-1",
      "listening_port": 9735,
      "color": "000000",
      "payment_retries": 5
    }
  },
  "id": 2
}
API-v2task::enable_lightning::status

The task::enable_lightning::status request checks the status of lightning node initialization.

ParameterTypeDescription
task_idintegerThe task id returned from task::enable_lightning::init
forget_if_finishedbooleanOptional, defaults to true. If false, the status of the task_id will still be available after the task has completed.

Initialization Status

POST
task::enable_lightning::status
{
  "userpass": "RPC_UserP@SSW0RD",
  "mmrpc": "2.0",
  "method": "task::enable_lightning::status",
  "params": {
    "task_id": 1,
    "forget_if_finished": false
  },
  "id": 2
}
API-v2task::enable_lightning::cancel

The task::enable_lightning::cancel request cancels lightning node initialization.

ParameterTypeDescription
task_idintegerThe task id returned from task::enable_lightning::init

Cancel Initialization

POST
task::enable_lightning::cancel
{
  "userpass": "RPC_UserP@SSW0RD",
  "mmrpc": "2.0",
  "method": "task::enable_lightning::cancel",
  "params": {
    "task_id": 1
  },
  "id": 1
}