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.12.0",
|
|
revision: "1a249bc53c52f8d7305224d80d55915aa949ce52"
|
|
license "Apache-2.0"
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "629516a9c6ce06f1a68eabfbb7b6e71746fe91a6ed5e2017e6710a183e1995a8"
|
|
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
|