4

I'm trying to get CLN connected to a running Bitcoin Core node, but it is telling me I have unrecognized options in my config file. I thought the problem was that the data directory for the bitcoin node is on a USB drive that has spaces in its directory name.

In my cln.conf file, it is configured as follows:

bitcoin-rpcconnect=127.0.0.1
bitcoin-rpcport=8332
bitcoin-rpcuser=btcuser
bitcoin-rpcpassword=btcpw
bitcoin-cli=/home/myuser/bitcoin-core/bitcoin-cli
bitcoin-datadir=/media/myuser/Seagate\ Expansion\ Drive/bitcoin/

network=bitcoin

proxy=127.0.0.1:9050
addr=statictor:127.0.0.1:9051
bind-addr=127.0.0.1:9735
always-use-proxy=true
tor-service-password=torpw

When I try to run CLN, I get the following error:

$ lightningd --conf=../cln.conf 

lightning-cli exited with code 3: lightning-cli: -datadir=/media/myuser/Seagate\\ Expansion\\ Drive/bitcoin/: unrecognized option


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:

    $ lightning-cli -datadir=/media/myuser/Seagate\\ Expansion\\ Drive/bitcoin/ -rpcconnect=127.0.0.1 -rpcport=8332 -rpcuser=... -stdinrpcpass echo 'hello world'
The Bitcoin backend died.

The Bitcoin backend did not die. I can still access the node with bitcoin-cli.

$ ./bitcoin-cli --rpcconnect=127.0.0.1 --rpcport=8332 --rpcuser=btcuser --rpcpassword=btcpw getbestblockhash
00000000000000000002b050f0ab9cb9f0f7c5ed4e4fc59f02debe724c571690

So I tried commenting out the bitcoin-datadir line in the config file. Then I get the following error:

$ lightningd --conf=./cln.conf 

lightning-cli exited with code 3: lightning-cli: -rpcconnect=127.0.0.1: unrecognized option


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:

    $ lightning-cli -rpcconnect=127.0.0.1 -rpcport=8332 -rpcuser=... -stdinrpcpass echo 'hello world'
The Bitcoin backend died.

These settings are all in the documentation. Why is it telling me it doesn't recognize them?

1
  • What versions of CLN and Bitcoin Core are you running? Is it possible that you are running a version of CLN that doesn't match the version of the documenation you are using to configure it?
    – Murch
    Commented Dec 18, 2023 at 16:59

1 Answer 1

1

I checked your config locally and I think your main issue is that the bitcoin-datadir is not properly escaped. Your external drive name has a space in it, which may be causing the parsing to fail. I'd suggest you try passing it as:

bitcoin-datadir="/media/myuser/Seagate Expansion Drive/bitcoin/"

Regarding rpcconnect, I don't see anything wrong with it, your config worked in my local setup. Something worth mentioning though: you don't really need to specify bitcoin-rpcconnect and bitcoin-rpcport. Based on your config you are running on default (that is, localhost on the default mainnet port), so those are the same cln will pick if you just don't overwrite them. Same goes for network=bitcoin, that's the default AFAIK.

7
  • Adding quotes around the datadir did not work. I tried several different ways of entering the datadir, even commenting it out, but nothing worked. Unfortunately, I can't change the name of that directory in order to remove the spaces.
    – Zephyrus
    Commented Dec 18, 2023 at 16:42
  • That is pretty odd. What CLN version are you running? Also, can you try a minimal config file placed on the default location? That is, create a file called config under ~/.lightning and add only bitcoin-rpcuser, bitcoin-rpcpassword and bitcoin-cli. Then run lightningd without any other param.
    – sr_gi
    Commented Dec 18, 2023 at 16:50
  • @Zephyrus: If the spaces are really the issue, you could perhaps make a soft link: ln -s "/media/myuser/Seagate\ Expansion\ Drive/bitcoin/" "~/bitcoin-dir" and then specify ~/bitcoin-dir as the data directory in your configuration. (Don't trust, verify: read the man page for ln. man ln ;))
    – Murch
    Commented Dec 18, 2023 at 16:58
  • Also, just spitballing here… if you put the name into quotes, do you still need to escape the spaces?
    – Murch
    Commented Dec 18, 2023 at 17:01
  • 1
    It is version 23.11.1. When I removed all other settings and moved the config file to the default location, it started. I am going to try more changes to the datadir to see if that is causing this, and will also try the symbolic link.
    – Zephyrus
    Commented Dec 18, 2023 at 17:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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