Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

normalize casper-node-config and casper-chainspec #179

Merged
merged 2 commits into from
Aug 9, 2024
Merged
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
29 changes: 13 additions & 16 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,6 @@

cctl = inputs'.cctl.packages.cctl.override { casper-node = inputs'.csprpkgs.packages.casper-node; };

# TODO reuse in nixos tests
cctlConfig = {
chainspec = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/cspr-rad/casper-node/a8ba82edc949959ea3240f06cc9d64db50d42d64/resources/production/chainspec.toml";
hash = "sha256-tStzzhCa/NtmmvMcPjkpB23RN8qhDjAYkMOjo2Tvess=";
};
config = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/cspr-rad/casper-node/53136ac5f004f2ae70a75b4eeb2ff7d907aff6aa/resources/local/config.toml";
hash = "sha256-ZuNbxw0nBjuONEZRK8Ru96zZQak4MEQ/eM1fA6esyCM=";
};
};

kairosContractsAttrs = {
src = lib.cleanSourceWith {
src = lib.fileset.toSource {
Expand Down Expand Up @@ -182,8 +170,8 @@

PATH_TO_WASM_BINARIES = "${self'.packages.kairos-contracts}/bin";
PATH_TO_SESSION_BINARIES = "${self'.packages.kairos-session-code}/bin";
CCTL_CONFIG = "${cctlConfig.config}";
CCTL_CHAINSPEC = "${cctlConfig.chainspec}";
CCTL_CONFIG = self'.packages.casper-node-config;
CCTL_CHAINSPEC = self'.packages.casper-chainspec;
KAIROS_SERVER_MIGRATIONS = kairosServerMigrations;

meta.mainProgram = "kairos-server";
Expand All @@ -196,8 +184,8 @@
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER = "lld";
PATH_TO_WASM_BINARIES = "${self'.packages.kairos-contracts}/bin";
PATH_TO_SESSION_BINARIES = "${self'.packages.kairos-session-code}/bin";
CCTL_CONFIG = "${cctlConfig.config}";
CCTL_CHAINSPEC = "${cctlConfig.chainspec}";
CCTL_CONFIG = self'.packages.casper-node-config;
CCTL_CHAINSPEC = self'.packages.casper-chainspec;
KAIROS_SERVER_MIGRATIONS = kairosServerMigrations;
inputsFrom = [ self'.packages.kairos self'.packages.kairos-contracts ];
packages = [ pkgs.diesel-cli ];
Expand Down Expand Up @@ -254,6 +242,15 @@
kairos-session-code = craneLib.buildPackage (kairosSessionCodeAttrs // {
pname = "kairos-session-code";
});

casper-chainspec = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/cspr-rad/casper-node/a8ba82edc949959ea3240f06cc9d64db50d42d64/resources/production/chainspec.toml";
hash = "sha256-tStzzhCa/NtmmvMcPjkpB23RN8qhDjAYkMOjo2Tvess=";
};
casper-node-config = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/cspr-rad/casper-node/53136ac5f004f2ae70a75b4eeb2ff7d907aff6aa/resources/local/config.toml";
hash = "sha256-ZuNbxw0nBjuONEZRK8Ru96zZQak4MEQ/eM1fA6esyCM=";
};
};

checks = {
Expand Down
2 changes: 1 addition & 1 deletion nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ in
./tests/end-to-end.nix
{
inherit mkKairosHostConfig;
inherit (self.packages.${pkgs.system}) kairos kairos-contracts casper-client-rs;
inherit (self.packages.${pkgs.system}) kairos kairos-contracts casper-client-rs casper-node-config casper-chainspec;
cctlModule = self.nixosModules.cctl;
};
};
Expand Down
12 changes: 4 additions & 8 deletions nixos/tests/end-to-end.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
, fetchurl
, casper-client-rs
, writeShellScript
, casper-chainspec
, casper-node-config
, jq
}:
let
Expand Down Expand Up @@ -44,14 +46,8 @@ nixosTest {
port = cctlPort;
workingDirectory = cctlWorkingDirectory;
contract = { "${contractHashName}" = kairos-contracts + "/bin/demo-contract-optimized.wasm"; };
chainspec = fetchurl {
url = "https://raw.githubusercontent.com/cspr-rad/casper-node/53136ac5f004f2ae70a75b4eeb2ff7d907aff6aa/resources/local/chainspec.toml.in";
hash = "sha256-b/6c5o3JXFlaTgTHxs8JepaHzjMG75knzlKKqRd/7pc=";
};
config = fetchurl {
url = "https://raw.githubusercontent.com/cspr-rad/casper-node/53136ac5f004f2ae70a75b4eeb2ff7d907aff6aa/resources/local/config.toml";
hash = "sha256-ZuNbxw0nBjuONEZRK8Ru96zZQak4MEQ/eM1fA6esyCM=";
};
chainspec = casper-chainspec;
config = casper-node-config;
};

services.kairos = {
Expand Down
Loading