How to compile Mainnet wallet node from source code

Prerequisites

  • Install Go 1.11 or newer.
  • Install ProtoBuf and related tools.
    • libprotoc 3.6.1
    • github.com/golang/protobuf 1.3.2
    • protoc-gen-go
    • github.com/gogo/protobuf 1.2.1
    • protoc-gen-gogo
    • protoc-gen-gofast
    • github.com/grpc-ecosystem/grpc-gateway 1.9.6
    • protoc-gen-grpc-gateway
    • protoc-gen-swagger

Build wallet

Linux/Darwin

  • Clone source code to \$GOPATH/src/massnet.org.
  • Build program, the output binary will be put at ./bin/masswallet
cd $GOPATH/src/massnet.org/mass-wallet
make build

Windows

  • Clone source code to \$GOPATH\src\massnet.org.
  • Set environment variable GO111MODULE="off" if your Golang version is newer than 1.11.
  • Build program.
cd %GOPATH%\src\massnet.org\mass-wallet
go build -o bin\masswallet.exe

Build CLI client

Linux/Darwin

The output CLI binary will be put at folder ./bin

cd $GOPATH/src/massnet.org/mass-wallet/cmd/masswalletcli
make build

Windows

Set environment variable GO111MODULE="off" if your Golang version is newer than 1.11.

cd %GOPATH%\src\massnet.org\mass-wallet\cmd\masswalletcli
go build -o bin\masswallet-cli.exe