# Environment Setup

Welcome to the Firefly environment setup guide! Here you will find all of the information regarding how we setup our various development environments.

# Dependencies

The following must be installed on all platforms:

# MacOS

  • Xcode Command Line Tools

# Linux

  • Snapcraft (sudo snap install snapcraft --classic)
  • Multipass (sudo snap install multipass) or LXD (snap install lxd) are necessary for Snap compilation (to bypass this requirement and build on the host, set SNAP_DESTRUCTIVE_MODE="true")
  • build-essential
  • clang (on some older distros, you may need to add LLVM APT repos)
  • libsecret (Debian/Ubuntu: libsecret-1-dev, Red Hat: libsecret-devel, Arch Linux: libsecret)
  • libssl (Debian/Ubuntu: libssl-dev, Red Hat: openssl-devel, Arch Linux: openssl)
  • libusb (Debian/Ubuntu: libusb-1.0-0-dev)
  • libudev (Debian/Ubuntu: libudev-dev)
  • gnome-keyring, keepassxc, or another secrets manager that implements the freedesktop.org Secrets API

# Windows

It is highly recommended to use Chocolatey as a package manager for Windows. There are a few dependencies that Chocolatey handles smoothly, which otherwise are often troublesome to install and configure. Read installation steps here.

PowerShell in administrator mode is recommended for the following steps.

choco install cmake llvm openssl

ℹ️ llvm can also be downloaded and installed with snapshot builds.

  • Install and configure dependencies for Windows:
choco install python visualstudio2019-workload-vctools -y
npm config set msvs_version 2019

ℹ️ Alternatively, you can download Microsoft C++ Build Tools. You must check boxes for "Node.js development" and "Desktop development with C++" within the Visual Studio Installer (use the 2019 version).

  • Add environment variable definitions in ~/.bash_profile or ~/.bashrc:
# wallet.rs sub-dependencies
export OPENSSL_DIR="C:\Program Files\OpenSSL-Win64"

# ensure SODIUM_LIB_DIR points to folder with .lib file (and not .dll)
export SODIUM_LIB_DIR="$HOME\.cargo\registry\src\github.com-1ecc6299db9ec823\libsodium-sys-0.2.7\msvc\x64\Release\v142"
## tell rustc to link library dynamically (use .dll - "dynamic-link library")
export SODIUM_SHARED=1

# path to clang binaries (*.dll/*.lib files)
export LIBCLANG_PATH="C:\Program Files\LLVM\bin"