<ol>
<li>Ensure that <code>cardano-node</code> is running.</li>
<li>open a new terminal window, and enter <code>nano ~/.bashrc</code></li>
<li>Scroll to the bottom of the file and add the following line:</li>
</ol>
<p><code>EXPORT CARDANO_NODE_SOCKET_PATH=/home/user/cardnao/db/socket</code> (or whatever the path is to the socket in your <code>db</code> folder)</p>
<ol start="4">
<li>Save the file and exit, then in the same terminal window, type: <code>source ~/.bashrc</code> and hit enter.</li>
<li>Now things should work. To check if the socket path is recognized, run:</li>
</ol>
<p><code>cardano-cli query tip --testnet-magic 1097911063</code>, and you should receive a sync status update. Comment if you're still getting an error.</p>

CC BY-SA 4.0
2022-02-12T03:27:34.293Z
How do i know the path of socket?
arunwebber
CC BY-SA 4.0
2022-02-12T13:54:10.670Z
when you run `cardano-node`, one of the mandatory flags is to specify a db folder. When you do that, a socket file is automatically created in that folder. CARDANO_NODE_SOCKET_PATH in your `~/.bashrc` folder must then be pointed to that socket (following the instructions above)
zhekson
CC BY-SA 4.0
2022-02-14T04:18:01.537Z
`EXPORT CARDANO_NODE_SOCKET_PATH=/home/user/cardnao/db/socket` How do i know `/home/user/cardnao/db/socket` With what I have to replace this with?
arunwebber
CC BY-SA 4.0
2022-02-11T19:20:16.280Z
2022-02-11T19:20:16.280Z
zhekson
<p>I am executing the following query and then I am getting the following error.</p>
<p>The query I am executing.</p>
<pre><code>cardano-cli query utxo --address $(cat payment.addr) --testnet-magic 1097911063
</code></pre>
<p>And the error I am getting.</p>
<pre><code>Command failed: query utxo  Error: Error while looking up environment variable: CARDANO_NODE_SOCKET_PATH  Error: &quot;CARDANO_NODE_SOCKET_PATH&quot;
</code></pre>
<p>How do i debug this?</p>

<cardano-node>
How to setup carndano node-socket?
# How to setup carndano node-socket?

(Asked by: username_0 on 2022-02-11)

I am executing the following query and then I am getting the following error.
The query I am executing.
cardano-cli query utxo --address $(cat payment.addr) --testnet-magic 1097911063

And the error I am getting.
Command failed: query utxo  Error: Error while looking up environment variable: CARDANO_NODE_SOCKET_PATH  Error: "CARDANO_NODE_SOCKET_PATH"

How do i debug this?

**Tags:** cardano-node

---

## 1 answers

### Answer by username_1 on 2022-02-11. Score: 3 | Accepted answer

1. Ensure that `cardano-node` is running.
2. open a new terminal window, and enter `nano ~/.bashrc`
3. Scroll to the bottom of the file and add the following line:

`EXPORT CARDANO_NODE_SOCKET_PATH=/home/user/cardnao/db/socket` (or whatever the path is to the socket in your `db` folder)

4. Save the file and exit, then in the same terminal window, type: `source ~/.bashrc` and hit enter.
5. Now things should work. To check if the socket path is recognized, run:

`cardano-cli query tip --testnet-magic 1097911063`, and you should receive a sync status update. Comment if you're still getting an error.

> **Comments:**
> **username_0**: How do i know the path of socket?  
> **username_1**: when you run `cardano-node`, one of the mandatory flags is to specify a db folder. When you do that, a socket file is automatically created in that folder. CARDANO_NODE_SOCKET_PATH in your `~/.bashrc` folder must then be pointed to that socket (following the instructions above)  
> **username_0**: `EXPORT CARDANO_NODE_SOCKET_PATH=/home/user/cardnao/db/socket` How do i know `/home/user/cardnao/db/socket` With what I have to replace this with?  

---

