<p>This looks like the bitcoin backend plugin <code>bcli</code> cannot find the <code>bitcoin-cli</code> executable, since the command seems to be working when run from the same machine with the suggested parameters.</p>
<p>This suggests that the <code>$PATH</code> variable does not include the directory the executable is. To amend this you can do the following:</p>
<pre><code>which bitcoin-cli
</code></pre>
<p>This will tell you where the executable you manually tried is. This will be something like <code>/usr/local/bin/bitcoin-cli</code>.</p>
<p>Next we also tell <code>lightningd</code> exactly where it can find the <code>bitcoin-cli</code>:</p>
<pre><code>$ lightningd \
  --lightning-dir=./cln-dir/ \
  --bitcoin-rpcuser=xxxxxx \
  --bitcoin-rpcpassword=xxxxxx \
  --bitcoin-rpcconnect=192.168.1.38 \
  --bitcoin-rpcport=8901 \
  --bitcoin-cli=/usr/local/bin/bitcoin-cli
</code></pre>
<p>Notice that last line now points to the executable, please adjust the path according to the <code>which</code> command earlier.</p>

CC BY-SA 4.0
2022-11-23T15:21:54.413Z
It looks like the --bitcoin-cli parameter has no effect. I did finally get it to work when I moved bitcoin-cli into a $PATH directory. With bitcoin-cli in the $PATH, the --bitcoin-cli parameter is not needed at all. But when bitcoin-cli is not in the $PATH, the --bitcoin-cli parameter does not work.
Zephyrus
CC BY-SA 4.0
2022-11-24T09:16:10.813Z
Interesting, I had started writing an answer with `PATH` but though `--bitcoin-cli` would be easier. Entering the full path to the executable in `--bitcoin-cli` didn't work?
cdecker
CC BY-SA 4.0
2022-11-24T17:43:54.227Z
No, it didn't work for me. But I created a symbolic link the bitcoin-cli in one of the PATH directories and it worked fine after that.
Zephyrus
CC BY-SA 4.0
2022-11-25T09:37:56.307Z
Ok, that sounds like the `--bitcoin-cli` option should be fixed to work with non-path binaries when the absolute path is specified.
cdecker
CC BY-SA 4.0
2022-11-23T11:12:13.313Z
2022-11-23T11:12:13.313Z
cdecker
<p>CLN 0.12.1</p>
<p>I have bitcoin core running on one machine (Debian 11) and would like set up CLN (C-Lightning) on another machine (Ubuntu 22.04) on the same network. My first test was to use the <code>--bitcoin-...</code> command line parameters to try to get this application connected to my node.</p>
<p>Here is the result.</p>
<pre><code>$ lightningd --lightning-dir=./cln-dir/ --bitcoin-rpcuser=xxxxxx --bitcoin-rpcpassword=xxxxxx --bitcoin-rpcconnect=192.168.1.38 --bitcoin-rpcport=8901

bitcoin-cli not found. Is bitcoin-cli (part of Bitcoin Core) available in your PATH?

Make sure you have bitcoind running and that bitcoin-cli is able to connect to bitcoind.

You can verify that your Bitcoin Core installation is ready for use by running:

    $ bitcoin-cli -rpcconnect=192.168.1.38 -rpcport=8901 -rpcuser=... -rpcpassword=... echo 'hello world'
2022-11-22T21:31:31.451Z **BROKEN** plugin-bcli: \nbitcoin-cli not found. Is bitcoin-cli (part of Bitcoin Core) available in your PATH?\n\nMake sure you have bitcoind running and that bitcoin-cli is able to connect to bitcoind.\n\nYou can verify that your Bitcoin Core installation is ready for use by running:\n\n    $ bitcoin-cli -rpcconnect=192.168.1.38 -rpcport=8901 -rpcuser=... -rpcpassword=... echo 'hello world'\n
2022-11-22T21:31:31.451Z INFO    plugin-bcli: Killing plugin: exited before we sent init
The Bitcoin backend died.
</code></pre>
<p>I have bitcoin-cli on the machine I am running CLN on, so I tried it again, this time providing the bitcoin-cli command line parameter, but I got the same result. If I give it the bitcoin-datadir parameter (which is actually a directory on the other machine), it gives me the same result.</p>
<p>I decided to try bitcoin-cli just to make sure it is possible. With bitcoin core 23.0 running on one machine and bitcoin-cli running on the other, the following command worked.</p>
<pre><code>$ bitcoin-cli -rpcconnect=192.168.1.38 -rpcport=8901 -rpcuser=xxxxxx -rpcpassword=xxxxxx echo 'hello world'
[
  &quot;hello world&quot;
]
</code></pre>
<p>Is there a way to run CLN without using bitcoin-cli?</p>
<p>I just started trying to set this up today, so I am not familiar with CLN at all. Is it even possible to do what I am trying to do? If so, what parameters need to be set in order to get it to work?</p>

