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.10.0",
|
|
revision: "ae21d1cf339f1517692fb3735bb99161e4ab28cf"
|
|
license "Apache-2.0"
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "c0bbb1c2ae37a62038b0aacd3c982eae2db37c667a34e5739848a4290ed35db8"
|
|
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
|