<p>c-lightning by itself does not expose it's RPC over the network. This is to avoid having to dictate what kind of authorization and authentication to use in order to provide access control.</p>
<p>There are however a couple of options that are easy to implement and will do what you want:</p>
<ul>
<li>Implement a small proxy plugin that'll export the information you need over HTTP and then just retrieve that info from your analysis machine. It'd just take a couple of lines with pyln and flask for example and since there is not write access you're good to go.</li>
<li>Use <code>socat</code> to expose the RPC Unix socket over TCP and then use any JSON-RPC library you'd like. Simple, but may require a.bit of care since now your exposing read write access on an unauthenticated and unencrypted network connection.</li>
<li>Use an existing rpc proxy such as sparko to expose the RPC over whatever your favorite rpc protocol is.</li>
</ul>
<p>In your case I'd go for the first option, since you're likely just using read only access and you can do some filtering and processing on the node reducing the amount of data that needs to be transferred.</p>

CC BY-SA 4.0
2021-07-31T09:24:41.880Z
2021-07-31T09:24:41.880Z
cdecker
<p>I'm looking for a way to do python graph analytics on a local machine that can call a remote lightningd to get up to date nodes and edge data from the lightning node server.
How do I need to configure the node and setup lightningrpc from pyln-client to make this happen?</p>
<p>Thanks in advance</p>

CC BY-SA 4.0
2021-07-31T09:03:50.117Z
Does this answer your question? https://pypi.org/project/pyln-client/ What specific configuration are you unsure of?
Michael Folkson
<lightning-network><python><core-lightning>
How can I access remote lightningd with pyln-client
Simon
# How can I access remote lightningd with pyln-client

(Asked by: username_0 on 2021-07-31)

I'm looking for a way to do python graph analytics on a local machine that can call a remote lightningd to get up to date nodes and edge data from the lightning node server.
How do I need to configure the node and setup lightningrpc from pyln-client to make this happen?

Thanks in advance

**Tags:** lightning-network, python, core-lightning

> **Comments:**
> **username_1**: Does this answer your question? https://pypi.org/project/pyln-client/ What specific configuration are you unsure of?  

---

## 1 answers

### Answer by username_2 on 2021-07-31. Score: 5

c-lightning by itself does not expose it's RPC over the network. This is to avoid having to dictate what kind of authorization and authentication to use in order to provide access control.

There are however a couple of options that are easy to implement and will do what you want:

* Implement a small proxy plugin that'll export the information you need over HTTP and then just retrieve that info from your analysis machine. It'd just take a couple of lines with pyln and flask for example and since there is not write access you're good to go.
* Use `socat` to expose the RPC Unix socket over TCP and then use any JSON-RPC library you'd like. Simple, but may require a.bit of care since now your exposing read write access on an unauthenticated and unencrypted network connection.
* Use an existing rpc proxy such as sparko to expose the RPC over whatever your favorite rpc protocol is.

In your case I'd go for the first option, since you're likely just using read only access and you can do some filtering and processing on the node reducing the amount of data that needs to be transferred.


---

