# Setup the environment
Follow the installations instructions to set up the environment, then come back here and continue reading 😊
Install these ⬇️
- git (opens new window)
- nodejs (opens new window)
- yarn package manager (opens new window)
- how to enable SSH on windows 10 (opens new window)
- GPG full suite (opens new window)
- Draw.io (opens new window)
Any text editor will do for writing markdown, one of the most versatile is Visual Code (opens new window) with these plugins:
- Markdown All In One Plugin (opens new window)
- Markdown Mermaid preview for the diagrams (opens new window)
- Emoji (opens new window)
- Grammarly (opens new window)
Lets verify your installation. Copy line by line from the following snippet. If there are errors please consult installation instructions.
git --version
# git version 2.25.0
node --version
# v13.7.0
# SSH and committing
We must have SSH keys in order to commit anything to the GitLab servers. They are our keys to the server with max security. If you have them go here (opens new window) and add them to GitLab. Name them meaningfully, like My main laptop key
.
Now you should be fine with committing to the repo via SSH, congrats 👏 👏 👏 !!!
# Signing Your Work
We require that every commit is signed with the PGP key.
Comprehensive guide is available on official git pages (opens new window)
# Rust Developer Environment on Windows
If you are on Windows you have 2 choices, its recommended to set up both WSL and windows.
Download and install "Build Tools for Visual Studio:"
- You can get it at this link: https://aka.ms/buildtools or you can install it via npm https://www.npmjs.com/package/windows-build-tools/v/2.0.0
- Run the installation file:
vs_buildtools.exe
. - Ensure the "Windows 10 SDK" component is included when installing the Visual C++ Build Tools.
- Restart your computer.
Install Rust:
- install Rust (opens new window)
- download the
rustup-init.exe
for both 32-bit and 64-bit and run it - use WSL, in that case it depends which distribution you have, but generally you can just paste this in your bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Prepare WASM Environment by running this script:
.\scripts\init.bat
Install LLVM: https://releases.llvm.org/download.html
Install OpenSSL with
vcpkg
:mkdir C:\Tools cd C:\Tools git clone https://github.com/Microsoft/vcpkg.git cd vcpkg .\bootstrap-vcpkg.bat .\vcpkg.exe install openssl:x64-windows-static
Add OpenSSL to your System Variables using PowerShell:
$env:OPENSSL_DIR = 'C:\Tools\vcpkg\installed\x64-windows-static' $env:OPENSSL_STATIC = 'Yes' [System.Environment]::SetEnvironmentVariable('OPENSSL_DIR', $env:OPENSSL_DIR, [System.EnvironmentVariableTarget]::User) [System.Environment]::SetEnvironmentVariable('OPENSSL_STATIC', $env:OPENSSL_STATIC, [System.EnvironmentVariableTarget]::User)
Finally, install
cmake
: https://cmake.org/download/
# Rust Developer Environment
# Debian and its flavors
Run:
sudo apt install -y cmake pkg-config libssl-dev git gcc build-essential clang libclang-dev
# MacOS
Install the Homebrew package manager (opens new window), then run:
brew install openssl cmake llvm
Anagolay uses the Rust programming language. You should
install Rust (opens new window) using rustup
:
Linux based:
curl https://sh.rustup.rs -sSf | sh
Then you can run init.sh
script located in scripts
directory like this:
Linux: ./scripts/init.sh
This will do following:
- It will make sure that you are using the latest Rust stable by default
- It will install and prepare the environment for the Wasm Compilation
# Wasm Compilation
Substrate uses WebAssembly (Wasm), and you will need to configure your Rust compiler to use
nightly
to support this build target.
This will be prepared when you execute the init
script.
# Rustup Update
Anagolay always uses the latest version of Rust stable and nightly for compilation. To ensure your
Rust compiler is always up to date, you should run:
rustup update
This may even solve compilation issues you face when working with Anagolay.
# Notes pgp move
touch .gnupg/gpg-agent.conf
echo 'pinentry-program "/mnt/c/Program Files (x86)/GnuPG/bin/pinentry-basic.exe"' > .gnupg/gpg-agent.conf
gpgconf --kill gpg-agent
git config --global gpg.program gpg2
echo "test" | gpg2 --clearsign