Elacoin is the digital currency solution within Elastos eco system.
This project is the source code that can build a full node of ELA.
Make sure the OSX version is 16.7+
$ uname -srm
Darwin 16.7.0 x86_64
Use Homebrew to install Golang 1.9.
$ brew install [email protected]
If you install older version, such as v1.8, you may get missing math/bits package error when build.
In this instruction we use ~/dev/src/github.com/elastos as our working directory. If you clone the source code to a different directory, please make sure you change other environment variables accordingly (not recommended).
$ mkdir -p ~/dev/bin
$ mkdir -p ~/dev/src/github.com/elastos/
export GOROOT=/usr/local/opt/[email protected]/libexec
export GOPATH=$HOME/dev
export GOBIN=$GOPATH/bin
export PATH=$GOROOT/bin:$PATH
export PATH=$GOBIN:$PATH
Glide is a package manager for Golang. We use Glide to install dependent packages.
$ brew install --ignore-dependencies glide
Check the golang and glider version. Make sure they are the following version number or above.
$ go version
go version go1.9.2 darwin/amd64
$ glide --version
glide version 0.13.1
If you cannot see the version number, there must be something wrong when install.
Make sure you are in the folder of $GOPATH/src/github.com/elastos
$ git clone https://github.com/elastos/Elastos.ELA.git
If clone works successfully, you should see folder structure like $GOPATH/src/github.com/elastos/Elastos.ELA/Makefile
cd $GOPATH/src/github.com/elastos/Elastos.ELA and Run glide update && glide install
to install depandencies.
cd $GOPATH/src/github.com/elastos/Elastos.ELA and Run make
to build files.
If you did not see any error message, congratulations, you have made the ELA full node.
- run
./ela
to run the node program.
Make sure your ubuntu version is 16.04+
$ cat /etc/issue
Ubuntu 16.04.3 LTS \n \l
$ sudo apt-get install -y git
$ sudo apt-get install -y software-properties-common
$ sudo add-apt-repository -y ppa:gophers/archive
$ sudo apt update
$ sudo apt-get install -y golang-1.9-go
If you install older version, such as v1.8, you may get missing math/bits package error when build.
In this instruction we use ~/dev/src/github.com/elastos/ as our working directory. If you clone the source code to a different directory, please make sure you change other environment variables accordingly (not recommended).
$ mkdir -p ~/dev/bin
$ mkdir -p ~/dev/src/github.com/elastos
export GOROOT=/usr/lib/go-1.9
export GOPATH=$HOME/dev
export GOBIN=$GOPATH/bin
export PATH=$GOROOT/bin:$PATH
export PATH=$GOBIN:$PATH
Glide is a package manager for Golang. We use Glide to install dependent packages.
$ cd ~/dev
$ curl https://glide.sh/get | sh
Check the golang and glider version. Make sure they are the following version number or above.
$ go version
go version go1.9.2 linux/amd64
$ glide --version
glide version v0.13.1
If you cannot see the version number, there must be something wrong when install.
Make sure you are in the folder of $GOPATH/src/github.com/elastos
$ git clone https://github.com/elastos/Elastos.ELA.git
If clone works successfully, you should see folder structure like $GOPATH/src/github.com/elastos/Elastos.ELA/Makefile
cd $GOPATH/src/github.com/elastos/Elastos.ELA and Run glide update && glide install
to install depandencies.
cd $GOPATH/src/github.com/elastos/Elastos.ELA and Run make
to build files.
If you did not see any error message, congratulations, you have made the ELA full node.
- run
./ela
to run the node program.
See the documentation about config.json
Alternatively if don't want to build it manually. We also provide a Dockerfile
to help you (You need have a prepared docker env).
cd docker
docker build -t ela_node_run .
#start container
docker run -p 20334:20334 -p 20335:20335 -p 20336:20336 -p 20338:20338 ela_node_run
Note: don't using Ctrl-C to terminate the output, just close this terminal and open another.
Now you can access ELA Node's rest api:
curl http://localhost:20334/api/v1/block/height
In the above instruction, we use default configuration file config.json
in the repository; If you familiar with docker you can change the docker file to use your own ELA Node configuration.
If you want to learn the API of Elastos.ELA, please refer to the following: