Skip to content

Commit

Permalink
use normal nixpkgs and custom geth
Browse files Browse the repository at this point in the history
  • Loading branch information
MrChico committed Aug 5, 2021
1 parent 793070d commit bb70d12
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 4 deletions.
4 changes: 2 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{ system ? builtins.currentSystem , ... }:

let
rev = "3d64b6067f1c457f889e91c59ced273be1d1e4f1";
rev = "aa576357673d609e618d87db43210e49d4bb1789";
nixpkgs = builtins.fetchTarball {
name = "nixpkgs-release-21.05";
url = "https://github.com/nixos/nixpkgs/tarball/${rev}";
sha256 = "0wgmzq2h82wxqh6zkxxxw77rdk75m48rshmjfl3w35pv498wfcwz";
sha256 = "1868s3mp0lwg1jpxsgmgijzddr90bjkncf6k6zhdjqihf0i1n2np";
};
in
# Now return the Nixpkgs configured to use our overlay.
Expand Down
60 changes: 60 additions & 0 deletions nix/geth.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{ lib, stdenv, buildGoModule, fetchFromGitHub, libobjc ? null, IOKit ? null }:

let
# A list of binaries to put into separate outputs
bins = [
"geth"
"clef"
];

in buildGoModule rec {
pname = "go-ethereum";
version = "1.10.6";

src = fetchFromGitHub {
owner = "ethereum";
repo = pname;
rev = "v${version}";
sha256 = "sha256-4lapkoxSKdXlD6rmUxnlSKrfH+DeV6/wV05CqJjuzjA=";
};

runVend = true;
vendorSha256 = "sha256-5qi01y0SIEI0WRYu2I2RN94QFS8rrlioFvnRqqp6wtk=";

doCheck = false;

outputs = [ "out" ] ++ bins;

# Move binaries to separate outputs and symlink them back to $out
postInstall = lib.concatStringsSep "\n" (
builtins.map (bin: "mkdir -p \$${bin}/bin && mv $out/bin/${bin} \$${bin}/bin/ && ln -s \$${bin}/bin/${bin} $out/bin/") bins
);

subPackages = [
"cmd/abidump"
"cmd/abigen"
"cmd/bootnode"
"cmd/checkpoint-admin"
"cmd/clef"
"cmd/devp2p"
"cmd/ethkey"
"cmd/evm"
"cmd/faucet"
"cmd/geth"
"cmd/p2psim"
"cmd/puppeth"
"cmd/rlpdump"
"cmd/utils"
];

# Fix for usb-related segmentation faults on darwin
propagatedBuildInputs =
lib.optionals stdenv.isDarwin [ libobjc IOKit ];

meta = with lib; {
homepage = "https://geth.ethereum.org/";
description = "Official golang implementation of the Ethereum protocol";
license = with licenses; [ lgpl3Plus gpl3Plus ];
maintainers = with maintainers; [ adisbladis lionello xrelkd RaghavSood ];
};
}
13 changes: 11 additions & 2 deletions overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,17 @@ in rec {

# We use this to run private testnets without
# the pesky transaction size limit.
go-ethereum-unlimited = super.go-ethereum.overrideAttrs (geth: rec {
name = "${geth.pname}-unlimited-${geth.version}";
go-ethereum-unlimited = (self.callPackage (import ./nix/geth.nix) {}).overrideAttrs (geth: rec {
version = "1.10.7";

src = super.fetchFromGitHub {
owner = "ethereum";
repo = "go-ethereum";
rev = "v${version}";
sha256 = "0a4l3xisw7d80l1plqk1rwzxiffwvwsvcm1345hzz2xpmxpkd6y4";
};

name = "${geth.pname}-unlimited-${version}";
preConfigure = ''
# Huge transaction calldata
substituteInPlace core/tx_pool.go --replace 'return ErrOversizedData' ""
Expand Down

0 comments on commit bb70d12

Please sign in to comment.