<!DOCTYPE html><htmllang="en"><head><metacharSet="utf-8"/><metahttp-equiv="X-UA-Compatible"content="IE=edge"/><title>LND · bitcoin-s</title><metaname="viewport"content="width=device-width, initial-scale=1.0"/><metaname="generator"content="Docusaurus"/><metaname="description"content="This is an RPC client for [LND](https://github.com/LightningNetwork/lnd). It assumes that a bitcoind instance is running."/><metaname="docsearch:version"content="1.7.0"/><metaname="docsearch:language"content="en"/><metaproperty="og:title"content="LND · bitcoin-s"/><metaproperty="og:type"content="website"/><metaproperty="og:url"content="https://bitcoin-s.org/"/><metaproperty="og:description"content="This is an RPC client for [LND](https://github.com/LightningNetwork/lnd). It assumes that a bitcoind instance is running."/><metaproperty="og:image"content="https://bitcoin-s.org/img/undraw_online.svg"/><metaname="twitter:card"content="summary"/><metaname="twitter:image"content="https://bitcoin-s.org/img/undraw_tweetstorm.svg"/><linkrel="shortcut icon"href="/img/favicon.ico"/><linkrel="stylesheet"href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><linkrel="stylesheet"href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"/><script>
function createToggler(togglerSelector, targetSelector, className) {
var toggler = document.querySelector(togglerSelector);
var target = document.querySelector(targetSelector);
if (!toggler) {
return;
}
toggler.onclick = function(event) {
event.preventDefault();
target.classList.toggle(className);
};
}
});
</script></nav></div><divclass="container mainContainer docsContainer"><divclass="wrapper"><divclass="post"><headerclass="postHeader"><aclass="edit-page-link button"href="https://github.com/bitcoin-s/bitcoin-s/blob/master/docs/rpc/lnd.md"target="_blank"rel="noreferrer noopener">Edit</a><h1id="__docusaurus"class="postHeaderTitle">LND</h1></header><article><div><span><p>This is an RPC client for <ahref="https://github.com/LightningNetwork/lnd">LND</a>. It assumes that a bitcoind instance is running.</p>
<p>Currently, this RPC client is written for <ahref="https://github.com/lightningnetwork/lnd/releases/tag/v0.13.0-beta">v0.13.0</a> version of LND.</p>
<p>Please see the <ahref="https://github.com/lightningnetwork/lnd/blob/v0.13.0-beta/sample-lnd.conf">sample configuration for LND</a>.</p>
<p>You can find the configuration we use for our testing infrastructure for lnd <ahref="https://github.com/bitcoin-s/bitcoin-s/blob/656e0928bf1bf4f511f60dec625699b454f29a1f/testkit/src/main/scala/org/bitcoins/testkit/lnd/LndRpcTestUtil.scala#L90">here</a>.</p>
<p>If you wish to start lnd from the RPC client, you can construct a <ahref="https://github.com/bitcoin-s/bitcoin-s/blob/656e0928bf1bf4f511f60dec625699b454f29a1f/lnd-rpc/src/main/scala/org/bitcoins/lnd/rpc/LndRpcClient.scala#L35"><code>LndRpcClient.binary</code></a> field set</p>
<p>We will default to using the <code>binary</code> field first when trying to start the jar, and the fallback to the default datadir (<code>~/.lnd</code>).</p>
<p>Here is an example of how to start lnd:</p>
<pre><codeclass="hljs css language-scala"><spanclass="hljs-keyword">implicit</span><spanclass="hljs-keyword">val</span> system = <spanclass="hljs-type">ActorSystem</span>(<spanclass="hljs-string">s"lnd-rpc-<spanclass="hljs-subst">${System.currentTimeMillis}</span>"</span>)
<p>The lnd rpc module uses lnd's gRPC. This means when updating to the latest version, the <code>.proto</code> files will need to be updated.
Bitcoin-S stores them in <ahref="https://github.com/bitcoin-s/bitcoin-s/tree/master/lnd-rpc/src/main/protobuf">lnd-rpc/src/main/protobuf</a>.
You can find the files to copy from LND <ahref="https://github.com/lightningnetwork/lnd/tree/master/lnrpc">here</a>.</p>
<p>After updating the <code>proto</code> files you can run <code>sbt compile</code> and this will generate the corresponding class files, this should then give