Building Beam
This document will serve as a guide for building Beam and BeamUI projects. Users have the option to download the binaries directly from GitHub, however, for this walkthrough, users must have some technical knowledge, including basic knowledge of the Command-Line.

Things you'll need

To avoid any issues, have the following installed on your machine before starting your build:
  1. 1.
    The latest version of Git.
  2. 2.
    ​CMake (version 3.13 and newer to generate the build environment).
  3. 3.
    ​Boost library (version 1.66 and newer).
  4. 5.
    ​Microsoft Visual Studio (2017 and newer; Windows users only).

First steps

Downloading the binaries

Launch a terminal window and enter the following command:
1
git clone https://github.com/BeamMW/beam.git
Copied!

Creating submodules

As a prerequisite, Beam requires the creation of submodules before starting the build. To create submodules, launch your terminal window and enter the following commands:
1
cd beam
2
git submodule update --init --recursive
Copied!

Branch Convention

Beam is entirely open-source, and we encourage users interested in contributing or testing our tech to follow the Branch convention below to avoid any issues.
  1. 1.
    Master branch is for development.
  2. 2.
    Testnet branch is a sandbox for users interested in testing Beam.
  3. 3.
    Mainnet branch is the most recent version of each Beam project.

CMake Options

Beam uses CMake to generate the build environment with several options for building the project. Refer to CMakeLists.txt file for more details.

Windows

This guide assumes you have the latest version Git installed on your machine.
  1. 1.
    Install Microsoft Visual Studio with CMake support.
  2. 2.
    Download and install the Boost prebuilt binaries, adding BOOST_ROOT to the Environment Variables.
  3. 3.
    Download and install the OpenSSL prebuilt binaries (Win64 OpenSSL v1.1.0h for example). Add OPENSSL_ROOT_DIR to the Environment Variables.
  4. 4.
    Add .../boost_1_68_0/lib64-msvc-14.1 to the System Path.
  5. 5.
    Open project folder in Visual Studio, select your target (Release-x64 for example, if you downloaded 64bit Boost and OpenSSL) and select CMake -> Build All.
  6. 6.
    Open cache folder:
    ​
    ​
    For Visual Studio 2017 users, go to CMake > Cache > Open Cache Folder > Beam
    For Visual Studio 2019 users, Project > CMake cache > Open in explorer (the binaries can be found in beam/..., wallet/cli/..., explorer/... subfolders).

Linux

Locate the downloaded Beam node and Command Line (CLI) wallet in the beam/wallet/cli folder.
  1. 1.
    Clone the Beam binaries from Github by entering the following command:
    1
    git clone https://github.com/BeamMW/beam.git
    Copied!
    Please note: The above command will clone the latest master branch. The master branch is where the Beam team develops upcoming versions of Beam. Users should select the appropriate branch then git checkout after cloning the main Beam repository.
    To clone the Double Doppler 4.0 release branch, enter the following:
    1
    cd beam
    2
    git checkout double_doppler_4.0RC
    Copied!
  2. 2.
    The standard tutorials for Building beam will create the latest Beam Masternet build (development version, development blockchain). Build the Testnet for testing and development or build the Mainnet for real-world blockchain utilization by editing the beam/CMakeLists.txt file lines 151-157. Uncomment (remove the '#' sign) respective definitions for the version Beam you wish to build.
    1
    # uncomment next line for testnet
    2
    #set(BEAM_TESTNET TRUE)
    3
    # uncomment next line for mainnet
    4
    #set(BEAM_MAINNET TRUE)
    5
    ​
    6
    # uncomment next line for swap mainnet
    7
    #set(SWAP_MAINNET TRUE)
    Copied!

Ubuntu and desktop server

Ubuntu 18.04

Desktop

The instructions below are valid for a default Ubuntu 18.04.03 Desktop LTS install. For older systems, verify that steps 1, 2 & 4 do not overwrite or conflict with more recent versions of CMake and boost previously installed on your machine.
  1. 1.
    Install dependencies:
    1
    sudo add-apt-repository ppa:mhier/libboost-latest
    2
    sudo apt-get update && sudo apt-get upgrade
    3
    sudo apt-get install g++-8 libssl-dev curl wget git make
    4
    sudo apt-get install libgl1-mesa-dev zlib1g-dev libboost1.67-dev
    Copied!
  2. 2.
    Install CMake:
    1
    wget https://cmake.org/files/v3.13/cmake-3.13.0-Linux-x86_64.sh
    2
    sudo sh ./cmake-3.13.0-Linux-x86_64.sh --skip-license --prefix=/usr
    Copied!
  3. 3.
    Find your Beam project folder, start the release build:
    1
    export CC=gcc-8 && export CXX=g++-8
    2
    cmake -DCMAKE_BUILD_TYPE=Release && make -j4
    Copied!

Server

  1. 1.
    Install dependencies:
    1
    sudo add-apt-repository ppa:mhier/libboost-latest
    2
    sudo apt-get update && sudo apt-get upgrade
    3
    sudo apt-get install g++-8 libssl-dev curl wget git make
    4
    sudo apt-get install libgl1-mesa-dev zlib1g-dev libboost1.67-dev
    Copied!
  2. 2.
    Install CMake:
    1
    wget https://cmake.org/files/v3.13/cmake-3.13.0-Linux-x86_64.sh
    2
    sudo sh ./cmake-3.13.0-Linux-x86_64.sh --skip-license --prefix=/usr
    Copied!
  3. 3.
    Find your Beam project folder, start the release build:
    1
    export CC=gcc-8 && export CXX=g++-8
    2
    cmake -DCMAKE_BUILD_TYPE=Release && make -j4
    Copied!

Ubuntu 19.10

Desktop

