-
Install SmartOS
-
Login as root (over SSH)
-
Create zone (https://wiki.smartos.org/how-to-create-a-zone/):
imgadm import cfa9c88e-03f8-11eb-9980-879ff7980a9f # 20.3.0 64-bit vmadm create <<EOL
{ "brand": "joyent", "image_uuid": "cfa9c88e-03f8-11eb-9980-879ff7980a9f", "alias": "avalanchego", "hostname": "avalanchego", "resolvers": ["8.8.8.8", "8.8.4.4"], "max_physical_memory": 2048, "maintain_resolvers": true, "nics": [ { "nic_tag": "admin", "ip": "dhcp" } ] } EOL
-
Login to zone:
zlogin <uuid>
-
Install build dependencies:
pkgin install go115 git gcc9 gcc9-libs
-
Set GOPATH:
export PATH=$PATH:$(go env GOPATH)/bin export GOPATH=$(go env GOPATH)
-
Create a disk-based tmp directory, by default SmartOS zones use a RAM-disk tmpfs which has only 256 MB allocated (and we don't want to waste RAM on this):
mkdir -f tmp export TMPDIR=~/tmp
-
Clone and build custom fork of coreth (https://github.com/ava-labs/coreth):
git clone --branch solaris_fixups https://github.com/dokterbob/coreth.git ~/go/src/github.com/ava-labs/coreth
-
Follow variant of official installation instructions (https://github.com/ava-labs/avalanchego):
go get -v -d github.com/ava-labs/avalanchego/... cd $GOPATH/src/github.com/ava-labs/avalanchego scripts/build_avalanche.sh mkdir build/plugins scripts/build_coreth.sh ~/go/src/github.com/ava-labs/coreth build/plugins/evm
The latter command seems to arbitrarily fail with
/opt/local/go115/pkg/tool/solaris_amd64/link: running gcc failed: wait: no child processes
and needs to be repeated until a working binary comes out. This is possibly due to an out of memory or similar condition. -
Run avalanchego like a true boss:
./build/avalanchego
Created
March 26, 2021 14:57
-
-
Save dokterbob/778f65a2cfeabe5915977910eebf44c0 to your computer and use it in GitHub Desktop.
Building avalanchego on SmartOS
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment