Building the Cardano node and tools from input-output-hk/cardano-node including all its dependencies.
this will only work if you have the required system dependencies installed. (see below)
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
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 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)
stack
:$
stack test
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
on a Linux/Debian system:
sudo apt install libsystemd-dev pkg-config
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