Instructions below are valid for a minimal Ubuntu 19.10 Desktop install ("update during install" option enabled).
  1. 1.
    Install dependencies:
    1
    sudo apt-get install g++ git make cmake libboost-all-dev zlib1g-dev
    2
    sudo apt-get install libssl-dev
    Copied!
  2. 2.
    Find your Beam project folder, start the release build:
    1
    cmake -DCMAKE_BUILD_TYPE=Release . && make -j4
    Copied!

Server

  1. 1.
    Install dependencies
    1
    sudo apt-get update && sudo apt-get upgrade
    2
    sudo apt-get install g++ git make cmake libboost-all-dev zlib1g-dev
    3
    sudo apt-get install libssl-dev
    Copied!
  2. 2.
    Find your Beam project folder, start the release build:
    1
    cmake -DCMAKE_BUILD_TYPE=Release . && make -j4
    Copied!

CentOS

CentOS 7.0

The instructions below are valid for a default CentOS 7.0-1908 minimal install. For older systems, verify that steps two and three do not overwrite or conflict with more recent versions of CMakeand boost previously installed on your machine.
  1. 1.
    Install dependencies:
    1
    sudo yum update && shutdown -r now
    2
    sudo yum install centos-release-scl yum-utils
    3
    sudo yum-config-manager --enable rhel-server-rhscl-8-rpms
    4
    sudo yum install devtoolset-8-gcc*
    5
    scl enable devtoolset-8 bash
    6
    sudo yum install git make wget openssl-devel
    Copied!
  2. 2.
    Build & install boost. This step could take considerable amount of time
    1
    wget https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz
    2
    tar xzvf boost_1_66_0.tar.gz
    3
    cd boost_1_66_0 && ./bootstrap.sh && sudo ./b2 install && cd ~
    Copied!
  3. 3.
    Install CMake:
    1
    wget https://cmake.org/files/v3.13/cmake-3.13.0-Linux-x86_64.sh
    2
    sudo sh ./cmake-3.13.0-Linux-x86_64.sh --skip-license --prefix=/usr
    Copied!
  4. 4.
    Find your Beam project folder, start the release build:
    ​
    1
    cmake -DCMAKE_BUILD_TYPE=Release . && make -j4
    Copied!

CentOS 8.0

The instructions below are valid for a default CentOS 8.0-1905 minimal install. For older systems, verify that step two does not overwrite or conflict with more recent versions of CMakeand boost previously installed on your machine.
  1. 1.
    Install dependencies:
    1
    sudo dnf update
    2
    sudo dnf config-manager --set-enabled PowerTools
    3
    sudo dnf install git make cmake gcc-c++ libstdc++-static boost-devel
    4
    sudo dnf install openssl-devel tar wget
    Copied!
  2. 2.
    Install CMake:
    1
    wget https://cmake.org/files/v3.13/cmake-3.13.0-Linux-x86_64.sh
    2
    sudo sh ./cmake-3.13.0-Linux-x86_64.sh --skip-license --prefix=/usr
    Copied!
  3. 3.
    Find your Beam project folder, start the release build:
    1
    cmake -DCMAKE_BUILD_TYPE=Release . && make -j4
    Copied!

Fedora

Desktop

The instructions below are valid for a default Fedora 31-1.9 Workstation install.
  1. 1.
    Install dependencies:
    1
    sudo dnf update && shutdown -r now
    2
    sudo dnf install git make cmake gcc-c++ libstdc++-static boost-devel
    3
    sudo dnf install zlib-devel openssl-devel tar
    Copied!
  2. 2.
    Find your Beam project folder, start the release build:
    1
    cmake -DCMAKE_BUILD_TYPE=Release . && make -j4
    Copied!

Server

The instructions below are valid for a default Fedora 31-1.9 Headless Server install.
  1. 1.
    Install dependencies:
    1
    sudo dnf update && shutdown -r now
    2
    sudo dnf install git make cmake gcc-c++ libstdc++-static boost-devel
    3
    sudo dnf install zlib-devel openssl-devel tar
    Copied!
  2. 2.
    Find your Beam project folder, start the release build:
    1
    cmake -DCMAKE_BUILD_TYPE=Release . && make -j4
    Copied!

MacOS

  1. 1.
    Clone the Beam binaries from Github:
    1
    git clone https://github.com/BeamMW/beam.git
    Copied!
    Please note: The Git command above will clone the latest master branch. The master branch is where the Beam team develops upcoming versions of the Beam.
    To clone the mainnet, enter the following command:
    1
    git clone --branch mainnet https://github.com/BeamMW/beam.git
    Copied!
    To clone the Beam testnet, use:
    1
    git clone --branch testnet https://github.com/BeamMW/beam.git
    Copied!
  2. 2.
    ​Install Brew Package Manager.
  3. 3.
    To install all necessary packages, enter:
    1
    brew install openssl cmake
    Copied!
  4. 4.
    Remove any existing Brew installations of boost:
    1
    brew uninstall --ignore-dependencies boost
    Copied!
  5. 5.
    ​Download and install a compatible version of boost:
    1
    curl -O https://raw.githubusercontent.com/Homebrew/homebrew-core/5da5895add2f6b9320d654dd844d4827f6876c8b/Formula/boost.rb
    2
    brew install ./boost.rb
    Copied!
  6. 6.
    To set your Environment Variables, enter:
    1
    - export OPENSSL_ROOT_DIR="/usr/local/opt/[email protected]"
    Copied!
  7. 7.
    Find your Beam project folder, then enter:
    1
    cmake -DCMAKE_BUILD_TYPE=Release . && make -j4
    Copied!
  8. 8.
    Use cpack to get .dmg file. Find Beam project folder and then enter:
    1
    cpack
    Copied!
  9. 9.
    Locate the completed Beam node in the beam/wallet/cli and beam/explorer subfolders