I'm trying to connect to a Bitcoin Core on Windows 10. I start it with this command:

.\bitcoin-qt.exe --server --rest --rpcport=54352 --rpcuser=admin --rpcpassword=admin123

Using netstat -an I see that it indeed is listening on requested port

TCP              LISTENING

However, trying to connect with bitcoin-cli using this command:

.\bitcoin-cli.exe getinfo --rpcport=54352 --rpcuser=admin --rpcpassword=admin123

results in this error:

error: couldn't connect to server

What am I doing wrong?


The --* arguments to bitcoin-cli should come before the RPC command. Those arguments are for bitcoin-cli itself. However the position you put them in are positions for the getinfo RPC command and not bitcoin-cli. You should instead be using the following command:

.\bitcoin-cli.exe --rpcport=54352 --rpcuser=admin --rpcpassword=admin123 getinfo

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.