Bitcoin Forum
November 11, 2024, 02:56:20 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: CLI issues in linux  (Read 154 times)
Asaf1993 (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
June 13, 2018, 09:47:47 AM
 #1

Hey!
I am using both bitcoin-cli and litecoin-cli on different VM's (Ubuntu) on both of them I have node (Bitcoin core & Litecoin core).
Within the VM's the blockcahin is stored on 1 partition and the CLI on a different one.
The blockchain partition is mounted to the main partition (where the CLI is stored).
I placed both .conf files in the corresponding dirs -> ~/.bitcoin & ~/.litecoin.
.conf:
testnet=1
rpcuser=user
rpcpassword=password
rpcallowip=0.0.0.0/0
rpcbind=0.0.0.0
daemon=1
For some reason I can't get access to CLI commands.
When running normal CLI call this is the output:
command: bitcoin-cli getnetworkinfo
output:  error: Could not connect to the server 127.0.0.1:18332
Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
when running:
command: bitcoin-cli -rpcport=8332 getnetworkinfo
output: error: Authorization failed: Incorrect rpcuser or rpcpassword
There r two users in the system:
root and bitcoinuser/litecoinuser (in sudoers group)

Can someone point out what am I doing wrong?

TNX!
pebwindkraft
Sr. Member
****
Offline Offline

Activity: 257
Merit: 343


View Profile
June 13, 2018, 12:49:31 PM
 #2

Ok, just to understand further: your root is on one partition, containing e.g. /usr/local/bin, with the binaries of bitcoin, and there is a separate home Partition, which is mounted into root? Maybe show us fstab? And the full path to the bitcoin.conf file. And which user executes bitcoin-cli?
Btw: Ubuntu/Debian/SuSE/Redhat?
Who is running he bitcoin daemon? (Show how you started bitcoin...). Anything you could see in the log files? Is „ps aux“ showing bitcoind is running?
If testnet =1, then ports are correct (Default RPC connection port is 18332). However 8332 doesn‘t look like testnet, it would be mainnet. Maybe the executables don’t find the path to the correct conf file(s)...
aleksej996
Sr. Member
****
Offline Offline

Activity: 490
Merit: 389


Do not trust the government


View Profile
June 13, 2018, 08:42:55 PM
 #3

I thought that you need to run "-testnet" when you start bitcoin-cli, since I don't think it is aware of the configurations for the daemon on it's own.
Although I don't understand why it would connect to 18332 then.

Make sure you have a bitcoin.conf file with right permissions in .bitcoin and run "bitcoin-cli -testnet -rpcuser=user -rpcpassword=password".
Other than that you might want to check out debug.log file if you are still having issues. It is in the .bitcoin directory as well.
Asaf1993 (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
June 17, 2018, 12:37:42 PM
 #4

Got it figured eventually,
There was a problem with the location of the .conf file.

TNX any way for the help!
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!