class Geth < Formula desc "Official Go implementation of the Ethereum protocol" homepage "https://ethereum.github.io/go-ethereum/" url "https://github.com/ethereum/go-ethereum/archive/v1.8.2.tar.gz" sha256 "9e3b744d347f326b7e21b697379173df102139dc13210b9ef55c1ff9659e8843" head "https://github.com/ethereum/go-ethereum.git" bottle do cellar :any_skip_relocation sha256 "751881b275e7fb4c00e243929061ab053cefb227914dad000b7e2650aac4c927" => :high_sierra sha256 "f766ded804de2820a084efb76cb71d4ae0807f43484b184041d8d60890c77935" => :sierra sha256 "18a78ca758d85b2b081cb3bd6068f21c739b9d02834f92bed25c482aa3c9b4fb" => :el_capitan end depends_on "go" => :build def install system "make", "all" bin.install Dir["build/bin/*"] end test do (testpath/"genesis.json").write <<~EOS { "config": { "homesteadBlock": 10 }, "nonce": "0", "difficulty": "0x20000", "mixhash": "0x00000000000000000000000000000000000000647572616c65787365646c6578", "coinbase": "0x0000000000000000000000000000000000000000", "timestamp": "0x00", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "extraData": "0x", "gasLimit": "0x2FEFD8", "alloc": {} } EOS system "#{bin}/geth", "--datadir", "testchain", "init", "genesis.json" assert_predicate testpath/"testchain/geth/chaindata/000001.log", :exist?, "Failed to create log file" end end