On this page

latest contributor to this doc

Last Edit:

@smk762

Connect to Lightning Node

API-v2lightning::nodes::connect_to_node

The lightning::nodes::connect_to_node method allows you to connect to a Lightning node.

ParameterTypeRequiredDescription
coinstringThe coin ticker you would like to connect to a node on.
node_addressstringLightning node addresses always have a format of node_pubkey@ip_address:port.

ParameterTypeDescription
resultstringConnection result message (e.g., success, already connected, etc.)
idint or nullRequest identifier, or null.

lightning::nodes::connect_to_node

POST
lightning::nodes::connect_to_node
{
  "userpass": "RPC_UserP@SSW0RD",
  "mmrpc": "2.0",
  "method": "lightning::nodes::connect_to_node",
  "params": {
    "coin": "tBTC-lightning",
    "node_address": "038863cf8ab91046230f561cd5b386cbff8309fa02e3f0c3ed161a3aeb64a643b9@203.132.94.196:9735"
  },
  "id": 1
}

The node address in the above request is for the WalletOfSatoshi lightning node, which is one of the most connected lightning nodes. Other node addresses can be retrieved from any lightning explorer, such as: