Running cardano-node on Windows 10

I’m running a perfect working cardano-node with Ubuntu on VirtualBox which eats a lot of memory and CPU so i wanted to try a native cardano-node on Windows 10.

I’m able to run it via command line using cardano-node run but I’m not sure how to do stuff like cardano-cli query utxo --mainnet --address xxxxx which i can easily do with my VM. I get this error when i run it:

Command failed: query utxo Error: Error while looking up environment variable: CARDANO_NODE_SOCKET_PATH Error: "CARDANO_NODE_SOCKET_PATH"

So how do you set the --socket-path in Windows? Is there any Windows tutorial online?

you will need to export the socket path, but I don’t know how it’s working on windows…

export CARDANO_NODE_SOCKET_PATH=/home/user/cardano/db/socket (replace /home/user/cardano/db/socket with your path for socket)

after that login again or type source ~/.bashrc to reload the changes

I know how to do it in Linux but I don’t know how to do it in Windows.

try this, I don’t know if it will work but you can try it

Yeah already tried but it’s not working. It might be with the way the node.socket is implemented on Windows. I just don’t know how to do that. I cannot find any info about it.

buth, the node is running? is synced? the socket is created?

It seems that the node uses the WinAPI function CreateNamedPipe, which requires the name to have the format \\.\pipe\PIPENAME

See: CreateNamedPipeA function (winbase.h) - Win32 apps | Microsoft Docs

I can start a node with this command in Git Bash on Windows 10:

./cardano-node.exe run --topology testnet-config/testnet-topology.json --config testnet-config/testnet-config.json --database-path db --socket-path ‘\\.\pipe\node.socket’ --port 3001

I can then also run cardano-cli in Git Bash:

$ CARDANO_NODE_SOCKET_PATH=’\\.\pipe\node.socket’ ./cardano-cli get-tip --testnet-magic 1097911063
“hash”: “3f9b91d4c29249e84d46064d50f0638b6927ebb192b8f57d53beee7d0e640f33”,
“slot”: 53137099,
“block”: 3401750

I hope this helps,