I am trying to get a cardano node started on a Mac with the new M1 chip. Ive looked through the Installing a Cardano-node walk-through and found that they specify that the Mac install is for Intel chips only. They do say that they are working on a guide for the M1 chip, so this leads me to believe that it is possible. Does anybody have a lead or suggestions as to what the different steps might be?
I also do have Macbook with M1 chip and I use precompiled binaries that ship with Daedalus. It will save you a lot of trouble unless you really want to build it from source.
After you've installed your Daedalus you can sym link cardano-cli binary that comes with it and export
CARDANO_NODE_SOCKET_PATH env variable and it should be ready to use.
For example if you want to sym link cardano-cli for testnet Daedauls you'd do this:
ln -s /Applications/Daedalus Testnet.app/Contents/MacOS/cardano-cli /usr/local/bin/cardano-cli
and to export
CARDANO_NODE_SOCKET_PATH env variable you would do this:
export CARDANO_NODE_SOCKET_PATH=~/Library/Application\ Support/Daedalus\ Testnet/cardano-node.socket
Once you do this, and sync your node (by running you wallet) you should be ready to submit transactions and or query blockchain.
seems something simillar is necessary to do after
cabal configure.... Mac doesn't have apt command, but I would assume you can get those libraries with homebrew
sudo apt install llvm-9
sudo apt install clang-9 libnuma-dev
sudo ln -s /usr/bin/llvm-config-9 /usr/bin/llvm-config
sudo ln -s /usr/bin/opt-9 /usr/bin/opt
sudo ln -s /usr/bin/llc-9 /usr/bin/llc
sudo ln -s /usr/bin/clang-9 /usr/bin/clang
So I was able to compile cardano-node on M1, main trick to install llvm + add some cabal options, before building.
To install llvm you will need:
brew install llvm
Additionally you need to set cabal options after
cabal configure --with-compiler=ghc-8.10.7
echo "package trace-dispatcher" >> cabal.project.local
echo " ghc-options: -Wwarn" >> cabal.project.local
echo "" >> cabal.project.local
I got hint from here: https://github.com/input-output-hk/cardano-node/issues/3395
Additionally I updated cardano-node instalation manual on https://developers.cardano.org/docs/get-started/installing-cardano-node, but it is not merged yet, here you can find full manual what I hope will be merged soon:
Try this guide. Worked for me using Debian in a VM
Unlike the Daedalus wallet these are arm64 binaries which are faster
cardano-cli: ELF 64-bit LSB executable, ARM aarch64
cardano-node: ELF 64-bit LSB executable, ARM aarch64
Though, did you tried installing the node anyway ? I've been trying and it stops at the
cabal build all commands, here's the error :
[3 of 3] Compiling Criterion.Measurement ( src/Criterion/Measurement.hs, dist/build/Criterion/Measurement.o, dist/build/Criterion/Measurement.dyn_o )
error: Unsupported OS/architecture/compiler!
55 | #error Unsupported OS/architecture/compiler!
#error Unsupported OS/architecture/compiler!
1 error generated.
`gcc' failed in phase `C Compiler'. (Exit code: 1)
cabal: Failed to build criterion-measurement-0.1.2.0 (which is required by
test:cardano-api-test from cardano-api-1.30.1). See the build log above for
Using Rosetta doesn't work either, an error occurs, not the same that without Rosetta :
error: unrecognized instruction mnemonic, did you mean: eret, ret?
15 | retq
<no location info>: error:
Error running clang! you need clang installed to use the LLVM backend
(or GHC tried to execute clang incorrectly)
`clang' failed in phase `Clang (Assembler)'. (Exit code: 1)
Although I have installed llvm... I am still trying to figure how to go through all this but I don't have plenty of times
I have created an elegant solution where you can run cardano-cli from any network easily.
Firstly, download preview and pre-prod here:
Download mainnet here:
Once you have done this navigate to
sudo create 3 new files with the following names and shell script inside it.
export CARDANO_NODE_SOCKET_PATH=~/Library/Application\ Support/Daedalus\ Preview/cardano-node.socket
/Applications/Daedalus\ Preview.app/Contents/MacOS/cardano-cli "$@"
export CARDANO_NODE_SOCKET_PATH=~/Library/Application\ Support/Daedalus\ Pre-Prod/cardano-node.socket
/Applications/Daedalus\ Pre-Prod.app/Contents/MacOS/cardano-cli "$@"
export CARDANO_NODE_SOCKET_PATH=~/Library/Application\ Support/Daedalus\ Mainnet/cardano-node.socket
/Applications/Daedalus\ Mainnet.app/Contents/MacOS/cardano-cli "$@"
Note the "@" will take all the arguments passed to it and pass it onto the real cardano-cli.
Make sure to give them execution permissions
sudo chmod +x /usr/local/bin/cardano-cli-preview
sudo chmod +x /usr/local/bin/cardano-cli-preprod
sudo chmod +x /usr/local/bin/cardano-cli-mainnet
Now you can simply call cardano-cli-preview to connect to the preview network whenever you want, or call cardano-cli-preprod to connect to preproduction and cardano-cli-mainnet for the mainnet.
To test each of these you can run the following commands
cardano-cli-preview query tip --testnet-magic 2
cardano-cli-preprod query tip --testnet-magic 1
cardano-cli-mainnet query tip --mainnet