<p>Daedalus runs its own instance of <code>cardano-node</code> under the hood, so by installing and using <code>cardano-cli</code>, one can connect to this node and interact with the blockchain directly.</p>
<ol>
<li>Start Daedalus, and wait until it reaches the wallet home screen; the <code>cardano-node.socket</code> file is only made available after the <code>cardano-node</code> has started fully.</li>
<li>Use <code>cardano-cli</code>: [<a href="https://github.com/input-output-hk/cardano-node#cardano-cli" rel="noreferrer">Documentation</a>]</li>
</ol>
<h3>Ubuntu Example (Bash)</h3>
<pre><code>export CARDANO_NODE_SOCKET_PATH=/home/$USER/.local/share/Daedalus/mainnet/cardano-node.socket
cardano-cli query tip --mainnet
</code></pre>
<h3>MacOS Example</h3>
<pre><code>export CARDANO_NODE_SOCKET_PATH=~/Library/Application\ Support/Daedalus\ Mainnet/cardano-node.socket
cardano-cli query tip --mainnet
</code></pre>
<h3>Windows Example (PowerShell)</h3>
<p>On Windows, a socket file isn't used, instead we specify the pipe used, which has a different name every time Daedalus runs.</p>
<pre><code>cd &quot;C:\Program Files\Daedalus Mainnet&quot;
$ENV:CARDANO_NODE_SOCKET_PATH = (Get-ChildItem \\.\pipe\ | Where-Object {$_.name -like &quot;cardano-node*&quot;}).FullName
.\cardano-cli.exe query tip --mainnet
</code></pre>

CC BY-SA 4.0
2021-10-15T16:24:09.153Z
`$env:CARDANO_NODE_SOCKET_PATH = [System.IO.Directory]::GetFiles("\\.\\pipe\\") | where { $_ -like "*cardano-node*" }`
IUnknown
CC BY-SA 4.0
2021-05-04T02:20:37.883Z
Would be nice to have Windows and MacOS examples too, at least the default socket paths
Ben NOBLE
CC BY-SA 4.0
2021-05-04T10:02:11.803Z
Ah I forgot how awkward it was to get the Windows named pipe :D
Eddy Schauman-Haigh
CC BY-SA 4.0
2021-05-05T02:28:28.053Z
@soccer193 Trying it via PowerShell doesn't appear to work. Deadalus is running, node fully sync'd.  "Shelley command failed: query tip  Error: Error while looking up environment variable: CARDANO_NODE_SOCKET_PATH  Error: "CARDANO_NODE_SOCKET_PATH""  

If I run:

    Get-ChildItem \\.\pipe\ | Where-Object {$_.name -like "cardano-node-mainnet*"}    

