Merge pull request #207020 from Homebrew/bump-qpdf-11.10.0
[Homebrew/homebrew-core.git] / Formula / e / erigon.rb
blob2f4c1f3f6f82aa05367fd29d0df532b5de77bce1
1 class Erigon < Formula
2   desc "Implementation of Ethereum (execution client), on the efficiency frontier"
3   homepage "https://github.com/ledgerwatch/erigon"
4   url "https://github.com/ledgerwatch/erigon/archive/refs/tags/v2.55.1.tar.gz"
5   sha256 "2e340bb5504f565bb9fe8c4d246dea50bd54bfcf6a91e9196aeb4fbda722ae9e"
6   license all_of: ["GPL-3.0-or-later", "LGPL-3.0-or-later"]
7   head "https://github.com/ledgerwatch/erigon.git", branch: "devel"
9   bottle do
10     sha256 cellar: :any_skip_relocation, arm64_sequoia:  "450e82a964c4c0f8091ae2ffab8cfc741e77d44c1752ee6f2eaa660044c16975"
11     sha256 cellar: :any_skip_relocation, arm64_sonoma:   "ae35586de98a7067a18a36323c65a8573fd2a5cf3c4467efa1daa7f625b72edc"
12     sha256 cellar: :any_skip_relocation, arm64_ventura:  "1b3595711fe008717c82ccfa82836e9753f2319b7f66c2848ee4f891879737b5"
13     sha256 cellar: :any_skip_relocation, arm64_monterey: "e976d99a3ee32f34a3fa3dedfc5c84dbe348781034c72ba26510c954ca1076d2"
14     sha256 cellar: :any_skip_relocation, sonoma:         "4fe3b15261883faf113b87f3373d9b26e4119c607c456d6ac62415974534b32e"
15     sha256 cellar: :any_skip_relocation, ventura:        "6a0bbabd1ab15aa833c7311b3d13fbf176002fc5695e26ce9cf5a821f1f0e9f1"
16     sha256 cellar: :any_skip_relocation, monterey:       "6e2fe466bbb29af8ef4d9d5f06767ac32188730a3bb276b9f0cfd4227ed64acd"
17     sha256 cellar: :any_skip_relocation, x86_64_linux:   "d66f64987e1828b5098e40d6ec7e4fe4ece0240059d2151abca6f9959f6c88aa"
18   end
20   # Upstream includes pre-built libsilkworm_capi inside silkworm-go and recommends copying to installation:
21   # https://github.com/ledgerwatch/erigon?tab=readme-ov-file#how-to-run-erigon-as-a-separate-user-eg-as-a-systemd-daemon
22   # Trying to build library from source only works with `conan` which would use their pre-built libraries.
23   deprecate! date: "2024-02-29", because: "needs a pre-built copy of libsilkworm_capi"
25   depends_on "gcc" => :build
26   depends_on "go" => :build
28   conflicts_with "ethereum", because: "both install `evm` binaries"
30   def install
31     unless build.head?
32       ENV["GIT_COMMIT"] = "unknown"
33       ENV["GIT_BRANCH"] = "release"
34       ENV["GIT_TAG"] = "v#{version}"
35     end
37     system "make", "all"
38     bin.install Dir["build/bin/*"]
39   end
41   test do
42     (testpath/"genesis.json").write <<~JSON
43       {
44         "config": {
45           "homesteadBlock": 10
46         },
47         "nonce": "0",
48         "difficulty": "0x20000",
49         "mixhash": "0x00000000000000000000000000000000000000647572616c65787365646c6578",
50         "coinbase": "0x0000000000000000000000000000000000000000",
51         "timestamp": "0x00",
52         "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
53         "extraData": "0x",
54         "gasLimit": "0x2FEFD8",
55         "alloc": {}
56       }
57     JSON
58     args = %W[
59       --datadir testchain
60       --log.dir.verbosity debug
61       --log.dir.path #{testpath}
62     ]
63     system bin/"erigon", *args, "init", "genesis.json"
64     assert_predicate testpath/"erigon.log", :exist?
65   end
66 end