Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
set dotenv-load := true

root-dir := justfile_directory()
result-dir := root-dir / ".result"
gc-roots-dir := result-dir / "gc-roots"
nix := `if tty -s; then echo nom; else echo nix; fi`
cachix-cache-name := `echo ${CACHIX_CACHE:-}`

os := if os() == "macos" { "darwin" } else { "linux" }
arch := arch()
system:= arch + "-" + os

default:
@just --list

get-system:
@echo {{ system }}

eval-packages eval-system=system:
#!/usr/bin/env bash
set -euo pipefail
source "{{root-dir}}/scripts/nix-eval-jobs.sh"
nix_eval_jobs legacyPackages.{{eval-system}}.metacraft-labs

generate-matrix:
"{{root-dir}}/scripts/ci-matrix.sh"
23 changes: 21 additions & 2 deletions checks/packages-ci-matrix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,31 @@
inherit (lib) optionalAttrs;
inherit (pkgs) system;
inherit (pkgs.hostPlatform) isLinux;

reexportedPackages = {
ethereum_nix =
{
# geth = inputs'.ethereum_nix.packages.geth; # TODO: re-enable when flake show/check passes
}
// lib.optionalAttrs (pkgs.hostPlatform.isx86 && pkgs.hostPlatform.isLinux) {
# nimbus = inputs'.ethereum_nix.packages.nimbus-eth2; # TODO: re-enable when flake show/check passes
};
# noir = {
# nargo = inputs'.noir.packages.nargo;
# noirc_abi_wasm = inputs'.noir.packages.noirc_abi_wasm;
# acvm_js = inputs'.noir.packages.acvm_js;
# };
};

disabledPackages = [
#"circ" # has been fixed
];
in
rec {
checks =
self'.packages
(builtins.removeAttrs self'.packages disabledPackages)
// reexportedPackages.ethereum_nix
// {
inherit (self'.legacyPackages) rustToolchain;
inherit (self'.legacyPackages.inputs.dlang-nix) dub;
inherit (self'.legacyPackages.inputs.nixpkgs)
cachix
Expand Down
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
self,
nixpkgs,
flake-parts,
crane,
...
}:
let
Expand All @@ -218,6 +219,7 @@
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.flake-parts.flakeModules.modules
inputs.flake-parts.flakeModules.easyOverlay
./checks
./modules
./packages
Expand Down
40 changes: 40 additions & 0 deletions packages/avalanche-cli/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
lib,
buildGoModule,
fetchFromGitHub,
blst,
libusb1,
}:
buildGoModule rec {
pname = "avalanche-cli";
version = "unstable-2024-11-23";

src = fetchFromGitHub {
owner = "ava-labs";
repo = "avalanche-cli";
rev = "6debe4169dce2c64352d8c9d0d0acac49e573661";
hash = "sha256-kYEgKpR6FM3f6Lq3Wxhi8MVh8ojxyqFYgjeu2E8lNcs=";
};

proxyVendor = true;
vendorHash = "sha256-FLuu2Q9O4kPtdT1LWaClv+96G0m0PFpZx22506V+Sts=";

doCheck = false;

ldflags = [
"-X=github.com/ava-labs/avalanche-cli/cmd.Version=${version}"
];

buildInputs = [
blst
libusb1
];

meta = {
description = "";
homepage = "https://github.com/ava-labs/avalanche-cli";
# FIXME: nix-init did not find a license
maintainers = with lib.maintainers; [ ];
mainProgram = "avalanche-cli";
};
}
17 changes: 17 additions & 0 deletions packages/blst/builder.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
source $stdenv/setup

buildPhase() {
./build.sh
}

installPhase() {
mkdir -p $out/{include/elf,lib}
cp libblst.a $out/lib/
cp bindings/*.{h,hpp} $out/include/
cp build/assembly.S $out/include/
cp build/elf/* $out/include/elf/
cp src/*.h $out/include/
cp src/*.c $out/include/
}

genericBuild
28 changes: 28 additions & 0 deletions packages/blst/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
stdenv,
fetchFromGitHub,
}:
stdenv.mkDerivation rec {
pname = "blst";
version = "0.3.11";

src = fetchFromGitHub {
owner = "supranational";
repo = "blst";
rev = "v${version}";
hash = "sha256-oqljy+ZXJAXEB/fJtmB8rlAr4UXM+Z2OkDa20gpILNA=";
};

builder = ./builder.sh;

meta = {
description = "Multilingual BLS12-381 signature library";
homepage = "https://github.com/supranational/blst";
platforms = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
};
}
50 changes: 50 additions & 0 deletions packages/bnb-beacon-node/config/gentxs/node0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"type": "auth/StdTx",
"value": {
"msg": [
{
"type": "cosmos-sdk/MsgCreateValidatorProposal",
"value": {
"MsgCreateValidator": {
"Description": {
"moniker": "node0",
"identity": "",
"website": "",
"details": ""
},
"Commission": {
"rate": "0",
"max_rate": "0",
"max_change_rate": "0"
},
"delegator_address": "bnb16sju6kxjcz7sxa2g3kf6kp3zvzf4g84jwvjh0h",
"validator_address": "bva16sju6kxjcz7sxa2g3kf6kp3zvzf4g84jwsn83n",
"pubkey": {
"type": "tendermint/PubKeyEd25519",
"value": "UaSCGHI+ZgEU+HPpPjtoWzro9k05g0UIdI8G/QrPFDs="
},
"delegation": {
"denom": "BNB",
"amount": "9000000000000"
}
},
"proposal_id": "0"
}
}
],
"signatures": [
{
"pub_key": {
"type": "tendermint/PubKeySecp256k1",
"value": "A/oj5bQgZ8GduPeclMYVH4ARYtg7cBQWnDLL8oTSwDDv"
},
"signature": "kNT3hPTKMUhEqOS7F6VjQSZY8w5zTfmSM1merVgMOcIEoeqXYiWUSxWUzwBcIL7FfI2LOWHbUnrj5i4nZWR8pQ==",
"account_number": "0",
"sequence": "0"
}
],
"memo": "[email protected]:26656",
"source": "0",
"data": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"secret":"paddle bullet neck stage bottom link require hawk rough consider fold zebra tissue wreck cake produce subway double cram cereal open ice element salt"}
Loading