-
Notifications
You must be signed in to change notification settings - Fork 14
/
updateBesu.sh
executable file
·45 lines (35 loc) · 1 KB
/
updateBesu.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
set -euo pipefail
TEMP=`mktemp -d`
function cleanup() {
rm -rf "${TEMP}"
}
trap cleanup EXIT
VERSION=${1?Must specify the besu version to get}
URL="https://github.com/hyperledger/besu/releases/download/${VERSION}/besu-${VERSION}.zip"
echo "Downloading version ${VERSION} of besu from ${URL}..."
curl -o "${TEMP}/besu-${VERSION}.zip" -L --fail "${URL}"
unzip -t "${TEMP}/besu-${VERSION}.zip"
echo "Calculating new hash..."
HASH=`shasum -a 256 ${TEMP}/besu-${VERSION}.zip | cut -d ' ' -f 1`
cat > besu.rb <<EOF
class Besu < Formula
desc "hyperledger besu ethereum client"
homepage "https://github.com/hyperledger/besu"
url "${URL}"
# update with: ./updateBesu.sh <new-version>
sha256 "${HASH}"
depends_on "openjdk" => "21+"
def install
prefix.install "lib"
bin.install "bin/besu"
bin.install "bin/evmtool"
end
test do
system "#{bin}/besu" "--version"
end
end
EOF
echo "New url: ${URL}"
echo "New hash: ${HASH}"
echo "Success. Commit the changes to besu.rb to release."