Set up your platform:
You will need:
An x86 host (AMD or Intel), Virtual Machine or AWS instance with at least 2 cores, 4GB of RAM and at least 10GB of free disk space;
A recent version of Linux, not Windows or MacOS – this will help us isolate any issues that arise.
Make sure you are on a network that is not firewalled. In particular, we will be using TCP/IP port 3000 and 3001 by default to establish connections with other nodes, so this will need to be open.
We need the following packages and tools on our Linux system to download the source code and build it:
the version control system
C++ support for
developer libraries for the the arbitrary precision library
developer libraries for the compression library
developer libraries for
developer libraries for
ncurses compatibility libraries,
the Haskell build tool
the GHC Haskell compiler.
If we are using an AWS instance running Amazon Linux AMI 2 (see the AWS walk-through for how to get such an instance up and running)or another CentOS/RHEL based system, we can install these dependencies as follows:
sudo yum update -ysudo yum install git gcc gcc-c++ tmux gmp-devel make tar wget -ysudo yum install zlib-devel libtool autoconf -ysudo yum install systemd-devel ncurses-devel ncurses-compat-libs -y
For Debian/Ubuntu use the following instead:
sudo apt-get update -ysudo apt-get install build-essential pkg-config libffi-dev libgmp-dev -ysudo apt-get install libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev -ysudo apt-get install make g++ tmux git jq wget libncursesw5 libtool autoconf -y
If you are using a different flavor of Linux, you will need to use the package manager suitable for your platform instead of
apt-get, and the names of the packages you need to install might differ.
wget https://downloads.haskell.org/~cabal/cabal-install-126.96.36.199/cabal-install-188.8.131.52-x86_64-unknown-linux.tar.xztar -xf cabal-install-184.108.40.206-x86_64-unknown-linux.tar.xzrm cabal-install-220.127.116.11-x86_64-unknown-linux.tar.xz cabal.sigmkdir -p ~/.local/binmv cabal ~/.local/bin/
Verify that .local/bin is in your PATH
If .local/bin is not in the PATH, you need to add the following line to your
Navigate to your home folder:
Open your .bashrc file with nano text editor
Go to the bottom of the file and add the following lines
You need to restart your server or source your .bashrc file
Above instructions install Cabal version
18.104.22.168. You can check the version by typing
wget https://downloads.haskell.org/~ghc/8.6.5/ghc-8.6.5-x86_64-deb9-linux.tar.xztar -xf ghc-8.6.5-x86_64-deb9-linux.tar.xzrm ghc-8.6.5-x86_64-deb9-linux.tar.xzcd ghc-8.6.5./configuresudo make installcd ..
git clone https://github.com/input-output-hk/libsodiumcd libsodiumgit checkout 66f017f1./autogen.sh./configuremakesudo make installexport LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
cdgit clone https://github.com/input-output-hk/cardano-node.git
This creates the folder
cardano-node and downloads the latest source code.
After the download has finished, we can check its content by
We change our working directory to the downloaded source code folder:
For reproducible builds, we should check out a specific release, a specific "tag". For the Shelley Testnet, we will use tag
1.19.1, which we can check out as follows:
git fetch --all --tagsgit taggit checkout tags/1.19.1
Now we build and install the node with
cabal, which will take a couple of minutes the first time you do a build. Later builds will be much faster, because everything that does not change will be cached.
cabal build all
Now we can copy the executables files to the .local/bin directory
cp -p dist-newstyle/build/x86_64-linux/ghc-8.6.5/cardano-node-1.19.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.19.1/x/cardano-cli/build/cardano-cli/cardano-cli ~/.local/bin/
cd cardano-nodegit fetch --all --tagsgit taggit checkout tags/<the-tag-you-want>cabal install cardano-node cardano-cli
Note: It might be necessary to delete the
db-folder (the database-folder) before running an updated version of the node.