4. Setting up the Cardano node directory

In this part of the guide, we will be downloading, and setting up the Cardano node directory, in order to prepare it for the next step, where we will be setting up the block-producing and relay nodes.

4.1 Download the Cardano Haskell node source code with the following command

git clone https://github.com/input-output-hk/cardano-node.git

4.12 Now get into the cardano-node folder

cd cardano-node

4.2 Let's now select the version we would like to use, and let Cabal build it

4.21 Execute the following commands in order to get a list of all the available versions

git fetch --all --tags
git tag

Like you can see on the above picture, at the time of writing this, we are at the "1.15.1" version. "pioneer-new-address" is a special version, which you don't need to use.

4.22 Execute the following command, make sure to replace "yourversion" with the pioneer version you would like to use

git checkout tags/yourversion

4.23 Install Libsodium

git clone https://github.com/input-output-hk/libsodium​
cd libsodium
​git checkout 66f017f1
sudo make install​
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"​

4.24 Now prepare a book, because the following commands are going to take an awful amount of time to execute​

Make sure to be in the cardano-node directory, while executing the below command.

cabal build all

4.3 Copy the newest versions of the Cardano node, and the Cardano CLI to the ~/.local/bin/ directory with the following commands

cp -p dist-newstyle/build/x86_64-linux/ghc-8.6.5/cardano-node-1.15.1/x/cardano-node/build/cardano-node/cardano-node ~/.local/bin/
cp -p dist-newstyle/build/x86_64-linux/ghc-8.6.5/cardano-cli-1.15.1/x/cardano-cli/build/cardano-cli/cardano-cli ~/.local/bin/

4.4 Check if everything was installed correctly in your ~/.local/bin file with this command

ls ~/.local/bin

Questions? Ask them in our Telegram chat!