compute-runtime-blob-hash.sh 941 B

1234567891011121314151617181920
  1. #!/usr/bin/env bash
  2. # The script computes the b2sum of the wasm blob in a pre-built joystream/node image
  3. # Assumes b2sum is already instally on the host machine.
  4. # Create a non running container from joystream/node
  5. docker create --name temp-container-joystream-node joystream/node
  6. # Copy the compiled wasm blob from the docker container to our host
  7. docker cp temp-container-joystream-node:/joystream/runtime.compact.wasm joystream_runtime.wasm
  8. docker rm temp-container-joystream-node
  9. # compute blake2_256 hash of the wasm blob - this should match the hash computed when the runtime file is
  10. # used to create a runtime upgrade proposal.
  11. # osx with: brew install b2sum; b2sum -b blake2b -l 256 joystream_runtime.wasm
  12. # ubuntu 17.0+ with: apt-get install coreutils; b2sum -l 256 joystream_runtime.wasm
  13. # TODO: add install of b2sum to setup.sh
  14. b2sum -l 256 joystream_runtime.wasm
  15. b2sum -l 512 joystream_runtime.wasm
  16. rm joystream_runtime.wasm