This lesson describes how to install the Git client and Rust compiler. This allows you to clone the Jormungander repository (source code) and compile it to executable binaries on your computer.
Note: If you are not interested in compiling the executables from the open source code, you can skip to the next lesson and simply download the pre-compiled releases as you usually do with most commercial and free software.
A git client is able to talk with a git server in order to fetch the updates from the projects (repositories) but also fork the whole project or request to pull your own contribution back into the repository.
There are many git client implementations available for Windows systems, it’s your choice. In this guide we are going to use the client provided by https://git-scm.com/
Download the Setup package and install it on your computer. You can just accept the defaults or personalize things such as your preferred default editor, and how deep git is linked into your windows command line interface. It’s your choice.
Now open a command line interface (cmd) and change directory into your documents folder.
It’s a good idea to create a subfolder for all future gitprojects cloned to your local drive.
mkdir gitprojects cd gitprojects
After changing into this subdirectory it’s time to clone the Jomrungandr repository. You can do this with the git clone command:
git clone --recurse-submodules https://github.com/input-output-hk/jormungandr
This will create a subfolder “Jormungandr” and download a copy of the whole repository into it, including the linked submodules. (15-20 Megabytes)
Now cd into the Jormungandr directory.
Before we look at compiling this source-code, just a note on how to update new content from the original repository in the future. Inside the jormungandr directory you just created you can execute:
git pull git submodule update --init --recursive
This will download new files that you can then use to re-compile. It’s not required now as you just cloned the repository, but keep it in mind for the future, as it is the way to get new changes and updates committed by the developers.
Navigate to https://www.rust-lang.org/learn/get-started, download rustup-init.exe and execute the installer.
Confirm the default settings (Yes and 1). Download and installation will take around a minute.
That’s it. After restarting the command line you can use the rustup and cargo commands.
These may be required in the future to update the compiler and solve compilation errors. (If you had installed Rustup in January 2019 and then never updated, it would not compile the Jormungandr code anymore.)
Before you can start building executables from source code – if you hadn’t already installed them – you need the VisualStudio BuildTools on your Windows machine. Download and execute the installer. During setup select the C++ build tools checkbox or if you want to save around 1 GB of disk space just select the MSVC v142 – VS 2019 C++ x64/x86 build tools in the Individual components tab.
Then you have to reboot Windows once.
(Don’t forget to come back here to start building the executables 😉 )
Open a command line, cd into the Jormungandr directory…
The Cargo tool will take care of building the binaries for the Jormungandr node and Jcli tool. After downloading all required libraries, it will compile and also immediately install the binary to make it available on your system.
cargo install --path jormungandr cargo install --path jcli
After a successful build process, you now can start creating the configuration files.
Note: If you see an error message about a missing linker during the build process, you may need to add the x64 path of the linker.exe to your computers PATH variable.