homebrew-core/Formula/teku.rb

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.1",
revision: "8577e891197fee440c422725e4e00df8105edc31"
license "Apache-2.0"
bottle do
sha256 cellar: :any_skip_relocation, all: "5af6fc8ff35f20d84fe8fd11e62db399c80a7f99d3ea332dbfc01d6f418f605e"
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