Last active
October 24, 2022 14:19
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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"