Lightning Network Nodes

Connect to NodeAPI-v2lightning::nodes::connect_to_node

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

Request Parameters

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

📌 Example

POST Connect to Node 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
}
Show Response

Response (success)

{
    "mmrpc": "2.0",
    "result": "Connected successfully to node : 035e4ff418fc8b5554c5d9eea66396c227bd429a3251c8cbc711002ba215bfc226@170.75.163.209:9735",
    "id": null
}

Response (already connected)

{
    "mmrpc": "2.0",
    "result": "Already connected to node : 035e4ff418fc8b5554c5d9eea66396c227bd429a3251c8cbc711002ba215bfc226@170.75.163.209:9735",
    "id": null
}
Show Error Responses

InvalidRequest Error (Invalid node_address)

{
	"mmrpc": "2.0",
	"error": "Error parsing request: Could not parse node address from str rgjhk3",
	"error_path": "dispatcher",
	"error_trace": "dispatcher:109]",
	"error_type": "InvalidRequest",
	"error_data": "Could not parse node address from str rgjhk3",
	"id": 762
}

ConnectionError Error (Timed out waiting to connect to node_address)

{
    "mmrpc": "2.0",
    "error": "Error connecting to node: Timeout error: Failed to connect to node: 035e4ff418fc8b5554c5d9eea66396c227bd429a3251c8cbc711002ba215bfc226",
    "error_path": "connect_to_node",
    "error_trace": "connect_to_node:78]",
    "error_type": "ConnectionError",
    "error_data": "Timeout error: Failed to connect to node: 035e4ff418fc8b5554c5d9eea66396c227bd429a3251c8cbc711002ba215bfc226",
    "id": null
}

List Trusted NodesAPI-v2lightning::nodes::list_trusted_nodes

The lightning::nodes::list_trusted_nodes method allows you to list all nodes in your trusted list.

Request Parameters

ParameterTypeDescription
coinstringThe coin ticker you would like to view your trusted nodes to.

📌 Example

POST List Trusted Nodes lightning::nodes::list_trusted_nodes
{
  "userpass": "RPC_UserP@SSW0RD",
  "mmrpc": "2.0",
  "method": "lightning::nodes::list_trusted_nodes",
  "params": {
    "coin": "tBTC-lightning"
  },
  "id": 1
}
Show Response

Response

{
	"mmrpc": "2.0",
	"result": {
		"trusted_nodes": ["038863cf8ab91046230f561cd5b386cbff8309fa02e3f0c3ed161a3aeb64a643b9"]
	},
	"id": 1
}

Add Trusted NodeAPI-v2lightning::nodes::add_trusted_node

The lightning::nodes::add_trusted_node method allows you to add a node to your trusted list.

Request Parameters

ParameterTypeDescription
coinstringThe coin ticker you would like to add a trusted node for.
node_idstringID of node you would like to add to your trusted list.

📌 Example

POST Add Trusted Node lightning::nodes::add_trusted_node
{
  "userpass": "RPC_UserP@SSW0RD",
  "mmrpc": "2.0",
  "method": "lightning::nodes::add_trusted_node",
  "params": {
    "coin": "tBTC-lightning",
    "node_id": "038863cf8ab91046230f561cd5b386cbff8309fa02e3f0c3ed161a3aeb64a643b9"
  },
  "id": 1
}
Show Response

Response

{
	"mmrpc": "2.0",
	"result": {
		"added_node": "038863cf8ab91046230f561cd5b386cbff8309fa02e3f0c3ed161a3aeb64a643b9"
	},
	"id": 1
}

Remove Trusted NodeAPI-v2lightning::nodes::remove_trusted_node

The lightning::nodes::remove_trusted_node method allows you to remove a node from your trusted list.

Request Parameters

ParameterTypeDescription
coinstringThe coin ticker you would like to remove a trusted node from.
node_idstringID of node you would like to remove from your trusted list.

📌 Example

POST Remove Trusted Node lightning::nodes::remove_trusted_node
{
  "userpass": "RPC_UserP@SSW0RD",
  "mmrpc": "2.0",
  "method": "lightning::nodes::remove_trusted_node",
  "params": {
    "coin": "tBTC-lightning",
    "node_id": "038863cf8ab91046230f561cd5b386cbff8309fa02e3f0c3ed161a3aeb64a643b9"
  },
  "id": 1
}
Show Response

Response

{
	"mmrpc": "2.0",
	"result": {
		"removed_node": "038863cf8ab91046230f561cd5b386cbff8309fa02e3f0c3ed161a3aeb64a643b9"
	},
	"id": 1
}