Skip to content

Commit

Permalink
Merge branch 'nix-community:main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
PetarKirov authored May 12, 2024
2 parents 9594731 + 6b4208f commit 471fbe3
Show file tree
Hide file tree
Showing 13 changed files with 183 additions and 354 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</a>
</p>

Ethereum.nix is a collection of [Nix](https://nixos.org) packages and [NixOS](https://nixos.wiki/wiki/NixOS_modules) modules
Ethereum.nix is a collection of [Nix](https://nixos.org) packages and [NixOS](https://wiki.nixos.org/wiki/NixOS_modules) modules
designed to make it easier to operate [Ethereum](https://ethereum.org) related services and infrastructure.

For the uninitiated, using Ethereum.nix will give you the following benefits:
Expand Down
2 changes: 1 addition & 1 deletion docs/apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Utilities and applications can't be categorized into any category of the above.
| [ethdo](https://github.com/wealdtech/ethdo) | `nix run .#ethdo` |
| [ethereal](https://github.com/wealdtech/ethereal) | `nix run .#ethereal` |
| [sedge](https://github.com/NethermindEth/sedge) | `nix run .#sedge` |
| [staking-deposit-cli](https://github.com/ethereum/staking-deposit-cli) | `nix run .#deposit` |
| [staking-deposit-cli](https://github.com/ethereum/staking-deposit-cli) | `nix run .#staking-deposit-cli` |
| [tx-fuzz](https://github.com/MariusVanDerWijden/tx-fuzz) | `nix run .#tx-fuzz` |
| [zcli](https://github.com/protolambda/zcli) | `nix run .#zcli` |

Expand Down
24 changes: 12 additions & 12 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 31 additions & 6 deletions pkgs/besu/default.nix
Original file line number Diff line number Diff line change
@@ -1,35 +1,60 @@
{
fetchurl,
jemalloc,
jre,
lib,
makeWrapper,
runCommand,
stdenv,
testers,
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: rec {
pname = "besu";
version = "24.1.2";
version = "24.3.3";

src = fetchurl {
url = "https://hyperledger.jfrog.io/hyperledger/${pname}-binaries/${pname}/${version}/${pname}-${version}.tar.gz";
hash = "sha256-CC24z0+2dSeqDddX5dJUs7SX9QJ8Iyh/nAp0pqdDvwg=";
hash = "sha256-ua7lGVIYf/VQ3kgfLAQFE3uF8dCqOCYWDfbX5QXzWa4=";
};

buildInputs = lib.optionals stdenv.isLinux [jemalloc];
nativeBuildInputs = [makeWrapper];

installPhase = ''
mkdir -p $out/bin
cp -r bin $out/
mkdir -p $out/lib
cp -r lib $out/
wrapProgram $out/bin/${pname} --set JAVA_HOME "${jre}"
wrapProgram $out/bin/${pname} --set JAVA_HOME "${jre}" --suffix ${
if stdenv.isDarwin
then "DYLD_LIBRARY_PATH"
else "LD_LIBRARY_PATH"
} : ${lib.makeLibraryPath buildInputs}
'';

passthru.tests = {
version = testers.testVersion {
package = finalAttrs.finalPackage;
version = "v${version}";
};
jemalloc =
runCommand "${pname}-test-jemalloc"
{
nativeBuildInputs = [finalAttrs.finalPackage];
meta.platforms = with lib.platforms; linux;
} ''
# Expect to find this string in the output, ignore other failures.
(besu 2>&1 || true) | grep -q "# jemalloc: ${jemalloc.version}"
mkdir $out
'';
};

meta = with lib; {
description = "Besu is an Apache 2.0 licensed, MainNet compatible, Ethereum client written in Java";
homepage = "https://github.com/hyperledger/besu";
license = licenses.asl20;
mainProgram = "besu";
platforms = ["x86_64-linux"];
platforms = ["aarch64-darwin" "x86_64-linux"];
sourceProvenance = with sourceTypes; [binaryBytecode];
};
}
})
3 changes: 3 additions & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
});
eth2-testnet-genesis = callPackage ./eth2-testnet-genesis {inherit bls;};
eth2-val-tools = callPackage ./eth2-val-tools {inherit bls mcl;};
eth-validator-watcher = callPackage ./eth-validator-watcher {};
ethdo = callPackage ./ethdo {inherit bls mcl;};
ethereal = callPackage ./ethereal {inherit bls mcl;};
evmc = callPackage ./evmc {};
Expand Down Expand Up @@ -71,6 +72,7 @@
rotki-bin = callPackage ./rotki-bin {};
sedge = callPackage ./sedge {inherit bls mcl;};
slither = callPackage ./slither {};
snarkjs = callPackage ./snarkjs {};
ssvnode = callPackage ./ssvnode {inherit bls mcl;};
staking-deposit-cli = callPackage ./staking-deposit-cli {};
teku = callPackage ./teku {};
Expand Down Expand Up @@ -138,6 +140,7 @@
rotki-bin.bin = "rotki";
sedge.bin = "sedge";
slither.bin = "slither";
snarkjs.bin = "snarkjs";
ssvnode.bin = "ssvnode";
staking-deposit-cli.bin = "deposit";
teku.bin = "teku";
Expand Down
40 changes: 40 additions & 0 deletions pkgs/eth-validator-watcher/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
lib,
python3,
fetchFromGitHub,
}:
python3.pkgs.buildPythonPackage rec {
pname = "eth-validator-watcher";
version = "0.7.1";
pyproject = true;

src = fetchFromGitHub {
owner = "kilnfi";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-OhrThxzyuBSSdN/MM4wOj0yebVa219uQDW+o0xtsgTg=";
};

nativeBuildInputs = with python3.pkgs; [
poetry-core
];

propagatedBuildInputs = with python3.pkgs; [
typer
prometheus-client
pydantic
requests
slack-sdk
tenacity
more-itertools
];

meta = with lib; {
description = "Ethereum validator monitor";
longDescription = '' Ethereum Validator Watcher monitors the Ethereum beacon
chain in real-time and notifies you when your validators perform certain actions. '';
homepage = "https://github.com/kilnfi/eth-validator-watcher";
license = licenses.mit;
platforms = ["x86_64-linux"];
};
}
Loading

0 comments on commit 471fbe3

Please sign in to comment.