Browse Source

build scripts: compute wasm blob hash when building the docker joystream/node image

Mokhtar Naamani 4 years ago
parent
commit
b9da602235

+ 7 - 0
devops/dockerfiles/node-and-runtime/Dockerfile

@@ -14,6 +14,13 @@ COPY --from=builder /joystream/target/release/wbuild/joystream-node-runtime/joys
 # confirm it works
 RUN /joystream/node --version
 
+# https://manpages.debian.org/stretch/coreutils/b2sum.1.en.html
+# RUN apt-get install coreutils
+# print the blake2 256 hash of the wasm blob
+RUN b2sum -l 256 /joystream/runtime.compact.wasm
+# print the blake2 512 hash of the wasm blob
+RUN b2sum -l 512 /joystream/runtime.compact.wasm
+
 EXPOSE 30333 9933 9944
 
 # Use these volumes to persits chain state and keystore, eg.:

+ 4 - 0
scripts/compute-runtime-blob-hash.sh

@@ -1,5 +1,8 @@
 #!/usr/bin/env bash
 
+# The script computes the b2sum of the wasm blob in a pre-built joystream/node image
+# Assumes b2sum is already instally on the host machine.
+
 # Create a non running container from joystream/node
 docker create --name temp-container-joystream-node joystream/node
 
@@ -13,4 +16,5 @@ docker rm temp-container-joystream-node
 # ubuntu 17.0+ with: apt-get install coreutils; b2sum -l 256 joystream_runtime.wasm
 # TODO: add install of b2sum to setup.sh
 b2sum -l 256 joystream_runtime.wasm
+b2sum -l 512 joystream_runtime.wasm
 rm joystream_runtime.wasm