Lightning Network Nodes
Lightning methods are currently only available using the native AtomicDEX-API. WASM support should be available in late 2023.
API-v2lightning::nodes::connect_to_node
The lightning::nodes::connect_to_node
method allows you to connect to a lightning node.
Parameter | Type | Description |
---|---|---|
coin | string | The coin ticker you would like to connect to a node on. |
node_address | string | Lightning nodes addresses always have a format of node_pubkey @ip_address :port |
Connect to Node
POST
lightning::nodes::connect_to_node{
"userpass": "testpsw",
"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:
API-v2lightning::nodes::list_trusted_nodes
The lightning::nodes::list_trusted_nodes
method allows you to list all nodes in your trusted list.
Parameter | Type | Description |
---|---|---|
coin | string | The coin ticker you would like to view your trusted nodes to. |
List Trusted Nodes
POST
lightning::nodes::list_trusted_nodes{
"userpass": "testpsw",
"mmrpc": "2.0",
"method": "lightning::nodes::list_trusted_nodes",
"params": {
"coin": "tBTC-lightning"
},
"id": 1
}
API-v2lightning::nodes::add_trusted_node
The lightning::nodes::add_trusted_node
method allows you to add a node to your trusted list.
Parameter | Type | Description |
---|---|---|
coin | string | The coin ticker you would like to add a trusted node for. |
node_id | string | ID of node you would like to add to your trusted list. |
Add Trusted Node
POST
lightning::nodes::add_trusted_node{
"userpass": "testpsw",
"mmrpc": "2.0",
"method": "lightning::nodes::add_trusted_node",
"params": {
"coin": "tBTC-lightning",
"node_id": "038863cf8ab91046230f561cd5b386cbff8309fa02e3f0c3ed161a3aeb64a643b9"
},
"id": 1
}
API-v2lightning::nodes::remove_trusted_node
The lightning::nodes::remove_trusted_node
method allows you to remove a node from your trusted list.
Parameter | Type | Description |
---|---|---|
coin | string | The coin ticker you would like to remove a trusted node from. |
node_id | string | ID of node you would like to remove from your trusted list. |
Remove Trusted Node
POST
lightning::nodes::remove_trusted_node{
"userpass": "testpsw",
"mmrpc": "2.0",
"method": "lightning::nodes::remove_trusted_node",
"params": {
"coin": "tBTC-lightning",
"node_id": "038863cf8ab91046230f561cd5b386cbff8309fa02e3f0c3ed161a3aeb64a643b9"
},
"id": 1
}