Building from Source¶
This page explains how you can build aergo from source.
If you are only interested in running the aergo tools, it is easier to use pre-built binaries or Docker images instead, as explained in Quickstart.
Prerequisites
- Go1.12.5+ - https://golang.org/dl
- Proto Buffers - https://github.com/google/protobuf
- CMake 3.0.0 or higher - https://cmake.org
Linux¶
Install dependencies
apk update apk add git build-base go libgcc
Install aergo
go get -d github.com/aergoio/aergo cd ${GOPATH}/src/github.com/aergoio/aergo git submodule init && git submodule update make
Set environment
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${GOPATH}/src/github.com/aergoio/aergo/libtool/lib
macOS¶
If you haven’t already, install homebrew.
Install dependencies
brew install go brew install cmake # optional brew install protobuf # optional
Install aergo
go get -d github.com/aergoio/aergo cd `go env GOPATH`/src/github.com/aergoio/aergo git submodule init git submodule update make
Set environment
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${GOPATH}/src/github.com/aergoio/aergo/libtool/lib
Run server
./bin/aergosvr
Windows¶
Building on Windows is currently not supported.
Generating protobuf files¶
If you changed the protobuf files, you need to re-compile the type definitions.
Install protoc-gen-go
GIT_TAG="v1.1.0" # set version of protoc-gen-go to 1.1.0, on which aergo v0.8.x depends. go get -u github.com/golang/protobuf/protoc-gen-go git -C "$(go env GOPATH)"/src/github.com/golang/protobuf checkout $GIT_TAG go install github.com/golang/protobuf/protoc-gen-go
Generate type definitions from protobuf files
make protoc