37 lines
1.1 KiB
Ruby
37 lines
1.1 KiB
Ruby
class Teku < Formula
|
|
desc "Java Implementation of the Ethereum 2.0 Beacon Chain"
|
|
homepage "https://docs.teku.consensys.net/"
|
|
url "https://github.com/ConsenSys/teku.git",
|
|
tag: "22.9.0",
|
|
revision: "03e5a3431b82e727974f77bbbec3eb63df5c4dca"
|
|
license "Apache-2.0"
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "93386b030dbf592e2d60c698548ab52e66e298fb7da1a70ffd36956ffb9a83da"
|
|
end
|
|
|
|
depends_on "gradle" => :build
|
|
depends_on "openjdk"
|
|
|
|
def install
|
|
system "gradle", "installDist"
|
|
|
|
libexec.install Dir["build/install/teku/*"]
|
|
|
|
(bin/"teku").write_env_script libexec/"bin/teku", Language::Java.overridable_java_home_env
|
|
end
|
|
|
|
test do
|
|
assert_match "teku/", shell_output("#{bin}/teku --version")
|
|
|
|
rest_port = free_port
|
|
fork do
|
|
exec bin/"teku", "--rest-api-enabled", "--rest-api-port=#{rest_port}", "--p2p-enabled=false", "--ee-endpoint=http://127.0.0.1"
|
|
end
|
|
sleep 15
|
|
|
|
output = shell_output("curl -sS -XGET http://127.0.0.1:#{rest_port}/eth/v1/node/syncing")
|
|
assert_match "is_syncing", output
|
|
end
|
|
end
|