Skip to content

Install and Build

Andre Patta edited this page Jun 28, 2022 · 1 revision

Installing ETN-SC

There are several ways to install ETN-SC, including downloading a pre-built bundle, running as a docker container or building from downloaded source code. On this page the various installation options are explained for several major operating systems. Users prioritizing ease of installation should choose to use a package manager or prebuilt bundle. Users prioritizing customization should build from source. It is important to run the latest version of ETN-SC because each release includes bugfixes and improvement over the previous versions. The stable releases are recommended for most users because they have been fully tested. A list of stable releases can be found here. Instructions for updating existing ETN-SC installations are also provided in each section.

Package managers

TBD

Standalone bundle

Stable releases and development builds are provided as standalone bundles. These are useful for users who: a) wish to install a specific version of ETN-SC (e.g., for reproducible environments); b) wish to install on machines without internet access (e.g. air-gapped computers); or c) wish to avoid automatic updates and instead prefer to manually install software.

The following standalone bundles are available:

  • 32bit, 64bit, ARMv5, ARMv6, ARMv7 and ARM64 archives (.tar.gz) on Linux
  • 64bit archives (.tar.gz) on macOS
  • 32bit and 64bit archives (.zip) and installers (.exe) on Windows

Some archives contain only ETN-SC, while other archives containing ETN-SC and the various developer tools (clef, devp2p, abigen, bootnode, evm, rlpdump and puppeth). More information about these executables is available at the README.

The standalone bundles can be downloaded from the GitHub Releases page. To update an existing installation, download and manually install the latest version.

Docker container

TBD

Build from source code

Most Linux systems and macOS

ETN-SC is written in Go, so building from source code requires the most recent version of Go to be installed. Instructions for installing Go are available at the Go installation page and necessary bundles can be downloaded from the Go download page.

With Go installed, ETN-SC can be downloaded into a GOPATH workspace via:

go get -d github.com/electroneum/electroneum-sc

You can also install specific versions via:

go get -d github.com/electroneum/[email protected]

The above commands do not build any executables. To do that you can either build one specifically:

go install github.com/electroneum/electroneum-sc/cmd/etn-sc

Alternatively, the following command, run in the project root directory (electroneum/electroneum-sc) in the GO workspace, builds the entire project and installs ETN-SC and all the developer tools:

go install ./...

For macOS users, errors related to macOS header files are usually fixed by installing XCode Command Line Tools with xcode-select --install. Another common error is: go: cannot use path@version syntax in GOPATH mode. This and other similar errors can often be fixed by enabling gomodules using export GO111MODULE=on.

Updating an existing ETN-SC installation can be achieved using go get:

go get -u github.com/electroneum/electroneum-sc

Windows

The Chocolatey package manager provides an easy way to install the required build tools. Chocolatey can be installed by following these instructions. Then, to install the build tool the following commands can be run in an Administrator command prompt:

C:\Windows\system32> choco install git
C:\Windows\system32> choco install golang
C:\Windows\system32> choco install mingw

Installing these packages sets up the path environment variables. To get the new path a new command prompt must be opened. To install ETN-SC, a Go workspace directory must first be created, then the ETN-SC source code can be created and built.

C:\Users\xxx> mkdir src\github.com\electroneum
C:\Users\xxx> git clone https://github.com/electroneum/electroneum-sc src\github.com\electroneum\electroneum-sc
C:\Users\xxx> cd src\github.com\electroneum\electroneum-sc
C:\Users\xxx\src\github.com\electroneum\electroneum-sc> go get -u -v golang.org/x/net/context
C:\Users\xxx\src\github.com\electroneum\electroneum-sc> go install -v ./cmd/...

FreeBSD

To build ETN-SC from source code on FreeBSD, the ETN-SC Github repository can be cloned into a local directory.

git clone https://github.com/electroneum/electroneum-sc

Then, the Go compiler can be used to build ETN-SC:

pkg install go

If the Go version currently installed is >= 1.5, Geth can be built using the following command:

cd electroneum-sc
make etn-sc

If the installed Go version is < 1.5 (quarterly packages, for example), the following command can be used instead:

cd electroneum-sc
CC=clang make etn-sc

To start the node, the following command can be run:

build/bin/etn-sc

Building without a Go workflow

ETN-SC can also be built without using Go workspaces. In this case, the repository should be cloned to a local repository. Then, the command make etn-sc configures everything for a temporary build and cleans up afterwards. This method of building only works on UNIX-like operating systems, and a Go installation is still required.

git clone https://github.com/electroneum/electroneum-sc.git
cd electroneum-sc
make etn-sc

These commands create an ETN-SC executable file in the electroneum-sc/build/bin folder that can be moved and run from another directory if required. The binary is standalone and doesn’t require any additional files.

To update an existing ETN-SC installation simply stop the node, navigate to the project root directory and pull the latest version from the electroneum-sc Github repository. Then rebuild and restart the node.

cd electroneum-sc
git pull
make etn-sc

Additionally all the developer tools provided with ETN-SC (clef, devp2p, abigen, bootnode, evm, rlpdump and puppeth) can be compiled by running make all. More information about these tools can be found here.

To build a stable release, e.g. v5.0.0, the command git checkout v5.0.0 retrieves that specific version. Executing that command before running make etn-sc switches ETN-SC to a stable branch.