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

<pre><code>.\bitcoin-cli.exe --rpcport=54352 --rpcuser=admin --rpcpassword=admin123 getinfo
</code></pre>

CC BY-SA 3.0
2017-06-16T08:27:51.467Z
2017-06-16T08:27:51.467Z
Ava Chow
<p>I'm trying to connect to a <code>Bitcoin Core</code> on Windows 10. I start it with this command:</p>

<pre><code>.\bitcoin-qt.exe --server --rest --rpcport=54352 --rpcuser=admin --rpcpassword=admin123
</code></pre>

<p>Using <code>netstat -an</code> I see that it indeed is listening on requested port</p>

<pre><code>TCP    127.0.0.1:54352        0.0.0.0:0              LISTENING
</code></pre>

<p>However, trying to connect with <code>bitcoin-cli</code> using this command:</p>

<pre><code>.\bitcoin-cli.exe getinfo --rpcport=54352 --rpcuser=admin --rpcpassword=admin123
</code></pre>

<p>results in this error:</p>

<pre><code>error: couldn't connect to server
</code></pre>

<p>What am I doing wrong?</p>

<bitcoind><bitcoin-core><client>
bitcoin-cli "error: couldn't connect to server"
Humberd
# bitcoin-cli "error: couldn't connect to server"

(Asked by: username_0 on 2017-06-03)

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    127.0.0.1:54352        0.0.0.0:0              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?

**Tags:** bitcoind, bitcoin-core, client


---

## 1 answers

### Answer by username_1 on 2017-06-16. Score: 2

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

```


---

