After you finish installing GHC and Cabal successfully, you can compile Cardano Node from source code.
To compile Cardano Node:
In a terminal window on the computer hosting your block-producing node, type the following command to navigate to the working directory that you created in the procedure Installing Glasgow Haskell Compiler and Cabal:
cd $HOME/git
To download Cardano Node source code, type:
git clone https://github.com/IntersectMBO/cardano-node.gitcd cardano-nodegit fetch --all --recurse-submodules --tags
To switch the repository that you downloaded to your local computer in step 2 to the latest tagged commit, type:
git checkout $(curl -s https://api.github.com/repos/IntersectMBO/cardano-node/releases/latest | jq -r .tag_name)
Typing a dollar sign ("$") before a command in parentheses refers to the output of the command in parentheses. For example, using a Web browser you can navigate to the above URL https://api.github.com/repos/IntersectMBO/cardano-node/releases/latest to display the data that the curl
command retrieves, and then confirm the value of the tag_name
attribute that the jq
command selects.
To adjust the project configuration to disable optimization and set the recommended compiler version, type the following command where
<GHCVersionNumber>
is the GHC version that you set in the procedure Installing Glasgow Haskell Compiler and Cabal:
cabal updatecabal configure -O0 -w ghc-<GHCVersionNumber>
To produce executable
cardano-node
andcardano-cli
binaries, type:
cabal build allcabal build cardano-cli
Depending on the processing power of your computer, the build process requires about 20 minutes to complete.
To copy the
cardano-node
andcardano-cli
binaries that you produced in step 7 into the/usr/local/bin
directory, type:
sudo cp -p "$(./scripts/bin-path.sh cardano-node)" /usr/local/bin/cardano-nodesudo cp -p "$(./scripts/bin-path.sh cardano-cli)" /usr/local/bin/cardano-cli
To confirm that the version installed on your computer matches the latest release available in the Cardano Node GitHub repository, type:
cardano-node --versioncardano-cli --version
On each computer hosting a relay node for your stake pool, repeat steps 1 to 8
Last updated