-
-
Save ilyar/09eda2bb01545296aa9e1351b8218086 to your computer and use it in GitHub Desktop.
#!/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 |
@PiotrNap Thanks for the comment, you can still try using docker https://gist.github.com/ilyar/49968703823f8f70ea33efa1d8ed2190#file-use-daedalus-socket-docker-cardano-cli-sh
Thanks @ilyar, I wanted to use my Daedalus Testnet node to just play around with the cardano-cli. But I'll try it out once I get more familiar with this.
Hey @ilyar, does this work on Linux only? I'm confused since you give the download paths for all 3 OS' but the rest of the steps reads like Linux instructions.
To be specific, I would like to use my Daedalus Mainnet installation on Win10 to be used in conjunction with the cardano-cli so I don't have to run and sync a separate node. Is that possible?
@Klobbinger for windows need POSIX simple way use Git-bash
I tried to run this srcript
ps ax | grep -v grep | grep cardano-wallet | grep mainnet | sed -r 's/(.*)node-socket //'
my mac return this. any one face this issue ?
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
@hoanghnbk please show out: sed --help
@hoanghnbk and debug:
ps ax | grep -v grep | grep cardano-wallet
out?
ps ax | grep -v grep | grep cardano-wallet | grep mainnet
out?
hi @ilyar it is the output for ps ax | grep -v grep | grep cardano-wallet | grep mainnet
:
cardano-wallet serve --shutdown-handler --port 49581 --database /Users/hoanghoang/Library/Application Support/Daedalus Mainnet/wallets --tls-ca-cert /Users/hoanghoang/Library/Application Support/Daedalus Mainnet/tls/server/ca.crt --tls-sv-cert /Users/hoanghoang/Library/Application Support/Daedalus Mainnet/tls/server/server.crt --tls-sv-key /Users/hoanghoang/Library/Application Support/Daedalus Mainnet/tls/server/server.key --token-metadata-server https://tokens.cardano.org --sync-tolerance 300s --mainnet --node-socket /Users/hoanghoang/Library/Application Support/Daedalus Mainnet/cardano-node.socket
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 ...]
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
Worked pretty well for me, thank you!
Just one little thing - I had to move libffi.7.dylib and libsodium.23.dylib to /usr/local/bin as well, as they couldn't been found upon executing
cardano-cli