<bitcoin-core><lightning-network><bitcoin-cli><core-lightning>
Can CLN be configured to use a bitcoin node running on another machine?
Zephyrus
# Can CLN be configured to use a bitcoin node running on another machine?

(Asked by: username_0 on 2022-11-22)

CLN 0.12.1

I have bitcoin core running on one machine (Debian 11) and would like set up CLN (C-Lightning) on another machine (Ubuntu 22.04) on the same network. My first test was to use the `--bitcoin-...` command line parameters to try to get this application connected to my node.

Here is the result.

```
$ lightningd --lightning-dir=./cln-dir/ --bitcoin-rpcuser=xxxxxx --bitcoin-rpcpassword=xxxxxx --bitcoin-rpcconnect=192.168.1.38 --bitcoin-rpcport=8901

bitcoin-cli not found. Is bitcoin-cli (part of Bitcoin Core) available in your PATH?

Make sure you have bitcoind running and that bitcoin-cli is able to connect to bitcoind.

You can verify that your Bitcoin Core installation is ready for use by running:

    $ bitcoin-cli -rpcconnect=192.168.1.38 -rpcport=8901 -rpcuser=... -rpcpassword=... echo 'hello world'
2022-11-22T21:31:31.451Z **BROKEN** plugin-bcli: \nbitcoin-cli not found. Is bitcoin-cli (part of Bitcoin Core) available in your PATH?\n\nMake sure you have bitcoind running and that bitcoin-cli is able to connect to bitcoind.\n\nYou can verify that your Bitcoin Core installation is ready for use by running:\n\n    $ bitcoin-cli -rpcconnect=192.168.1.38 -rpcport=8901 -rpcuser=... -rpcpassword=... echo 'hello world'\n
2022-11-22T21:31:31.451Z INFO    plugin-bcli: Killing plugin: exited before we sent init
The Bitcoin backend died.

```

I have bitcoin-cli on the machine I am running CLN on, so I tried it again, this time providing the bitcoin-cli command line parameter, but I got the same result. If I give it the bitcoin-datadir parameter (which is actually a directory on the other machine), it gives me the same result.

I decided to try bitcoin-cli just to make sure it is possible. With bitcoin core 23.0 running on one machine and bitcoin-cli running on the other, the following command worked.

```
$ bitcoin-cli -rpcconnect=192.168.1.38 -rpcport=8901 -rpcuser=xxxxxx -rpcpassword=xxxxxx echo 'hello world'
[
  "hello world"
]

```

Is there a way to run CLN without using bitcoin-cli?

I just started trying to set this up today, so I am not familiar with CLN at all. Is it even possible to do what I am trying to do? If so, what parameters need to be set in order to get it to work?

**Tags:** bitcoin-core, lightning-network, bitcoin-cli, core-lightning


---

## 1 answers

### Answer by username_1 on 2022-11-23. Score: 1 | Accepted answer

This looks like the bitcoin backend plugin `bcli` cannot find the `bitcoin-cli` executable, since the command seems to be working when run from the same machine with the suggested parameters.

This suggests that the `$PATH` variable does not include the directory the executable is. To amend this you can do the following:

```
which bitcoin-cli

```

This will tell you where the executable you manually tried is. This will be something like `/usr/local/bin/bitcoin-cli`.

Next we also tell `lightningd` exactly where it can find the `bitcoin-cli`:

```
$ lightningd \
  --lightning-dir=./cln-dir/ \
  --bitcoin-rpcuser=xxxxxx \
  --bitcoin-rpcpassword=xxxxxx \
  --bitcoin-rpcconnect=192.168.1.38 \
  --bitcoin-rpcport=8901 \
  --bitcoin-cli=/usr/local/bin/bitcoin-cli

```

Notice that last line now points to the executable, please adjust the path according to the `which` command earlier.

> **Comments:**
> **username_0**: It looks like the --bitcoin-cli parameter has no effect. I did finally get it to work when I moved bitcoin-cli into a $PATH directory. With bitcoin-cli in the $PATH, the --bitcoin-cli parameter is not needed at all. But when bitcoin-cli is not in the $PATH, the --bitcoin-cli parameter does not work.  
> **username_1**: Interesting, I had started writing an answer with `PATH` but though `--bitcoin-cli` would be easier. Entering the full path to the executable in `--bitcoin-cli` didn't work?  
> **username_0**: No, it didn't work for me. But I created a symbolic link the bitcoin-cli in one of the PATH directories and it worked fine after that.  
> **username_1**: Ok, that sounds like the `--bitcoin-cli` option should be fixed to work with non-path binaries when the absolute path is specified.  

---