It returns nothing.  Currently using PowerShell 7.1.3
Chad Carter
CC BY-SA 4.0
2021-05-05T02:54:31.247Z
Hey @ChadCarter, left you a response in the 'Cardano' chat room on the right of this page.
soccer193
CC BY-SA 4.0
2021-05-06T12:14:28.790Z
@soccer193 I posted a response in the chat the other day. If you have any ideas on where the socket path should be in Windows, I'd love to know.
Chad Carter
CC BY-SA 4.0
2021-05-08T13:55:34.197Z
I'm no powershell expert. It seems simply calling Get-ChildItem \\.\pipe\ doesn't return anything related to cardano.  However, when I downloaded the sysinternals PipeList and ran the 64bit version ( https://download.sysinternals.com/files/PipeList.zip ) I saw a ton more named pipe entries including one called "cardano-node-mainnet.18404.5".  So I ran $ENV:CARDANO_NODE_SOCKET_PATH = "\\.\pipe\cardano-node-mainnet.18404.5"      followed by the cli query line and got the result I was after.  What can we do to get PS to see it?
Chad Carter
CC BY-SA 4.0
2021-05-04T01:16:59.177Z
2021-10-03T01:04:38.747Z
2021-10-03T01:04:38.747Z
soccer193
<p>If you really have to use <strong>standard Windows CMD</strong> (instead of PowerShell) we first need to get the PID of the right &quot;Daedalus Mainnet&quot; process (there are multiple) eg 12345, then set CARDANO_NODE_SOCKET_PATH eg:</p>
<pre><code>cd &quot;C:\Program Files\Daedalus Mainnet&quot;
set CARDANO_NODE_SOCKET_PATH=\\.\pipe\cardano-node-mainnet.12345.0
</code></pre>
<p>(Swap the 12345 with your PID value, see below. You might need to change the .0 too)</p>
<p>Then run your cardano-cli commands eg</p>
<pre><code>cardano-cli query tip --mainnet
</code></pre>
<p>This should then work until you restart Daedalus.</p>
<p>Note: make sure Daedalus is fully synced before running cardano-cli</p>
<p><em>To get the PID manually via Task manager:</em></p>
<p>I see 4 processes named &quot;Daedalus Mainnet&quot; under the Processes tab in Windows11. Select the one with extra details after the name eg &quot;(4.8.0#23001)&quot; and right-click &quot;Go To Details&quot;, note the PID eg 12345.</p>
<p><em>To get the PID via PowerShell, run:</em></p>
<pre><code>(Get-ChildItem \\.\pipe\ | Where-Object {$_.name -like &quot;cardano-node*&quot;}).FullName
</code></pre>
<p><em>(Thanks to soccer193 and Tend for this PS snippet)</em></p>

CC BY-SA 4.0
2022-02-25T06:26:45.210Z
2022-02-25T06:26:45.210Z
MC_Brisbane - JUST Pool
<p>Daedalus is a full node wallet application, but can I use the full node to query the ledger?</p>

<daedalus><cardano-cli><cardano-node>
Can Daedalus be used to query the blockchain, like a passive node?
# Can Daedalus be used to query the blockchain, like a passive node?

(Asked by: username_0 on 2021-05-04)

Daedalus is a full node wallet application, but can I use the full node to query the ledger?

**Tags:** daedalus, cardano-cli, cardano-node


---

## 2 answers

### Answer by username_0 on 2021-05-04. Score: 16

Daedalus runs its own instance of `cardano-node` under the hood, so by installing and using `cardano-cli`, one can connect to this node and interact with the blockchain directly.

1. Start Daedalus, and wait until it reaches the wallet home screen; the `cardano-node.socket` file is only made available after the `cardano-node` has started fully.
2. Use `cardano-cli`: [[Documentation](https://github.com/input-output-hk/cardano-node#cardano-cli)]

### Ubuntu Example (Bash)

```
export CARDANO_NODE_SOCKET_PATH=/home/$USER/.local/share/Daedalus/mainnet/cardano-node.socket
cardano-cli query tip --mainnet

```

### MacOS Example

```
export CARDANO_NODE_SOCKET_PATH=~/Library/Application\ Support/Daedalus\ Mainnet/cardano-node.socket
cardano-cli query tip --mainnet

```

### Windows Example (PowerShell)

On Windows, a socket file isn't used, instead we specify the pipe used, which has a different name every time Daedalus runs.

```
cd "C:\Program Files\Daedalus Mainnet"
$ENV:CARDANO_NODE_SOCKET_PATH = (Get-ChildItem \\.\pipe\ | Where-Object {$_.name -like "cardano-node*"}).FullName
.\cardano-cli.exe query tip --mainnet

```

> **Comments:**
> **username_2**: Would be nice to have Windows and MacOS examples too, at least the default socket paths  
> **username_3**: Ah I forgot how awkward it was to get the Windows named pipe :D  
> **username_4**: @username_0 Trying it via PowerShell doesn't appear to work. Deadalus is running, node fully sync'd.  "Shelley command failed: query tip  Error: Error while looking up environment variable: CARDANO_NODE_SOCKET_PATH  Error: "CARDANO_NODE_SOCKET_PATH""    If I run:      Get-ChildItem \\.\pipe\ | Where-Object {$_.name -like "cardano-node-mainnet*"}      It returns nothing.  Currently using PowerShell 7.1.3  
> **username_0**: Hey @username_4, left you a response in the 'Cardano' chat room on the right of this page.  
> **username_4**: @username_0 I posted a response in the chat the other day. If you have any ideas on where the socket path should be in Windows, I'd love to know.  
> **username_4**: I'm no powershell expert. It seems simply calling Get-ChildItem \\.\pipe\ doesn't return anything related to cardano.  However, when I downloaded the sysinternals PipeList and ran the 64bit version ( https://download.sysinternals.com/files/PipeList.zip ) I saw a ton more named pipe entries including one called "cardano-node-mainnet.18404.5".  So I ran $ENV:CARDANO_NODE_SOCKET_PATH = "\\.\pipe\cardano-node-mainnet.18404.5"      followed by the cli query line and got the result I was after.  What can we do to get PS to see it?  
> **username_1**: `$env:CARDANO_NODE_SOCKET_PATH = [System.IO.Directory]::GetFiles("\\.\\pipe\\") | where { $_ -like "*cardano-node*" }`  

---

### Answer by username_5 on 2022-02-25. Score: 0

If you really have to use **standard Windows CMD** (instead of PowerShell) we first need to get the PID of the right "Daedalus Mainnet" process (there are multiple) eg 12345, then set CARDANO\_NODE\_SOCKET\_PATH eg:

```
cd "C:\Program Files\Daedalus Mainnet"
set CARDANO_NODE_SOCKET_PATH=\\.\pipe\cardano-node-mainnet.12345.0

```

(Swap the 12345 with your PID value, see below. You might need to change the .0 too)

Then run your cardano-cli commands eg

```
cardano-cli query tip --mainnet

```

This should then work until you restart Daedalus.

Note: make sure Daedalus is fully synced before running cardano-cli

*To get the PID manually via Task manager:*

I see 4 processes named "Daedalus Mainnet" under the Processes tab in Windows11. Select the one with extra details after the name eg "(4.8.0#23001)" and right-click "Go To Details", note the PID eg 12345.

*To get the PID via PowerShell, run:*

```
(Get-ChildItem \\.\pipe\ | Where-Object {$_.name -like "cardano-node*"}).FullName

```

*(Thanks to username_0 and Tend for this PS snippet)*


---

