This document describes how to build an epoch node from source on current Ubuntu 16.04.4 LTS or Ubuntu 18.04 LTS.
The commands below assume you are logged in with sudo user.
Make sure your Ubuntu version and it's packages are up to date, then install required tools and libraries:
sudo apt-get -qq update \
&& sudo apt-get -y upgrade \
&& sudo apt-get -qq -y install git curl autoconf build-essential ncurses-dev libssl-devRequired Erlang OTP version is 20.1.
sudo apt-get install erlangUbuntu 16.04 ships with outdated erlang version. Version 20 can be installed from source:
OTP_VERSION="20.2.3"
OTP_DOWNLOAD_URL="https://github.com/erlang/otp/archive/OTP-${OTP_VERSION}.tar.gz"
curl -fsSL -o otp-src.tar.gz "$OTP_DOWNLOAD_URL" \
&& mkdir otp-src \
&& tar -zxf otp-src.tar.gz -C otp-src --strip-components=1 \
&& cd otp-src \
&& export ERL_TOP=`pwd` \
&& ./otp_build autoconf && ./configure && make -j$(nproc) && sudo make install \
&& cd ..Required Libsodium version is 1.0.16.
Since Ubuntu 18.04 ships with libsodium version 1.0.16 it can be installed from apt package:
sudo apt-get install libsodium-devUbuntu 16.04 ships with older than required version of libsodium thus it must be installed from source running below commands:
LIBSODIUM_VERSION="1.0.16"
LIBSODIUM_DOWNLOAD_URL="https://github.com/jedisct1/libsodium/releases/download/${LIBSODIUM_VERSION}/libsodium-${LIBSODIUM_VERSION}.tar.gz"
curl -fsSL -o libsodium-src.tar.gz "$LIBSODIUM_DOWNLOAD_URL" \
&& mkdir libsodium-src \
&& tar -zxf libsodium-src.tar.gz -C libsodium-src --strip-components=1 \
&& cd libsodium-src \
&& ./configure && make -j$(nproc) \
&& sudo make install \
&& sudo ldconfig \
&& cd ..For more details read the dedicated Libsodium documentation.
Epoch source code can be obtained by cloning the public GitHub repository:
git clone https://github.com/aeternity/epoch.git epoch && cd epochIdentify the version to be built:
VERSION=1.0.0-rc6
Checkout the version to be built:
git checkout tags/v${VERSION:?}One can create a production build by running:
make prod-buildMake sure beneficiary account is set in configuration, as this is mandatory to successfully start a node. There is no default beneficiary configured.
See configuration documentation for configuration details.
If prod-build went fine, configuration is in place, one should be able to navigate to the build artifacts directory and start the epoch node:
cd _build/prod/rel/epoch/
bin/epoch startSee operation documentation for more details.
Alternatively a production package similar to what is distributed via GitHub releases can be created by running:
make prod-packageOnce the packaging is done, the package is created in the _build/prod/rel/epoch/ directory, e.g. _build/prod/rel/epoch/epoch-${VERSION:?}.tar.gz.
To deploy the package for example in /tmp/node one should just unarchive it to that directory:
mkdir /tmp/node
tar xf _build/prod/rel/epoch/epoch-${VERSION:?}.tar.gz -C /tmp/nodeMake sure beneficiary account is set in configuration, as this is mandatory to successfully start a node. There is no default beneficiary configured.
See configuration documentation for configuration details.
Then start the node:
/tmp/node/bin/epoch startSee operation documentation for more details.