Skip to content

Instantly share code, notes, and snippets.

@ilyar
Last active October 24, 2022 14:19
Show Gist options
  • Save ilyar/49968703823f8f70ea33efa1d8ed2190 to your computer and use it in GitHub Desktop.
Save ilyar/49968703823f8f70ea33efa1d8ed2190 to your computer and use it in GitHub Desktop.
Use Daedalus socket for cardano-cli via Docker for Mainnet or Testnet the Cardano
#!/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
@uArtApe
Copy link

uArtApe commented Feb 3, 2022

Thanks for the reply. As soon as I managed to run it with docker I let you know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment