Bitcoin Forum
April 23, 2024, 09:43:20 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Remote RPC queries to C-Lighting Node  (Read 104 times)
simpleSliv3r (OP)
Jr. Member
*
Offline Offline

Activity: 46
Merit: 28


View Profile
March 21, 2023, 06:42:16 PM
Merited by ABCbits (1)
 #1

Hi all,

I am starting with the lighting network, specifically with Core Lighting (C-lighting). I was looking for information about how to execute remote commands on the node.
I mean, locally you can execute "lighting-cli $option" commands but I'm looking for a way to do it remotely without SSH connection.
I thought the node had an API where I could do petitions but, I do not find anything on the Internet regarding this without using additional server.

Does this API exist? If it does, please could someone share some documentation about this?
If not, please feel free to share your sugestions about how could I interact with the node remotely without SSH.

Thanks in advance.


Best Regards,
SS
You can see the statistics of your reports to moderators on the "Report to moderator" pages.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713908600
Hero Member
*
Offline Offline

Posts: 1713908600

View Profile Personal Message (Offline)

Ignore
1713908600
Reply with quote  #2

1713908600
Report to moderator
1713908600
Hero Member
*
Offline Offline

Posts: 1713908600

View Profile Personal Message (Offline)

Ignore
1713908600
Reply with quote  #2

1713908600
Report to moderator
Carlton Banks
Legendary
*
Offline Offline

Activity: 3430
Merit: 3071



View Profile
March 21, 2023, 08:47:28 PM
 #2

maybe some other application has an API that can send commands to c-lightning nodes, but lightning-cli is the only part of c-lightning that could be used for remote access

guess how those applications achieve this trick? they're accepting commands from the remote user, then sending them to.... lightning-cli Cheesy

Vires in numeris
DaveF
Legendary
*
Offline Offline

Activity: 3458
Merit: 6234


Crypto Swap Exchange


View Profile WWW
March 21, 2023, 10:40:38 PM
Merited by ABCbits (1)
 #3

What are you looking to do?

There are web interfaces [Ride the lightning] that allow access thought the web.

They have also written a REST API  https://github.com/Ride-The-Lightning/c-lightning-REST

If you search there are more but RTL tends to be the most popular which means if you have an issue there are more places to look.

-Dave

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
simpleSliv3r (OP)
Jr. Member
*
Offline Offline

Activity: 46
Merit: 28


View Profile
March 21, 2023, 11:10:59 PM
 #4

What are you looking to do?

Imagine I have an application than works as a client on one computer, I would like to make petitions to the node which is on a different computer.



There are web interfaces [Ride the lightning] that allow access thought the web.

They have also written a REST API  https://github.com/Ride-The-Lightning/c-lightning-REST

If you search there are more but RTL tends to be the most popular which means if you have an issue there are more places to look.

-Dave

I would like to avoid using external code as this project is just to learn and I want to write all the code myself. But thanks for the example.

As far as I can see they (RTL) build a server on the node computer and play with a plugin configuration option on the node. So I guess this is the answer. I need an additional server on the node side. So the schema should look similar to this:
   
   10.0.0.1(client) -- > 10.0.0.2(server) --> 10.0.0.2(node)

DaveF
Legendary
*
Offline Offline

Activity: 3458
Merit: 6234


Crypto Swap Exchange


View Profile WWW
March 22, 2023, 12:10:18 PM
Merited by ABCbits (1)
 #5

Another thought, have you looked at LND and the way they do things?

LND has an API built in.

One of the big differences between C-Lighting and LND is that C-Lighting is more 'modular' you need something you add it in. LND has a lot more things built into it.
I don't think one way is better or worse, just a different way of thinking.

https://lightning.engineering/api-docs/api/lnd/
https://docs.lightning.engineering/

Obligatory, use testnet when playing around and testing or don't commit funds you can't afford to loose if you are tinkering and detonate something.....

-Dave

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
simpleSliv3r (OP)
Jr. Member
*
Offline Offline

Activity: 46
Merit: 28


View Profile
March 22, 2023, 04:52:38 PM
 #6

Another thought, have you looked at LND and the way they do things?

LND has an API built in.

One of the big differences between C-Lighting and LND is that C-Lighting is more 'modular' you need something you add it in. LND has a lot more things built into it.
I don't think one way is better or worse, just a different way of thinking.

https://lightning.engineering/api-docs/api/lnd/
https://docs.lightning.engineering/


Thanks for that Dave. I'm only using C-Lighting for the moment as I need to use that specific node due a specific reason. But it's nice to know that other implementations have this kind of things already implemented.

Obligatory, use testnet when playing around and testing or don't commit funds you can't afford to loose if you are tinkering and detonate something.....

Yes sure, I'm using a LN simulator called Polar.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!