-
-
Save ilyar/49968703823f8f70ea33efa1d8ed2190 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash | |
######################################### | |
# Daedalus Wallet for the Cardano Testnet | |
# Download https://developers.cardano.org/en/testnets/cardano/get-started/wallet/ | |
# Run Daedalus for Testnet | |
# Create var CARDANO_NODE_SOCKET_PATH | |
export CARDANO_NODE_SOCKET_PATH=$(ps ax | grep -v grep | grep cardano-wallet | grep testnet | sed -E 's/(.*)node-socket //') | |
# Check var it must be path for file of node socket and not empty | |
echo $CARDANO_NODE_SOCKET_PATH | |
# Create alias cardano-cli via docker | |
alias cardano-cli="docker run --rm -it -u $(id -u):$(id -g) -v "$(pwd)":/data -w /data -v "$CARDANO_NODE_SOCKET_PATH":/node.socket -e CARDANO_NODE_SOCKET_PATH=/node.socket --entrypoint cardano-cli inputoutput/cardano-node" | |
# Check connect if yor run Daedalus for Testnet | |
cardano-cli get-tip --testnet-magic 1097911063 | |
######################################### | |
# Daedalus Wallet for the Cardano Mainnet | |
# Download https://daedaluswallet.io/en/download/ | |
# Run Daedalus for Mainnet | |
# Create var CARDANO_NODE_SOCKET_PATH | |
export CARDANO_NODE_SOCKET_PATH=$(ps ax | grep -v grep | grep cardano-wallet | grep mainnet | sed -E 's/(.*)node-socket //') | |
# Check var it must be path for file of node socket and not empty | |
echo $CARDANO_NODE_SOCKET_PATH | |
# Create alias cardano-cli via docker | |
alias cardano-cli="docker run --rm -it -u $(id -u):$(id -g) -v "$(pwd)":/data -w /data -v "$CARDANO_NODE_SOCKET_PATH":/node.socket -e CARDANO_NODE_SOCKET_PATH=/node.socket --entrypoint cardano-cli inputoutput/cardano-node" | |
# Check connect if yor run Daedalus for Mainnet | |
cardano-cli get-tip --mainnet |
@rae89 If cardano-cli is bin see https://gist.github.com/ilyar/09eda2bb01545296aa9e1351b8218086#file-use-daedalus-socket-cardano-cli-sh
Or specify exactly how you create the container? You probably need to set up an environment variable.
It didn't work in OSX. The socket get's mounted into the container and I can see it the filesystem when executing ls. Unfortunately, I end up with a cardano-cli: Network.Socket.connect: <socket: 11>: does not exist (Connection refused) error.
@leonfs maybe Daedalus not running
# Check var it must be path for file of node socket and not empty
echo $CARDANO_NODE_SOCKET_PATH
Thanks @ilyar. Unfortunately, is not working. When I use the native cardano-cli
, I can connect without problems. The OSX Docker integration might be messing things up.
@leonfs for OSX use sed -E
insted sed -r
i'm updated script
Thanks for your reply @ilyar. The path to the socket was fine, even before your update to the script. I think the challenge in OSX is all the layers that Docker in Mac adds. I can see the socket file within the container, mounted from the path found by your script. Unfortunately, when trying to connect using the client, the connection always fails. I resolved to use a native OSX binary, using the same socket I was mounting to the Docker container. That worked. Still puzzled about the real cause behind not working with Docker. Maybe, someone one day will add some light to the issue.
cardano-cli: Network.Socket.connect: <socket: 11>: does not exist (Connection refused)%
I am running into the same problem.
I believe this is the docker-for-mac issue that was only worked on to get ssh-agent forwarding working.
Hi Ilyar,
thanks for the gist, work like a charme. Do you have an idea about correct alias for submit-api (inputoutput/cardano-submit-api)?
I miss something alias cardano-submit-api="docker run -v /data -e NETWORK=mainnet inputoutput/cardano-submit-api"
@uArtApe I haven't had a chance to learn the submit-api (inputoutput/cardano-submit-api) yet
Thanks for the reply. As soon as I managed to run it with docker I let you know.
Hello! I am able to get the cardano-cli to work with the docker script you have available. But I did run in to the following error when I run the command
cardano-cli get-tip --mainnet
Error while looking up environment variable: CARDANO_NODE_SOCKET_PATH Error: "CARDANO_NODE_SOCKET_PATH"
Any idea what could be causing this issue?