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:
- The latest version of Git.
- CMake (version 3.13 and newer to generate the build environment).
- Boost library (version 1.66 and newer_)._
- OpenSSL Library.
- Microsoft Visual Studio (2017 and newer; Windows users only).
First steps
Downloading the binaries
Launch a terminal window and enter the following command:
git clone https://github.com/BeamMW/beam.git
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:
cd beam
git submodule update --init --recursive
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.
Master
branch is for development.Testnet
branch is a sandbox for users interested in testing Beam.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.
- Install Microsoft Visual Studio with CMake support.
- Download and install the Boost prebuilt binaries, adding
BOOST_ROOT
to the Environment Variables. - Download and install the OpenSSL prebuilt binaries (
Win64 OpenSSL v1.1.0h
for example). AddOPENSSL_ROOT_DIR
to the Environment Variables. - Add
.../boost_1_68_0/lib64-msvc-14.1
to the System Path. - Open project folder in Visual Studio, select your target (
Release-x64
for example, if you downloaded 64bit Boost and OpenSSL) and selectCMake -> Build All
. - 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 inbeam/..., wallet/cli/..., explorer/... subfolders
).
Linux
Locate the downloaded Beam node and Command Line (CLI) wallet in the beam/wallet/cli
folder.
- Clone the Beam binaries from Github by entering the following command:
git clone https://github.com/BeamMW/beam.git
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 thengit checkout
after cloning the main Beam repository.
To clone theDouble Doppler 4.0
release branch, enter the following:cd beam git checkout double_doppler_4.0RC
- 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.# uncomment next line for testnet #set(BEAM_TESTNET TRUE) # uncomment next line for mainnet #set(BEAM_MAINNET TRUE) # uncomment next line for swap mainnet #set(SWAP_MAINNET TRUE)
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.
- Install dependencies:
sudo add-apt-repository ppa:mhier/libboost-latest sudo apt-get update && sudo apt-get upgrade sudo apt-get install g++-8 libssl-dev curl wget git make sudo apt-get install libgl1-mesa-dev zlib1g-dev libboost1.67-dev
- Install
CMake
:wget https://cmake.org/files/v3.13/cmake-3.13.0-Linux-x86_64.sh sudo sh ./cmake-3.13.0-Linux-x86_64.sh --skip-license --prefix=/usr
- Find your Beam project folder, start the release build:
export CC=gcc-8 && export CXX=g++-8 cmake -DCMAKE_BUILD_TYPE=Release && make -j4
Server
- Install dependencies:
sudo add-apt-repository ppa:mhier/libboost-latest sudo apt-get update && sudo apt-get upgrade sudo apt-get install g++-8 libssl-dev curl wget git make sudo apt-get install libgl1-mesa-dev zlib1g-dev libboost1.67-dev
- Install
CMake
:wget https://cmake.org/files/v3.13/cmake-3.13.0-Linux-x86_64.sh sudo sh ./cmake-3.13.0-Linux-x86_64.sh --skip-license --prefix=/usr
- Find your Beam project folder, start the release build:
export CC=gcc-8 && export CXX=g++-8 cmake -DCMAKE_BUILD_TYPE=Release && make -j4
Ubuntu 19.10
Desktop
Instructions below are valid for a minimal Ubuntu 19.10 Desktop install ("update during install" option enabled).
- Install dependencies:
sudo apt-get install g++ git make cmake libboost-all-dev zlib1g-dev sudo apt-get install libssl-dev
- Find your Beam project folder, start the release build:
cmake -DCMAKE_BUILD_TYPE=Release . && make -j4
Server
- Install dependencies
sudo apt-get update && sudo apt-get upgrade sudo apt-get install g++ git make cmake libboost-all-dev zlib1g-dev sudo apt-get install libssl-dev
- Find your Beam project folder, start the release build:
cmake -DCMAKE_BUILD_TYPE=Release . && make -j4
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 CMake
and boost
previously installed on your machine.
- Install dependencies:
sudo yum update && shutdown -r now sudo yum install centos-release-scl yum-utils sudo yum-config-manager --enable rhel-server-rhscl-8-rpms sudo yum install devtoolset-8-gcc* scl enable devtoolset-8 bash sudo yum install git make wget openssl-devel
- Build & install boost. This step could take considerable amount of time
wget https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz tar xzvf boost_1_66_0.tar.gz cd boost_1_66_0 && ./bootstrap.sh && sudo ./b2 install && cd ~
- Install
CMake
:wget https://cmake.org/files/v3.13/cmake-3.13.0-Linux-x86_64.sh sudo sh ./cmake-3.13.0-Linux-x86_64.sh --skip-license --prefix=/usr
- Find your Beam project folder, start the release build:
cmake -DCMAKE_BUILD_TYPE=Release . && make -j4
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 CMake
and boost
previously installed on your machine.
- Install dependencies:
sudo dnf update sudo dnf config-manager --set-enabled PowerTools sudo dnf install git make cmake gcc-c++ libstdc++-static boost-devel sudo dnf install openssl-devel tar wget
- Install
CMake
:wget https://cmake.org/files/v3.13/cmake-3.13.0-Linux-x86_64.sh sudo sh ./cmake-3.13.0-Linux-x86_64.sh --skip-license --prefix=/usr
- Find your Beam project folder, start the release build:
cmake -DCMAKE_BUILD_TYPE=Release . && make -j4
Fedora
Desktop
The instructions below are valid for a default Fedora 31-1.9 Workstation install.
- Install dependencies:
sudo dnf update && shutdown -r now sudo dnf install git make cmake gcc-c++ libstdc++-static boost-devel sudo dnf install zlib-devel openssl-devel tar
- Find your Beam project folder, start the release build:
cmake -DCMAKE_BUILD_TYPE=Release . && make -j4
Server
The instructions below are valid for a default Fedora 31-1.9 Headless Server install.
- Install dependencies:
sudo dnf update && shutdown -r now sudo dnf install git make cmake gcc-c++ libstdc++-static boost-devel sudo dnf install zlib-devel openssl-devel tar
- Find your Beam project folder, start the release build:
cmake -DCMAKE_BUILD_TYPE=Release . && make -j4
MacOS
- Clone the Beam binaries from Github:
git clone https://github.com/BeamMW/beam.git
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 themainnet
, enter the following command:git clone --branch mainnet https://github.com/BeamMW/beam.git
To clone the Beamtestnet
, use:git clone --branch testnet https://github.com/BeamMW/beam.git
- Install
Brew
Package Manager. - To install all necessary packages, enter:
brew install openssl cmake
- Remove any existing
Brew
installations ofboost
:brew uninstall --ignore-dependencies boost
- Download and install a compatible version of
boost
:curl -O https://raw.githubusercontent.com/Homebrew/homebrew-core/5da5895add2f6b9320d654dd844d4827f6876c8b/Formula/boost.rb brew install ./boost.rb
- To set your Environment Variables, enter:
- export OPENSSL_ROOT_DIR="/usr/local/opt/[email protected]"
- Find your Beam project folder, then enter:
cmake -DCMAKE_BUILD_TYPE=Release . && make -j4
- Use
cpack
to get.dmg file.
Find Beam project folder and then enter:cpack
- Locate the completed Beam node in the
beam/wallet/cli
andbeam/explorer
subfolders