Author

Topic: CLI not finding bitcoin.conf [linux] (Read 3756 times)

sr. member
Activity: 257
Merit: 250
September 03, 2015, 02:38:21 AM
#5
You can keep $HOME/.bitcoin/bitcoin.conf there
but change datadir to the location of the new filesystem
which could be a seperate partition or another drive even.

something like this in  $HOME/.bitcoin/bitcoin.conf
Code:
### [Mainnet] ###
datadir=/srv/temp/blockchain/data

check it out
Code:
milton@milton:~/.bitcoin$ mount -v -t ext4 /dev/sdf5 /srv/temp
mount: /dev/sdf5 mounted on /srv/temp
milton@milton:~/.bitcoin$ ls -a /srv/temp/bitcoin/blockchain/data/
blocks  chainstate  db.log  debug.log  fee_estimates.dat  .lock  peers.dat  wallet.dat  wallet.dat.old

milton@milton:~/temp/bitcoin/src$ ./bitcoind -daemon
Bitcoin server starting

milton@milton:~/temp/bitcoin/src$ ./bitcoin-cli getmininginfo
{
    "blocks" : 372686,
    "currentblocksize" : 0,
    "currentblocktx" : 0,
    "difficulty" : 54256630327.88996124,
    "errors" : "",
    "genproclimit" : -1,
    "networkhashps" : 396484914787293504,
    "pooledtx" : 29,
    "testnet" : false,
    "chain" : "main",
    "generate" : false
}

bitcoin-cli man!
There is another story of user accounts and process identity, file ownership and permissions,
which make up the access control model in Linux. But thats for another thread Smiley
legendary
Activity: 1456
Merit: 1081
I may write code in exchange for bitcoins.
August 31, 2015, 11:26:33 AM
#4
You need to add the flag
Code:
-datadir=
to every bitcoin-cli command

It's probably worth it in this case for the OP to alias 'bitcoin-cli' -> 'bitcoin-cli --datadir=/path/to/his/blockchain' in his .bashrc or whatever shell he uses.  I wouldn't want to have to keep typing that.

Or, maybe this is a better option. perhaps could symlink his external hdd to the "standard" location of the datadir so that the default paths just work.
newbie
Activity: 2
Merit: 0
August 20, 2015, 01:59:38 PM
#3
wow  Cheesy
That should have been something I tried; well it looks like I'll be making a script cause I have no desire to type the path every time.
Thanks for the heads up!
staff
Activity: 3458
Merit: 6793
Just writing some code
August 20, 2015, 01:54:31 PM
#2
You need to add the flag
Code:
-datadir=
to every bitcoin-cli command
newbie
Activity: 2
Merit: 0
August 20, 2015, 08:15:50 AM
#1
So I decided to move my node files to an external HDD.
Everything is running well and bitcoind is redownloading the blockchain.

However, when trying to use bitcoin-cli to check on status and connections it is unable to find where my bitcoin.conf is located; even though bitcoind knows where it is exactly.
Is there a file that I need to edit? I have been unable to find anything online and also did a search here (but I may have missed it).

If you need any more information from me I'll be happy to provide.

thanks.

edit: i am running satoshi:0.11.0
Jump to: