Last active
February 21, 2023 09:27
-
-
Save ilyar/09eda2bb01545296aa9e1351b8218086 to your computer and use it in GitHub Desktop.
Use Daedalus socket for cardano-cli 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 | |
# Install cardano-cli or use docker https://gist.github.com/ilyar/bf4c2346be1a74c50e488181986808fb | |
# | |
# Linux https://hydra.iohk.io/job/Cardano/cardano-node/cardano-node-linux/latest-finished | |
# Win64 https://hydra.iohk.io/job/Cardano/cardano-node/cardano-node-win64/latest-finished | |
# Macos https://hydra.iohk.io/job/Cardano/cardano-node/cardano-node-macos/latest-finished | |
# Extcact only cardano-cli into /usr/local/bin/cardano-cli | |
# Check | |
cardano-cli --version | |
######################################### | |
# 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 | |
# 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 | |
# Check connect if yor run Daedalus for Mainnet | |
cardano-cli get-tip --mainnet |
oh, I know what happened, on my macOS (Catalina 10.15.7) (I don't know if another version faces the same issue ), you change sed -r
to sed -E
. but thank you for your help
@hoanghnbk thank you
I checked for me (Linux) works both variants and updated script
cool! thank you and have a nice day!
I am having an issue after the step where I use "cardano-cli get-tip" I get an error
error: Found argument 'get-tip' which wasn't expected, or isn't valid in this context
USAGE:
cardano-cli [FLAGS] [OPTIONS] [SUBCOMMAND]
For more information try --help
However, the previous step did indeed provide the path to node socket. What am I doing wrong. Any thoughts?
@local:~$ cardano-cli version
cardano-cli 1.28.0 - linux-x86_64 - ghc-8.10
git rev bf71fe31459905df8573e6d3f3cfe85af6ab1c99
@local:~$ cardano-cli get-tip --help
Usage: cardano-cli get-tip (--mainnet | --testnet-magic NATURAL)
Get the tip of your local node's blockchain
Available options:
--mainnet Use the mainnet magic id.
--testnet-magic NATURAL Specify a testnet magic id.
-h,--help Show this help text
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
and out put of
sed --help
is :sed --help sed: illegal option -- - usage: sed script [-Ealn] [-i extension] [file ...] sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]