@@ -0,0 +1,34 @@
1+{ stdenv, lib, buildGoModule, fetchFromGitHub }:
2+
3+buildGoModule rec {
4+ pname = "erigon";
5+ version = "2021.08.01";
6+
7+ src = fetchFromGitHub {
8+ owner = "ledgerwatch";
9+ repo = pname;
10+ rev = "v${version}";
11+ sha256 = "sha256-fjMkCCeQa/IHB4yXlL7Qi8J9wtZm90l3xIA72LeoW8M=";
12+ };
13+
14+ vendorSha256 = "1vsgd19an592dblm9afasmh8cd0x2frw5pvnxkxd2fikhy2mibbs";
15+ runVend = true;
16+
17+ # Build errors in mdbx when format hardening is enabled:
18+ # cc1: error: '-Wformat-security' ignored without '-Wformat' [-Werror=format-security]
19+ hardeningDisable = [ "format" ];
20+
21+ subPackages = [
22+ "cmd/erigon"
23+ "cmd/evm"
24+ "cmd/rpcdaemon"
25+ "cmd/rlpdump"
26+ ];
27+
28+ meta = with lib; {
29+ homepage = "https://github.com/ledgerwatch/erigon/";
30+ description = "Ethereum node implementation focused on scalability and modularity";
31+ license = with licenses; [ lgpl3Plus gpl3Plus ];
32+ maintainers = with maintainers; [ d-xo ];
33+ };
34+}