-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
liuzhi
committed
Oct 15, 2024
1 parent
3e6bdc9
commit 8214717
Showing
46 changed files
with
568,478 additions
and
2,041 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
# This script builds the node binary for the current platform and statically links it with VDF static lib. | ||
# Assumes that the VDF library has been built by running the generate.sh script in the `../vdf` directory. | ||
|
||
ROOT_DIR="${ROOT_DIR:-$( cd "$(dirname "$(realpath "$( dirname "${BASH_SOURCE[0]}" )")")" >/dev/null 2>&1 && pwd )}" | ||
|
||
CLIENT_DIR="$ROOT_DIR/client" | ||
BINARIES_DIR="$ROOT_DIR/target/release" | ||
|
||
pushd "$CLIENT_DIR" > /dev/null | ||
|
||
export CGO_ENABLED=1 | ||
|
||
os_type="$(uname)" | ||
case "$os_type" in | ||
"Darwin") | ||
# Check if the architecture is ARM | ||
if [[ "$(uname -m)" == "arm64" ]]; then | ||
# MacOS ld doesn't support -Bstatic and -Bdynamic, so it's important that there is only a static version of the library | ||
go build -ldflags "-linkmode 'external' -extldflags '-L$BINARIES_DIR -lvdf -lbls48581 -ldl -lm'" "$@" | ||
else | ||
echo "Unsupported platform" | ||
exit 1 | ||
fi | ||
;; | ||
"Linux") | ||
go build -ldflags "-linkmode 'external' -extldflags '-L$BINARIES_DIR -Wl,-Bstatic -lvdf -lbls48581 -Wl,-Bdynamic -ldl -lm'" "$@" | ||
;; | ||
*) | ||
echo "Unsupported platform" | ||
exit 1 | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.