Building the node using Nix
Nix is a purely functional, cross-platform package manager for Linux and Unix systems. It is the package manager of choice for IOHK's internal development teams, and thus the recommended method for building a Cardano node to run on your machine.
Note: The following instructions assume you are using Linux and have curl installed. See the supported platforms page for more details about supported platforms for the Shelley testnet.
- Download and install the Nix package manager by running the following commands from a terminal:
curl -L https://nixos.org/nix/install -o install-nix.shchmod +x ./install-nix.sh
Create a file with name
nix.confand add the following into the file:
extra-sandbox-paths = /etc/nsswitch.conf /etc/protocols substituters = https://iohk.cachix.org https://hercules-ci.cachix.org https://cache.nixos.org/ https://cache.nixos.org https://hydra.iohk.io https://cache.nixos.org/ trusted-substituters = trusted-public-keys = iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= hercules-ci.cachix.org-1:ZZeDl9Va+xe9j+KqdzoBZMFJHVQ42Uu/c/1/KMC5Lw0= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
./install-nix.sh --daemon --nix-extra-conf-file nix.conf
Follow the instructions presented as part of the Nix installation process. Ensure that you give the
install-nix.shfile executable permissions:
$ chmod +x install-nix.sh
Once Nix is installed, open a new
nix-shellsession and enter the following commands, which will clone the Cardano node GitHub repository, open the node file directory, build the node itself, and then run it:
git clone https://github.com/input-output-hk/cardano-nodecd cardano-nodenix-build -A scripts.testnet.node -o testnet-node./ff-node-local
Please be aware that the process of building the node may take some time, possibly several hours.
You should now have a Cardano node running on your machine, connected to the Shelley testnet.