user91939: I have a bitcoind and LND server running. I can make RPC calls to bitcoind using curl, like this:
curl http://XXX:YYY@localhost:8332 -H 'content-type:text/plain;' --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getblockchaininfo","params":[]}'
However I can't find out how to make RPC calls to LND using curl.
My lnd.conf contains a [Bitcoind] section like this:
[Bitcoind]
bitcoind.rpchost=127.0.0.1:8332
bitcoind.rpcuser=XXX
bitcoind.rpcpass=YYY
bitcoind.zmqpubrawblock=127.0.0.1:28332
bitcoind.zmqpubrawtx=127.0.0.1:28333

However, what I'm struggling with is finding out or configuring how to actually connect to LND itself with RPC.
Can't find clear documentation about this. I figured out that apparently I need to use port 10009, but this doesn't work:
curl http://XXX:YYY@localhost:10009 -H 'content-type:text/plain;' --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getinfo","params":[]}'
(result is empty, no error, nothing)
I guessed perhaps I need to set a separate RPC username and password for LND, but I can't find out how or where, i.e. what the settings are in lnd.conf?
Also, do I have to add a config line to make sure the LND daemon is listening to RPC calls? 
Also, do I have to add a config line to make sure the LND daemon is accepting RPC calls from specific IPs? (localhost in this case, or adding external IPs later)

user30017: LND has two API interfaces:

On port 8080 is a REST RPC interface
On port 10009 is a GRPC interface.

The REST interface on 8080 needs a macaroon file and an optional tls certificate.
You can use CURL like this:
MACAROON_HEADER="Grpc-Metadata-macaroon: $(xxd -ps -u -c 1000 ~/.lnd/admin.macaroon)" 
curl -X GET --cacert ~/.lnd/tls.cert --header "$MACAROON_HEADER" https://192.168.0.7:8080/v1/getinfo

if you want to ignore tlc.cert add -k option to the curl call.
The parameters above are:

~./lnd/admin.macaroon: is the path to your nodes macaroon file (generated by your lnd node)
~/.lnd/tls.cert: is the path to the tls cert file (generated by your lnd node)
192.168.0.7:8080 is the IP and port of the RPC of your LND node, if its on the same machine you can just use localhost:8080

You need the following settings in your lnd.conf:

restlisten=0.0.0.0:8080 this tells LND to listen to RPC requests on port 8080
no-rest-tls=true - this allows you to disable tls certificates


91939: <p>I have a bitcoind and LND server running. I can make RPC calls to bitcoind using curl, like this:</p>

<p><code>curl http://XXX:YYY@localhost:8332 -H 'content-type:text/plain;' --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getblockchaininfo","params":[]}'</code></p>

<p>However I can't find <strong>out how to make RPC calls to LND using curl.</strong></p>

<p>My lnd.conf contains a [Bitcoind] section like this:</p>

<pre><code>[Bitcoind]
bitcoind.rpchost=127.0.0.1:8332
bitcoind.rpcuser=XXX
bitcoind.rpcpass=YYY
bitcoind.zmqpubrawblock=127.0.0.1:28332
bitcoind.zmqpubrawtx=127.0.0.1:28333
</code></pre>

<p>However, what I'm struggling with is finding out or configuring how to actually <strong>connect to LND itself with RPC.</strong></p>

<p>Can't find clear documentation about this. I figured out that apparently I need to use port 10009, but this doesn't work:</p>

<p><code>curl http://XXX:YYY@localhost:10009 -H 'content-type:text/plain;' --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getinfo","params":[]}'</code></p>

<p>(result is empty, no error, nothing)</p>

<p>I guessed perhaps I need to set a separate RPC username and password for LND, but I can't find out how or where, i.e. what the settings are in lnd.conf?</p>

<p>Also, do I have to add a config line to make sure the LND daemon is listening to RPC calls? </p>

<p>Also, do I have to add a config line to make sure the LND daemon is accepting RPC calls from specific IPs? (localhost in this case, or adding external IPs later)</p>
 30017: <p>LND has two API interfaces:</p>
<ol>
<li>On port 8080 is a REST RPC interface</li>
<li>On port 10009 is a GRPC interface.</li>
</ol>
<p>The REST interface on 8080 needs a macaroon file and an optional tls certificate.<br />
You can use CURL like this:</p>
<pre><code>MACAROON_HEADER=&quot;Grpc-Metadata-macaroon: $(xxd -ps -u -c 1000 ~/.lnd/admin.macaroon)&quot; 
curl -X GET --cacert ~/.lnd/tls.cert --header &quot;$MACAROON_HEADER&quot; https://192.168.0.7:8080/v1/getinfo
</code></pre>
<p>if you want to ignore tlc.cert add <code>-k</code> option to the curl call.</p>
<p>The parameters above are:</p>
<ol>
<li><code>~./lnd/admin.macaroon</code>: is the path to your nodes macaroon file (generated by your lnd node)</li>
<li><code>~/.lnd/tls.cert</code>: is the path to the tls cert file (generated by your lnd node)</li>
<li><code>192.168.0.7:8080</code> is the IP and port of the RPC of your LND node, if its on the same machine you can just use <code>localhost:8080</code></li>
</ol>
<p>You need the following settings in your lnd.conf:</p>
<ul>
<li><code>restlisten=0.0.0.0:8080</code> this tells LND to listen to RPC requests on port 8080</li>
<li><code>no-rest-tls=true</code> - this allows you to disable tls certificates</li>
</ul>
