1

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?

1 Answer 1

1

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.

4
  • 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
    Nov 23 at 15:21
  • 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
    Nov 24 at 9:16
  • 1
    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
    Nov 24 at 17:43
  • Ok, that sounds like the --bitcoin-cli option should be fixed to work with non-path binaries when the absolute path is specified.
    – cdecker
    Nov 25 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.