From 59ec71648a3d911acb25c429d832cd46b0e47efa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marijan=20Petri=C4=8Devi=C4=87?= Date: Thu, 29 Aug 2024 11:10:22 +0200 Subject: [PATCH 1/3] remove empty file --- src/cctl.rs | 1 - 1 file changed, 1 deletion(-) delete mode 100644 src/cctl.rs diff --git a/src/cctl.rs b/src/cctl.rs deleted file mode 100644 index 8b13789..0000000 --- a/src/cctl.rs +++ /dev/null @@ -1 +0,0 @@ - From 307577520f645be3dbefc454b63857ba1efd827d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marijan=20Petri=C4=8Devi=C4=87?= Date: Thu, 29 Aug 2024 11:11:44 +0200 Subject: [PATCH 2/3] flake: rename outputs, remove cctl_2 input --- flake.lock | 205 +++++++---------------------------------------------- flake.nix | 10 ++- 2 files changed, 30 insertions(+), 185 deletions(-) diff --git a/flake.lock b/flake.lock index 6a036a0..8d0b322 100644 --- a/flake.lock +++ b/flake.lock @@ -21,18 +21,18 @@ "darwin": "darwin", "home-manager": "home-manager", "nixpkgs": [ - "cctl-2", + "cctl", "csprpkgs", "nixpkgs" ], - "systems": "systems_2" + "systems": "systems" }, "locked": { - "lastModified": 1712079060, - "narHash": "sha256-/JdiT9t+zzjChc5qQiF+jhrVhRt8figYH29rZO7pFe4=", + "lastModified": 1722339003, + "narHash": "sha256-ZeS51uJI30ehNkcZ4uKqT4ZDARPyqrHADSKAwv5vVCU=", "owner": "ryantm", "repo": "agenix", - "rev": "1381a759b205dff7a6818733118d02253340fd5e", + "rev": "3f1dae074a12feb7327b4bf43cbac0d124488bb7", "type": "github" }, "original": { @@ -49,7 +49,7 @@ "csprpkgs", "nixpkgs" ], - "systems": "systems_4" + "systems": "systems_2" }, "locked": { "lastModified": 1722339003, @@ -94,34 +94,6 @@ "type": "github" } }, - "cctl-2": { - "inputs": { - "csprpkgs": "csprpkgs_2", - "nixpkgs": [ - "cctl-2", - "csprpkgs", - "nixpkgs" - ], - "rust-overlay": [ - "cctl-2", - "csprpkgs", - "rust-overlay" - ] - }, - "locked": { - "lastModified": 1723558192, - "narHash": "sha256-Y9Ct935VyCdOIYfl+QDNAE2bMCnDJOu2HCwZnm/mbsI=", - "owner": "casper-network", - "repo": "cctl", - "rev": "2da83ec5e50c64bd8d7f9c6c986c1da375465678", - "type": "github" - }, - "original": { - "owner": "casper-network", - "repo": "cctl", - "type": "github" - } - }, "crane": { "inputs": { "nixpkgs": [ @@ -144,15 +116,16 @@ }, "csprpkgs": { "inputs": { + "agenix": "agenix", "nixpkgs": "nixpkgs", "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1712271889, - "narHash": "sha256-5t8QSUeIyDpHCOB+PnS3wtFqAjNf07X0wZhxZb+J/qk=", + "lastModified": 1724854505, + "narHash": "sha256-ax1Jxgd47kmK6ZY7lm0KheDLm6DyqZRZlGY+3f9XYWU=", "owner": "cspr-rad", "repo": "csprpkgs", - "rev": "9d01d5c63ff179ee8c42cdcbf8cf892c96c0a0b1", + "rev": "3bc835d3b73a5d5a5829f3b8506f51a9cd098abd", "type": "github" }, "original": { @@ -163,48 +136,29 @@ }, "csprpkgs_2": { "inputs": { - "agenix": "agenix", + "agenix": "agenix_2", "nixpkgs": "nixpkgs_2", "rust-overlay": "rust-overlay_2" }, "locked": { - "lastModified": 1722410860, - "narHash": "sha256-aL5bf+/X3YR+uqVgD6t1tT23Xw47XJDfE2tXQ2uF6uw=", - "owner": "cspr-rad", - "repo": "csprpkgs", - "rev": "ba58f48daf43bfc84467261969b2388ab779b2de", - "type": "github" - }, - "original": { - "owner": "cspr-rad", - "repo": "csprpkgs", - "type": "github" - } - }, - "csprpkgs_3": { - "inputs": { - "agenix": "agenix_2", - "nixpkgs": "nixpkgs_3", - "rust-overlay": "rust-overlay_3" - }, - "locked": { - "lastModified": 1723826679, - "narHash": "sha256-ZL9tppGgOsJi0Z49Lc77mfy3GakX/QbI1CIIKGt4gjs=", + "lastModified": 1724854505, + "narHash": "sha256-ax1Jxgd47kmK6ZY7lm0KheDLm6DyqZRZlGY+3f9XYWU=", "owner": "cspr-rad", "repo": "csprpkgs", - "rev": "2e3b082f9bf3b0239f12dec7246b4d19534b811e", + "rev": "3bc835d3b73a5d5a5829f3b8506f51a9cd098abd", "type": "github" }, "original": { "owner": "cspr-rad", "repo": "csprpkgs", + "rev": "3bc835d3b73a5d5a5829f3b8506f51a9cd098abd", "type": "github" } }, "darwin": { "inputs": { "nixpkgs": [ - "cctl-2", + "cctl", "csprpkgs", "agenix", "nixpkgs" @@ -287,46 +241,10 @@ "type": "github" } }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "inputs": { - "systems": "systems_3" - }, - "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ - "cctl-2", + "cctl", "csprpkgs", "agenix", "nixpkgs" @@ -370,11 +288,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1712192574, - "narHash": "sha256-LbbVOliJKTF4Zl2b9salumvdMXuQBr2kuKP5+ZwbYq4=", + "lastModified": 1722730825, + "narHash": "sha256-X6U+w8qFBuGPCYrZzc9mpN34aRjQ8604MonpBUkj908=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f480f9d09e4b4cf87ee6151eba068197125714de", + "rev": "f3834de3782b82bfc666abf664f946d0e7d1f116", "type": "github" }, "original": { @@ -397,22 +315,6 @@ } }, "nixpkgs_2": { - "locked": { - "lastModified": 1712192574, - "narHash": "sha256-LbbVOliJKTF4Zl2b9salumvdMXuQBr2kuKP5+ZwbYq4=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "f480f9d09e4b4cf87ee6151eba068197125714de", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { "locked": { "lastModified": 1722730825, "narHash": "sha256-X6U+w8qFBuGPCYrZzc9mpN34aRjQ8604MonpBUkj908=", @@ -428,7 +330,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_3": { "locked": { "lastModified": 1724015816, "narHash": "sha256-hVESnM7Eiz93+4DeiE0a1TwMeaeph1ytRJ5QtqxYRWg=", @@ -448,12 +350,11 @@ "inputs": { "advisory-db": "advisory-db", "cctl": "cctl", - "cctl-2": "cctl-2", "crane": "crane", - "csprpkgs": "csprpkgs_3", + "csprpkgs": "csprpkgs_2", "fenix": "fenix", "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_3", "treefmt-nix": "treefmt-nix" } }, @@ -476,7 +377,6 @@ }, "rust-overlay": { "inputs": { - "flake-utils": "flake-utils", "nixpkgs": [ "cctl", "csprpkgs", @@ -484,11 +384,11 @@ ] }, "locked": { - "lastModified": 1706753617, - "narHash": "sha256-ZKqTFzhFwSWFEpQTJ0uXnfJBs5Y/po9/8TK4bzssdbs=", + "lastModified": 1722824458, + "narHash": "sha256-2k3/geD5Yh8JT1nrGaRycje5kB0DkvQA/OUZoel1bIU=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "58be43ae223034217ea1bd58c73210644031b687", + "rev": "a8a937c304e62a5098c6276c9cdf65c19a43b1a5", "type": "github" }, "original": { @@ -498,29 +398,6 @@ } }, "rust-overlay_2": { - "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": [ - "cctl-2", - "csprpkgs", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1706753617, - "narHash": "sha256-ZKqTFzhFwSWFEpQTJ0uXnfJBs5Y/po9/8TK4bzssdbs=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "58be43ae223034217ea1bd58c73210644031b687", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "rust-overlay_3": { "inputs": { "nixpkgs": [ "csprpkgs", @@ -571,36 +448,6 @@ "type": "github" } }, - "systems_3": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_4": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "treefmt-nix": { "inputs": { "nixpkgs": [ diff --git a/flake.nix b/flake.nix index 7ff81b4..76e89c1 100644 --- a/flake.nix +++ b/flake.nix @@ -28,8 +28,7 @@ advisory-db.url = "github:rustsec/advisory-db"; advisory-db.flake = false; cctl.url = "github:casper-network/cctl/947c34b991e37476db82ccfa2bd7c0312c1a91d7"; - cctl-2.url = "github:casper-network/cctl"; - csprpkgs.url = "github:cspr-rad/csprpkgs"; + csprpkgs.url = "github:cspr-rad/csprpkgs/3bc835d3b73a5d5a5829f3b8506f51a9cd098abd"; }; outputs = inputs@{ flake-parts, treefmt-nix, ... }: @@ -44,6 +43,7 @@ rustToolchain = inputs'.fenix.packages.stable.toolchain; craneLib = (inputs.crane.mkLib pkgs).overrideToolchain rustToolchain; + # revision 3bc835d contains casper-node 1.5.7 cctl = inputs'.cctl.packages.cctl.override { casper-node = inputs'.csprpkgs.packages.casper-node; }; cctlAttrs = { @@ -85,12 +85,9 @@ }; packages = { - cctl-rs-deps = craneLib.buildDepsOnly (cctlAttrs // { - pname = "cctl-rs-deps"; - }); + cctl-rs-deps = craneLib.buildDepsOnly cctlAttrs; cctl-rs-docs = craneLib.cargoDoc (cctlAttrs // { - pname = "cctl-rs-docs"; cargoArtifacts = self'.packages.cctl-rs-deps; }); @@ -115,6 +112,7 @@ checks = { lint = craneLib.cargoClippy (cctlAttrs // { + pname = "cctl-rs-lint"; cargoArtifacts = self'.packages.cctl-rs-deps; cargoClippyExtraArgs = "--all-targets -- --deny warnings"; }); From 2246406205d68a876d4512dd3105d3370680eb9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marijan=20Petri=C4=8Devi=C4=87?= Date: Thu, 29 Aug 2024 12:58:18 +0200 Subject: [PATCH 3/3] flake: add docker-image output --- docker-image.nix | 41 +++++++++++++++++++++++++++++++++++++++++ flake.nix | 2 ++ 2 files changed, 43 insertions(+) create mode 100644 docker-image.nix diff --git a/docker-image.nix b/docker-image.nix new file mode 100644 index 0000000..a443348 --- /dev/null +++ b/docker-image.nix @@ -0,0 +1,41 @@ +{ dockerTools +, cctld +, lib +, +}: +dockerTools.buildLayeredImage { + name = "ghcr.io/cspr-rad/cctl-rs"; + tag = "cctl-casper-node-1.5.7"; + extraCommands = '' + mkdir -p tmp + ''; + config = { + Cmd = lib.getExe cctld; + ExposedPorts = { + # RPC ports + "11101/tcp" = { }; + "11102/tcp" = { }; + "11103/tcp" = { }; + "11104/tcp" = { }; + "11105/tcp" = { }; + # REST ports + "14101/tcp" = { }; + "14102/tcp" = { }; + "14103/tcp" = { }; + "14104/tcp" = { }; + "14105/tcp" = { }; + # SSE ports + "18101/tcp" = { }; + "18102/tcp" = { }; + "18103/tcp" = { }; + "18104/tcp" = { }; + "18105/tcp" = { }; + # Consensus ports + "22101/tcp" = { }; + "22102/tcp" = { }; + "22103/tcp" = { }; + "22104/tcp" = { }; + "22105/tcp" = { }; + }; + }; +} diff --git a/flake.nix b/flake.nix index 76e89c1..743b40e 100644 --- a/flake.nix +++ b/flake.nix @@ -108,6 +108,8 @@ }); default = self'.packages.cctld; + + cctl-docker-image = pkgs.callPackage ./docker-image.nix { inherit (self'.packages) cctld; }; }; checks = {