Skip to content

Commit 81e6e0b

Browse files
feat(nix): fixup composable node name and integrate revision
1 parent 3631796 commit 81e6e0b

File tree

7 files changed

+24
-22
lines changed

7 files changed

+24
-22
lines changed

.github/workflows/release-artifacts.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ jobs:
171171
- name: Release docker image
172172
run: |
173173
docker load --input ./composable-docker-image
174-
docker tag composable-node-release-${{ env.COMPOSABLE_VERSION }}:latest "${{ env.DOCKER_REGISTRY_NAME }}/composable:v${{ env.COMPOSABLE_VERSION }}"
174+
docker tag composable:latest "${{ env.DOCKER_REGISTRY_NAME }}/composable:v${{ env.COMPOSABLE_VERSION }}"
175175
docker push "${{ env.DOCKER_REGISTRY_NAME }}/composable:v${{ env.COMPOSABLE_VERSION }}"
176176
177177
- name: Get commit

code/Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

code/parachain/node/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build = "build.rs"
44
edition = "2021"
55
homepage = "https://composable.finance"
66
name = "composable-node"
7-
version = "2.1.6"
7+
version = "2.3.2"
88

99
[package.metadata.docs.rs]
1010
targets = ["x86_64-unknown-linux-gnu"]

flake.nix

+17-15
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
# nixConfig.sandbox = "relaxed";
66
inputs = {
77
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
8-
flake-utils = {
9-
url = "github:numtide/flake-utils";
10-
inputs.nixpkgs.follows = "nixpkgs";
11-
};
8+
flake-utils = { url = "github:numtide/flake-utils"; };
129
rust-overlay = {
1310
url = "github:oxalica/rust-overlay";
1411
inputs.nixpkgs.follows = "nixpkgs";
@@ -290,36 +287,41 @@
290287
# /nix/store/523zlfzypzcr969p058i6lcgfmg889d5-stdenv-linux/setup: line 1393: --message-format: command not found
291288
composable-node = with packages;
292289
crane-nightly.buildPackage (common-attrs // {
293-
pnameSuffix = "-node";
290+
name = "composable";
294291
cargoArtifacts = common-deps;
295292
cargoBuildCommand =
296293
"cargo build --release --package composable --features=builtin-wasm";
297294
DALI_RUNTIME = "${dali-runtime}/lib/runtime.optimized.wasm";
298295
PICASSO_RUNTIME = "${picasso-runtime}/lib/runtime.optimized.wasm";
299296
COMPOSABLE_RUNTIME =
300297
"${composable-runtime}/lib/runtime.optimized.wasm";
298+
SUBSTRATE_CLI_GIT_COMMIT_HASH = self.rev or "dirty";
301299
installPhase = ''
302300
mkdir -p $out/bin
303-
cp target/release/composable $out/bin/composable-node
301+
cp target/release/composable $out/bin/composable
304302
'';
305-
meta = { mainProgram = "composable-node"; };
303+
meta = { mainProgram = "composable"; };
306304
});
307305

308306
composable-node-release = crane-nightly.buildPackage (common-attrs
309307
// {
310-
pnameSuffix = "-node-release";
308+
name = "composable";
311309
cargoArtifacts = common-deps;
312310
cargoBuildCommand = "cargo build --release --package composable";
311+
SUBSTRATE_CLI_GIT_COMMIT_HASH = if self ? rev then
312+
self.rev
313+
else
314+
builtins.abort "Cannot build the release node in a dirty repo.";
313315
installPhase = ''
314316
mkdir -p $out/bin
315-
cp target/release/composable $out/bin/composable-node
317+
cp target/release/composable $out/bin/composable
316318
'';
317-
meta = { mainProgram = "composable-node"; };
319+
meta = { mainProgram = "composable"; };
318320
});
319321

320322
composable-bench-node = crane-nightly.cargoBuild (common-bench-attrs
321323
// {
322-
pnameSuffix = "-node";
324+
name = "composable";
323325
cargoArtifacts = common-bench-deps;
324326
cargoBuildCommand = "cargo build --release --package composable";
325327
DALI_RUNTIME = "${dali-bench-runtime}/lib/runtime.optimized.wasm";
@@ -329,14 +331,14 @@
329331
"${composable-bench-runtime}/lib/runtime.optimized.wasm";
330332
installPhase = ''
331333
mkdir -p $out/bin
332-
cp target/release/composable $out/bin/composable-node
334+
cp target/release/composable $out/bin/composable
333335
'';
334-
meta = { mainProgram = "composable-node"; };
336+
meta = { mainProgram = "composable"; };
335337
});
336338

337339
run-with-benchmarks = chain:
338340
writeShellScriptBin "run-benchmarks-once" ''
339-
${composable-bench-node}/bin/composable-node benchmark pallet \
341+
${composable-bench-node}/bin/composable benchmark pallet \
340342
--chain="${chain}" \
341343
--execution=wasm \
342344
--wasm-execution=compiled \
@@ -1082,7 +1084,7 @@
10821084
};
10831085
composable = {
10841086
type = "app";
1085-
program = "${packages.composable-node}/bin/composable-node";
1087+
program = "${packages.composable-node}/bin/composable";
10861088
};
10871089
acala = {
10881090
type = "app";

scripts/polkadot-launch/kusama-local-dali-dev-karura-dev.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ in {
3232
wsPort = 9988;
3333
count = 2;
3434
chain = "dali-dev";
35-
bin = "${composable-bin}/bin/composable-node";
35+
bin = "${composable-bin}/bin/composable";
3636
}
3737
{
3838
id = 2000;

scripts/polkadot-launch/kusama-local-picasso-dev-karura-dev.nix

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ in {
1212
relaychain = {
1313
bin = "${polkadot-bin}/bin/polkadot";
1414
# NOTE: kusama-dev and kusama-local failed to connect in 10 minutes, seems need to change spec to work faster
15-
# NOTE: `-dev` has long `timeouts`, so `-local` is for testing
15+
# NOTE: `-dev` has long `timeouts`, so `-local` is for testing
1616
chain = "rococo-local";
1717
port = 30444;
1818
wsPort = 9944;
@@ -33,7 +33,7 @@ in {
3333
wsPort = 9988;
3434
count = 2;
3535
chain = "picasso-dev";
36-
bin = "${composable-bin}/bin/composable-node";
36+
bin = "${composable-bin}/bin/composable";
3737
}
3838
{
3939
id = 2000;

scripts/polkadot-launch/rococo-local-dali-dev.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ in {
2929
wsPort = 9988;
3030
count = 3;
3131
chain = "dali-dev";
32-
bin = "${composable-bin}/bin/composable-node";
32+
bin = "${composable-bin}/bin/composable";
3333
flags = [
3434
"--unsafe-ws-external"
3535
"--unsafe-rpc-external"

0 commit comments

Comments
 (0)