Bitcoin Forum
May 10, 2024, 11:07:06 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: CLI not finding bitcoin.conf [linux]  (Read 3730 times)
jrswab (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile WWW
August 20, 2015, 01:15:50 PM
 #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
1715382426
Hero Member
*
Offline Offline

Posts: 1715382426

View Profile Personal Message (Offline)

Ignore
1715382426
Reply with quote  #2

1715382426
Report to moderator
1715382426
Hero Member
*
Offline Offline

Posts: 1715382426

View Profile Personal Message (Offline)

Ignore
1715382426
Reply with quote  #2

1715382426
Report to moderator
1715382426
Hero Member
*
Offline Offline

Posts: 1715382426

View Profile Personal Message (Offline)

Ignore
1715382426
Reply with quote  #2

1715382426
Report to moderator
Even if you use Bitcoin through Tor, the way transactions are handled by the network makes anonymity difficult to achieve. Do not expect your transactions to be anonymous unless you really know what you're doing.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6635


Just writing some code


View Profile WWW
August 20, 2015, 06:54:31 PM
 #2

You need to add the flag
Code:
-datadir=<path to directory>
to every bitcoin-cli command

jrswab (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile WWW
August 20, 2015, 06: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!
tspacepilot
Legendary
*
Offline Offline

Activity: 1456
Merit: 1078


I may write code in exchange for bitcoins.


View Profile
August 31, 2015, 04:26:33 PM
 #4

You need to add the flag
Code:
-datadir=<path to directory>
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.
Polyatomic
Sr. Member
****
Offline Offline

Activity: 257
Merit: 250


View Profile
September 03, 2015, 07:38:21 AM
Last edit: September 03, 2015, 11:10:09 AM by Polyatomic
 #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
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!