Skip to content

CodiePP/cardano4all

Repository files navigation

cardano4all

Building the Cardano node and tools from input-output-hk/cardano-node including all its dependencies.

Quick setup and build on Linux

this will only work if you have the required system dependencies installed. (see below)

1 checkout the dependencies

this is only necessary for a fresh checkout of this repo:

$ git submodule update --init --remote

otherwise, update the submodules to the revision defined in the commit:

$ git submodule update

2 build dependencies

cd ext/input-output-hk_libsodium.git
mkdir -p OUT
./autogen.sh 
./configure --prefix=$(pwd)/OUT
make -j 8
make check
make install

set the variable PKG_CONFIG_PATH to point to the locally build libsodium so that it will be found when linking the Haskell node.

export PKG_CONFIG_PATH=$(pwd)/ext/input-output-hk_libsodium.git/OUT/lib/pkgconfig:$PKG_CONFIG_PATH

And, set the path to the newly built libsodium libraries for the linker:

export LD_LIBRARY_PATH=$(pwd)/ext/input-output-hk_libsodium.git/OUT/lib:$LD_LIBRARY_PATH

3 build

3 I) stack: $ stack build cardano-node:exe:cardano-node --copy-bins 3 II) patchelf --replace-needed libsodium.so.23 $(pwd)/ext/input-output-hk_libsodium.git/OUT/lib/libsodium.so.23 bin/cardano-node (this changes the "rpath" in the binary to the local libsodium)

4 run test suite

  1. stack: $ stack test

Alternative: building using cabal

cabal build cardano-cli
cabal build cardano-node

cabal install --install-method=copy --overwrite-policy=always --installdir=./bin/ cardano-cli
cabal install --install-method=copy --overwrite-policy=always --installdir=./bin/ cardano-node

System setup Linux

on a Linux/Debian system:

sudo apt install libsystemd-dev pkg-config

System setup Mac OSX

many dependencies can be installed using brew, e.g. brew install pkg-config

The files "stack.yaml" needs to be adapted:

  • remove all references to systemd
  • disable compiling using nix: enable: false

System setup Windows