-
Notifications
You must be signed in to change notification settings - Fork 7
building the node on windows
This document explains how to build a DEVELOPMENT version of the cardano-node.
Note that this is not for building a PRODUCTION version of the node.
To start building on Windows, you will need to install and configure specific tools outlined below. We recommend using chocolatey, which provides the choco command to install these tools.
You can run all the instructions that invoke choco in PowerShell with root privileges. We recommend installing and using git-bash for development purposes, which is git when installed with choco install git.
The recommended way is to run the following command in PowerShell:
choco install --version 8.10.7 ghcchoco install pkgconfigliteYou will first need to install vcpkg to proceed with libsodium library installation (which is the next step).
For this, use git(which you can also install using choco) and follow these
instructions.
You can now install libsodium with the following command:
./vcpkg install --triplet x64-windows libsodiumTo find system dependencies like libsodium, cabal uses pkg-config. On Windows, you will need to create the libsodium.pc description file in a correct
directory.
In one of the paths reported by:
pkg-config --variable pc_path pkg-configcreate libsodium.pc file, which contains:
libdir=VCPKG_PATH/installed/x64-windows/bin
includedir=VCPKG_PATH/installed/x64-windows/include
Name: libsodium
VERSION: LIBSODIUM_VERSION
Description: libsodium library
Cflags: -I${includedir}/sodium
Libs: -L${libdir} -llibsodium
Note that you need to replace
VCPKG_PATHwith the absolute path, where you usevcpkg, andLIBSODIUM_VERSIONwith the version number oflibsodiumwhich was installed on your system. Please verify that the paths above containlibsodium.dllfile and headers.
Also, you cannot use
prefix=in thelibsodium.pcfile. This might be changed for some other directory,pkg-configprovides a switch to use the providedprefix, but there is no way to instructcabalto do so.
Go to the directory, where you cloned the cardano-node repository and add the command below
to your cabal.project.local file (if you don't already have it, create one):
max-backjump: 5000
reorder-goals: True
package cardano-crypt-praos
flags: -external-libsodium-vrf
extra-lib-dirs: "VCPKG_PATH\\installed\\x64-windows\\bin"
extra-include-dirs: "VCPKG_PATH\\installed\\x64-windows\\include"
The final step is to add VCPKG_PATH/installed/x64-windows/bin to the PATH
variable. Since we are using git-bash, you can do this with:
export PATH="VCPKG_PATH/installed/x64-windows/bin:${PATH}"
Remember to substitute VCPKG_PATH with the real path.
You can now build the node with:
cabal build --builddir /c/dist exe:cardano-nodeNote: using
--builddir /c/distwith a succinct directory protects you from exceeding the maximal path size on Windows (which is a limitation of the linker rather thanghcitself).
You can now verify whether the node runs:
cabal run --builddir /c/dist exe:cardano-node -- run --helpThe cardano-node wiki has moved. Please go to (https://github.com/input-output-hk/cardano-node-wiki/wiki) and look for the page there.