Skip to content

Commit

Permalink
Migrate into besu from pantheon (#2)
Browse files Browse the repository at this point in the history
Include the update to 1.2.4

Signed-off-by: Edward Evans <[email protected]>
  • Loading branch information
EdJoJob authored Sep 24, 2019
1 parent 8355265 commit 9ceb537
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# homebrew-besu
[![RocketChat chat](https://open.rocket.chat/images/join-chat.svg)](https://chat.hyperledger.org/channel/besu)
[![Documentation Status](https://readthedocs.org/projects/hyperledger-besu/badge/?version=latest)](https://besu.hyperledger.org/en/latest/?badge=latest)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/hyperledger/homebrew-besu/blob/master/LICENSE)
Homebrew Tap for besu.

## Getting started
Add the tap, and install:

```
brew tap hyperledger/besu
brew install besu
```
Run the besu executable:

```
besu --help
```

Refer to the [besu docs](https://besu.hyperledger.org) for further information.

To upgrade besu:
```
brew tap hyperledger/besu
brew upgrade besu
```
18 changes: 18 additions & 0 deletions besu.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class Besu < Formula
desc "hyperledger besu ethereum client"
homepage "https://github.com/hyperledger/besu"
url "https://dl.bintray.com/hyperledger-org/besu-repo/besu-1.2.4.zip"
# update with: ./updateBesu.sh <new-version>
sha256 "8df0adb5a15c28cf4c177e40a10c9721ec0ec74a7037d5c8043c06bc04b74097"

depends_on :java => "11+"

def install
prefix.install "lib"
bin.install "bin/besu"
end

test do
system "#{bin}/besu" "--version"
end
end
43 changes: 43 additions & 0 deletions updateBesu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/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://dl.bintray.com/hyperledger-org/besu-repo/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 :java => "11+"
def install
prefix.install "lib"
bin.install "bin/besu"
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."

0 comments on commit 9ceb537

Please sign in to comment.