43 lines
1.5 KiB
Ruby
43 lines
1.5 KiB
Ruby
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.7.3.tar.gz"
|
|
sha256 "64a9f19eeccb3c094e7f9d2d936cd2d48aee3a2cc03148b980e0462c7579a73a"
|
|
head "https://github.com/ethereum/go-ethereum.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "69b4c02bf98f3ea9b5ad1e102bd649b3c53308a4c333cd8b3812c3b62142709c" => :high_sierra
|
|
sha256 "b9e4abf283c2217ab55b096854118d1c92109097e9b07d12a2c8f7ed4baa14ac" => :sierra
|
|
sha256 "5a3489fa62774a94c3dc45197501a5006d9dd53361fd784b8afb07c19d6df058" => :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
|