From b536d08de92c7063ea3b3c90bc28cc330c2827d3 Mon Sep 17 00:00:00 2001 From: Jonas Bostoen Date: Mon, 21 Oct 2024 13:56:15 +0200 Subject: [PATCH] docs(contracts): document compilation in pubkey_to_g1_wrapper.sh --- bolt-contracts/script/pubkey_to_g1_wrapper.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bolt-contracts/script/pubkey_to_g1_wrapper.sh b/bolt-contracts/script/pubkey_to_g1_wrapper.sh index 62e53846f..260304707 100755 --- a/bolt-contracts/script/pubkey_to_g1_wrapper.sh +++ b/bolt-contracts/script/pubkey_to_g1_wrapper.sh @@ -1,6 +1,15 @@ #!/bin/bash -# Only works on Linux +# Notes on cross-compiling the binaries: +# +# Linux for arm64: +# - sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu +# - GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc CGO_ENABLED=1 go build -o pubkey_to_g1-linux-arm64 +# +# MacOS for amd64: +# - GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 go build -o pubkey_to_g1-darwin-amd64 + + arch=$(uname -i 2>/dev/null) || arch=$(uname -p) if [[ $OSTYPE == linux* ]]; then if [[ $arch == x86_64 ]]; then