# Setup the environment

Follow the installations instructions to set up the environment, then come back here and continue reading 😊
Install these ⬇️

Any text editor will do for writing markdown, one of the most versatile is Visual Code (opens new window) with these plugins:

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.

  1. 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.
  2. Install Rust:

    1. install Rust (opens new window)
    2. download the rustup-init.exe for both 32-bit and 64-bit and run it
    3. 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
  3. Prepare WASM Environment by running this script: .\scripts\init.bat

  4. Install LLVM: https://releases.llvm.org/download.html

  5. 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
    
  6. 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)
    
  7. 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:

  1. It will make sure that you are using the latest Rust stable by default
  2. 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

Last Updated: 2/18/2021, 1:26:25 PM