…in other words start the daemon first then start the cli?
Hm. I’m sure that’s documented somewhere
would suggest a couple of additions to tthis
(*: whever the documentation is for litecoind & litecoin-cli is on github)
first if you have already used the gui to synch the blockchain and configure your wallet, and you did not use the default location for the data directory (~/.config/Litecoin) then use something like this:
(not sure of the exact bash syntax here)
./litecoind -datadir=/home/$USER/sw/mine/Litecoin/data/
…check the top of the output to make sure that it then finds your data folder and if so it should find the wallet properly.
I think that it always looks in .config for the litecoin config file.
If you run litecoind without any flags it will use the defaults for both the config file and the data folder. My config file is in a (custom) data folder as pointed above.
So using the litecoind that I listed above,this is what I get:
Using RdRand as an additional entropy source
Default data directory /home/$USER/.litecoin
Using data directory /home/$USER/sw/mine/Litecoin/data
Config file: /home/$USER/sw/mine/Litecoin/data/litecoin.conf
Config file arg: [main] listen=“1”
Setting file arg: wallet = [$WALLET]
Cmd-line arg: datadir=“/home/$USER/sw/mine/Litecoin/data/”
…it’s ignoring the Litecoin-Qt.conf file that is in the default data folder (~/.config/Litecoin).
Which has this string in it.
strDataDir=/home/$USER/sw/mine/Litecoin/data
which has one problem as I can see:
strDataDir should be just
DataDir.
Since I’m giving it DataDir in the cli, it apparently says “fine, I’ll just go there and look for the data” and it works fine.
since litecoin-cli is apparently just a remote-management tool for the daemon, I’ll just control-c out of the daemon and hope for the best. And as often the case, it catches that cntl-c and shuts down cleanly. But it is clear that a lot of things are running in litecoind that we probably want better control of (without using the gui, since we’re not sure that it’s working correctly), so we want it to read our choice of config file and go from there.
So pulling up the options for litecoind
litecoind -help
we see
-conf=
Specify path to read-only configuration file. Relative paths will be
prefixed by datadir location. (default: litecoin.conf)
and indeed without specifying that it will look for the conf file in the -datadir folder (which explains what happened above). You either have to specify the datadir in the litecoind call, or check the name of the conf file in the default data location to see if it points to the correct conf file that the gui finds when you click “open configuration file” in the gui.
./litecoind -conf=/home/$USER/.config/Litecoin/Litecoin-Qt.conf
Then we run into the problem that Litecoin-Qt.conf is the wrong format for litecoind. It will work with the GUI clearly. Because otherwise it would point to the wrong datadir. But it won’t work with the litecoind. Because it has a block label in it that is “out of date” or something. Change that block label from [General] to [main] (or comment # it out all together.).
also
#strDataDir=/home/$USER/sw/mine/Litecoin/data
datadir=/home/$USER/$USER/mine/Litecoin/data
(save the new file as litecoin.conf and litecoind probably won’t even require the -conf flag)
./litecoind -conf=/home/$USER/.config/Litecoin/litecoin.conf
Then try the daemon again.
So that also works (it finds the blockchain and the wallet)
Now try litecoind with no flags…and now we have a new problem…
Default data directory /home/$USER/.litecoin
Using data directory /home/$USER/.litecoin
…and indeed there is a whole new data folder at that location.
with I take it all the other stuff that litecoind needs.
But there is not a litecoin.conf file in that data tree.
There is however some other interesting stuff…in the litecoind output…
Using the ‘shani(1way,2way)’ SHA256 implementation
Using RdSeed as additional entropy source
Using RdRand as an additional entropy source
Default data directory /home/$USER/.litecoin
Using data directory /home/$USER/.litecoin
Config file: /home/$USER/.litecoin/litecoin.conf (not found, skipping)
…so beware.
The litecoin daemon will not configure a litecoin.conf by default.
if it is not found, it will then probably use the default values for everything.
So this makes life somewhat easier for me.
Instead of using ~/.config/Litecoin as the litecoin.conf folder, I can probably use ~/.litecoin…then not have to use flags with the daemon…so let’s copy the litecoin.conf file over…yep, that works, so now all you have to do is figure out how to connect to the deamon with litecoin-cli.
And remember that the conf file flags will overwrite the gui flags. But the idea here is to make sure that the GUI and the deamon both use the same litecoin.conf file. Which is in my custom data folder. That will mean having to restart the GUI to load the changed flags that are in the custom data folder litecoin.conf file. But you won’t have to worry about whether those flags are getting to the deamon based on the settings in the GUi. You can just run the daemon and check the console output. Then look at the GUI logfile and see if that text matches what you see in the daemon output. You’d have to restart the GUI anyway if you make changes there (to the flag values) but you would not know if those changes are actually getting to the daemon unless there is an output from the daemon that shows up in the gui log file.
So now sort-out which location the GUI is pulling the litecoin.conf file from when you click “open configuration file” in the GUI. The easiest way to do that is to give the conf file a different name in the custom data folder (a copy of litecoin.conf with a new name) point to that copy in the default folder conf file, and see which file is opened in the GUI open config file call. Because clearly the default location of the conf file is different between the daemon and the gui. As we now have two default locations. One with the GUI, another with the daemon. The GUI default config file probably has to have a -Qt in the name. So the other option is to just call litecoind with a -conf flag and let the GUI use its default location.
If either the daemon or the GUI don’t load the correct wallet config properly on startup, then they are using the wrong data folder. This version of the litecoin full node uses the Berkley 4.8 database, there is also a SQLlite database. They probably don’t have the same capabilities and features. The GUI will restore the wallet to the same state, open & closed, locked vs unlocked that it was in when the GUI was properly shut down. If you want to mine also, you have to enable incoming connections.
litecoind default config dir is ~/.litecoin
litecoin-gui default config dir is ~/.config/Litecoin
These are the corresponding default data locations.
The sw expects to find the litecoin.conf file in the data location.
These can be change in the command-line calls.
I’ve yet to get incoming connections in the gui when I got them in the bitcore full node, at least using my phone as the internet connection. Will update this when I get incoming connections using the litecoin gui. You have to have the blockchain fullly synched (or pruned) to mine on a full-node, it won’t accept incoming connections until it can mine. But that also assumes that your network connection will support incoming connections.
“but why would you want to mine on a full-node in 2025 anyway”