Bitcoin Forum
May 29, 2024, 10:04:43 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin-CLI - Cannot connect  (Read 340 times)
genesis2020 (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 4


View Profile
January 10, 2020, 12:42:24 PM
 #1

I've downloaded the Bitcoin source code and compiled it successfully. I've now got Bitcoin-QT running and synchronising transactions. In the meantime, I thought I'd have a play with the cli but when I run bitcoin-cli on the command line (I'm running Windows 10 by the way), I get the following error:

Code:
error: Could not connect to the server 127.0.0.1:8332 (error code 1 - "EOF reached")

Make sure the bitcoind server is running and that you are connecting to the correct RPC port.


I'm not sure if I need to specify a port (if so, how?) or whether its because the bitcoin-qt is running and not bitcoind.exe? Or is there likely to be some other issue?

Thanks
Lauda
Legendary
*
Offline Offline

Activity: 2674
Merit: 2965


Terminated.


View Profile WWW
January 10, 2020, 12:47:00 PM
 #2

I've downloaded the Bitcoin source code and compiled it successfully. I've now got Bitcoin-QT running and synchronising transactions. In the meantime, I thought I'd have a play with the cli but when I run bitcoin-cli on the command line (I'm running Windows 10 by the way), I get the following error:

Code:
error: Could not connect to the server 127.0.0.1:8332 (error code 1 - "EOF reached")

Make sure the bitcoind server is running and that you are connecting to the correct RPC port.


I'm not sure if I need to specify a port (if so, how?) or whether its because the bitcoin-qt is running and not bitcoind.exe? Or is there likely to be some other issue?

Thanks
Run the daemon. If you're running QT, you can just open the console and try out the commands. They are the same set of available commands.

"The Times 03/Jan/2009 Chancellor on brink of second bailout for banks"
😼 Bitcoin Core (onion)
nc50lc
Legendary
*
Offline Offline

Activity: 2422
Merit: 5658


Self-proclaimed Genius


View Profile
January 10, 2020, 02:29:50 PM
Merited by HCP (2), ABCbits (1)
 #3

If you want to use 'bitcoin-qt' instead of 'bitcoind' for some reason, add server=1 to your bitcoin.conf file from the default data directory.
Create a new file and rename it including the extension if don't have one.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
calkob
Hero Member
*****
Offline Offline

Activity: 1092
Merit: 520


View Profile
January 14, 2020, 10:52:11 PM
 #4

I've downloaded the Bitcoin source code and compiled it successfully. I've now got Bitcoin-QT running and synchronising transactions. In the meantime, I thought I'd have a play with the cli but when I run bitcoin-cli on the command line (I'm running Windows 10 by the way), I get the following error:

Code:
error: Could not connect to the server 127.0.0.1:8332 (error code 1 - "EOF reached")

Make sure the bitcoind server is running and that you are connecting to the correct RPC port.


I'm not sure if I need to specify a port (if so, how?) or whether its because the bitcoin-qt is running and not bitcoind.exe? Or is there likely to be some other issue?

Thanks

Bitcoin-qt doesn't need bitcoin-cli you just use the console.  you only use bitcoin-cli if running bitcoind.
BitMaxz
Legendary
*
Offline Offline

Activity: 3276
Merit: 2979


BTC price road to $80k


View Profile WWW
January 14, 2020, 11:48:42 PM
Merited by ABCbits (1)
 #5

Configure the bitcoin.conf use this generator from here https://jlopp.github.io/bitcoin-core-config-generator/
Use it if you don't have bitcoin.conf but if you have bitcoin.conf you can paste this code below.

Code:
rpcuser=user
rpcpassword=pass
rpcallowip=127.0.0.1
rpcport=8332
rpcthreads=10
server=1

Then try this command

Code:
C:\Program Files\Bitcoin\daemon>bitcoin-cli -rpcuser=user -rpcpassword=pass -rpc
port=8332 getinfo

it doesn't work try to open terminal and bitcoind(Both of these should be running) then open a new terminal where you can try to test the "getinfo" command.

Got source from here https://bitcoin.stackexchange.com/questions/64045/unable-to-make-bitcoind-commands with the same issue as yours.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
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!