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.11.0", revision: "a3aacebe93d6d41e39fd2f6a4732d35cc3cc9940" license "Apache-2.0" bottle do sha256 cellar: :any_skip_relocation, all: "ca2d21eb0f3ea9e5d8c50203684a52d2a20569004607e110d884153fb9f8a2fa" 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