<p>Yes, it is possible.</p>
<p>First, you need to install <code>cardano-cli</code> binary (you can find it in the Hydra build system, depending on your OS which might be <a href="https://hydra.iohk.io/job/Cardano/cardano-node/cardano-node-linux/latest-finished" rel="noreferrer">Linux</a>, <a href="https://hydra.iohk.io/job/Cardano/cardano-node/cardano-node-win64/latest-finished" rel="noreferrer">Windows</a> or <a href="https://hydra.iohk.io/job/Cardano/cardano-node/cardano-node-macos/latest-finished" rel="noreferrer">Mac OS</a>.</p>
<p>After you have your <code>cardano-cli</code> installed, you now need to set your <code>CARDANO_NODE_SOCKET_PATH</code> environmental variable to the location of your <code>cardano-node</code> socket file that is being run by Daedalus.</p>
<p>This code snippet will do just that, extract the path to the socket file from the <code>cardano-wallet</code> instance.</p>
<p>Depending on the network, you will execute the following for <strong>testnet</strong>:</p>
<pre><code>export CARDANO_NODE_SOCKET_PATH=$(ps ax | grep -v grep | grep cardano-wallet | grep testnet | sed -r 's/(.*)node-socket //')

# Check var it must be path for file of node socket and not empty
echo $CARDANO_NODE_SOCKET_PATH
</code></pre>
<p>Or the following for <strong>mainnet</strong>:</p>
<pre><code># Create var CARDANO_NODE_SOCKET_PATH
export CARDANO_NODE_SOCKET_PATH=$(ps ax | grep -v grep | grep cardano-wallet | grep mainnet | sed -r 's/(.*)node-socket //')

# Check var it must be path for file of node socket and not empty
echo $CARDANO_NODE_SOCKET_PATH
</code></pre>
<p>After you have done that, you can now try to query the network using your <code>cardano-cli</code>, for <strong>testnet</strong>:</p>
<pre><code>$ cardano-cli get-tip --testnet-magic 1097911063
</code></pre>
<p>Or for <strong>mainnet</strong>:</p>
<pre><code>$ cardano-cli get-tip --mainnet
</code></pre>
<p>Source: <a href="https://gist.github.com/ilyar/09eda2bb01545296aa9e1351b8218086" rel="noreferrer">this useful gist</a></p>

CC BY-SA 4.0
2021-06-02T10:50:14.527Z
Could you expand some more on how to use this? It's not immediately clear to me from just looking at the Gist.
Valentin
CC BY-SA 4.0
2021-06-02T11:00:21.030Z
@ValentinWalter can you check now? I tried to elaborate it a little bit more.
Marek Mahut - StakeNuts
CC BY-SA 4.0
2021-06-23T04:28:36.813Z
I found on Mac OS that the sed -r option doesn't work, but using -E does.
marcel_g
CC BY-SA 4.0
2021-06-02T10:45:28.760Z
2021-06-02T10:59:54.347Z
2021-06-02T10:59:54.347Z
Marek Mahut - StakeNuts
<p>I want to do some transaction with custom metadata and was wondering if I have to install another instance of <code>cardano-node</code> or if it's possible to use the already installed version by Daedalus.</p>

<daedalus><cardano-node>
Using cardano-node installed by Daedalus as CLI?
# Using cardano-node installed by Daedalus as CLI?

(Asked by: username_0 on 2021-06-02)

I want to do some transaction with custom metadata and was wondering if I have to install another instance of `cardano-node` or if it's possible to use the already installed version by Daedalus.

**Tags:** daedalus, cardano-node

---

## 1 answers

### Answer by username_1 on 2021-06-02. Score: 6 | Accepted answer

Yes, it is possible.
First, you need to install cardano-cli binary (you can find it in the Hydra build system, depending on your OS which might be Linux, Windows or Mac OS.
After you have your cardano-cli installed, you now need to set your CARDANO_NODE_SOCKET_PATH environmental variable to the location of your cardano-node socket file that is being run by Daedalus.
This code snippet will do just that, extract the path to the socket file from the cardano-wallet instance.
Depending on the network, you will execute the following for testnet:
export CARDANO_NODE_SOCKET_PATH=$(ps ax | grep -v grep | grep cardano-wallet | grep testnet | sed -r 's/(.*)node-socket //')

# Check var it must be path for file of node socket and not empty
echo $CARDANO_NODE_SOCKET_PATH

Or the following for mainnet:
# Create var CARDANO_NODE_SOCKET_PATH
export CARDANO_NODE_SOCKET_PATH=$(ps ax | grep -v grep | grep cardano-wallet | grep mainnet | sed -r 's/(.*)node-socket //')

# Check var it must be path for file of node socket and not empty
echo $CARDANO_NODE_SOCKET_PATH

After you have done that, you can now try to query the network using your cardano-cli, for testnet:
$ cardano-cli get-tip --testnet-magic 1097911063

Or for mainnet:
$ cardano-cli get-tip --mainnet

Source: this useful gist

> **Comments:**
> **username_0**: Could you expand some more on how to use this? It's not immediately clear to me from just looking at the Gist.  
> **username_1**: @ValentinWalter can you check now? I tried to elaborate it a little bit more.  
> **username_2**: I found on Mac OS that the sed -r option doesn't work, but using -E does.  

---

