Build
This document describes how to build the Second State DevChain.

Binary build

Binary builds of the Second State DevChain are limited to Ubuntu 16.04 and CentOS 7.

Ubuntu 16.04

First, let’s install and update necessary packages on a clean Ubuntu 16.04 install.
1
$ sudo apt update -y
2
$ sudo apt install -y curl wget git bison build-essential
Copied!
Next, you must have GO language version 1.10+ installed. The easiest way to get GO 1.10 is through the GVM. Below are the commands.
1
$ bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
2
$ gvm install go1.10.3 -B
3
$ gvm use go1.10.3 --default
Copied!
Now, pull the devchain source code from Github, and then build the binary executable for Ubuntu 16.04.
1
$ go get github.com/second-state/devchain
2
$ cd $GOPATH/src/github.com/second-state/devchain
3
$ make all
Copied!
Once successful, the binary executable from the build is $GOPATH/bin/devchain.
1
$ which devchain
2
/home/ubuntu/.gvm/pkgsets/go1.10.3/global/bin/devchain
Copied!

CentOS 7

TBD

Docker build

First, install Docker.
1
$ sudo apt install docker.io
2
$ sudo usermod -a -G docker $USER
Copied!
Log out and then log back in. Clone the repository from Github to your build machine.
1
$ git clone https://github.com/second-state/devchain.git
2
$ cd devchain
Copied!
Next, build a Docker image for the build environment.
1
$ docker build -t secondstate/devchain-build -f Dockerfile.build.ubuntu .
2
...
3
Successfully tagged secondstate/devchain-build:latest
Copied!
Finally, you can build the Docker image of the node.
1
$ docker build -t secondstate/devchain .
2
...
3
Successfully tagged secondstate/devchain:latest
Copied!
You can now see the Docker image you just built.
1
$ docker image ls
2
REPOSITORY TAG IMAGE ID CREATED SIZE
3
secondstate/devchain latest c800759441b6 5 minutes ago 246MB
4
secondstate/devchain-build latest 364c7a4700b9 4 hours ago 732MB
5
ubuntu 16.04 a3551444fc85 7 days ago 119MB
Copied!
Last modified 2yr ago
Copy link