Files
evm/scripts/build.sh
T
Ceyhun OnurandGitHub 6e22df3bc5 Add SDK Router message handling (#316) (#858)
* Add SDK Router message handling (#316)

Co-authored-by: Stephen Buttolph <[email protected]>

* revert avago version bump

* Fix hanging requests after Shutdown (#326) (#859)

* Fix hanging requests after Shutdown (#326)

* fix requests hanging after shutdown

* fix build

---------

Signed-off-by: Stephen Buttolph <[email protected]>
Co-authored-by: Stephen Buttolph <[email protected]>

* Bump avago rc (#860)

* Update to 1.10.10-rc.2 (#328)

* update to avalanchego 1.10.10-rc.2

* nits

* nit

* add batchsize

* increase timeout dynamically

---------

Co-authored-by: Joshua Kim <[email protected]>

---------

---------
2023-09-18 21:24:58 -04:00

54 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
go_version_minimum="1.20.8"
go_version() {
go version | sed -nE -e 's/[^0-9.]+([0-9.]+).+/\1/p'
}
version_lt() {
# Return true if $1 is a lower version than than $2,
local ver1=$1
local ver2=$2
# Reverse sort the versions, if the 1st item != ver1 then ver1 < ver2
if [[ $(echo -e -n "$ver1\n$ver2\n" | sort -rV | head -n1) != "$ver1" ]]; then
return 0
else
return 1
fi
}
if version_lt "$(go_version)" "$go_version_minimum"; then
echo "SubnetEVM requires Go >= $go_version_minimum, Go $(go_version) found." >&2
exit 1
fi
# Root directory
SUBNET_EVM_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
)
# Load the versions
source "$SUBNET_EVM_PATH"/scripts/versions.sh
# Load the constants
source "$SUBNET_EVM_PATH"/scripts/constants.sh
if [[ $# -eq 1 ]]; then
BINARY_PATH=$1
elif [[ $# -eq 0 ]]; then
BINARY_PATH="$GOPATH/src/github.com/ava-labs/avalanchego/build/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy"
else
echo "Invalid arguments to build subnet-evm. Requires zero (default location) or one argument to specify binary location."
exit 1
fi
# Build Subnet EVM, which is run as a subprocess
echo "Building Subnet EVM @ GitCommit: $SUBNET_EVM_COMMIT at $BINARY_PATH"
go build -ldflags "-X github.com/ava-labs/subnet-evm/plugin/evm.GitCommit=$SUBNET_EVM_COMMIT $STATIC_LD_FLAGS" -o "$BINARY_PATH" "plugin/"*.go