homebrew-core/Formula/ethereum.rb
2019-07-26 02:09:48 +08:00

43 lines
1.5 KiB
Ruby

class Ethereum < 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.9.1.tar.gz"
sha256 "7394ae0eeac4b2aafa4bd56eef18c077088770bbce0962b215607b44369a5430"
head "https://github.com/ethereum/go-ethereum.git"
bottle do
cellar :any_skip_relocation
sha256 "2b239aac0e20d1b750ed068d4bb9984ac0f274da8c0da6706d149415c65f8075" => :mojave
sha256 "b0d73bd2905227453d38586ce598f86230453222eee838bd2ce537238f3ca292" => :high_sierra
sha256 "14af14296078ef8204fa69c43fe34d8b2d64b4befe9d351768a68445a3c02105" => :sierra
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