From 7f74ab2b29a5ed3043b2c3c0d89928885f77bde2 Mon Sep 17 00:00:00 2001 From: Alexander Popiak Date: Thu, 4 Nov 2021 14:29:08 +0100 Subject: [PATCH] add a script for verifying the shell chain spec --- scripts/verify_shell_spec.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 scripts/verify_shell_spec.sh diff --git a/scripts/verify_shell_spec.sh b/scripts/verify_shell_spec.sh new file mode 100755 index 0000000000..e9483e8712 --- /dev/null +++ b/scripts/verify_shell_spec.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +usage() { + echo Usage: + echo "$0 " + exit 1 +} + +set -e + +spec_path=$1 + +# sort the json files by key to make sure they are the same when hashed +jq --sort-keys . polkadot-parachains/res/shell-statemint.json > sorted.json +# generate the checksum +sha256sum sorted.json > chainspec-checksum + +# overwrite the sorted chainspec json... +jq --sort-keys . $spec_path > sorted.json +# ... so that we can verify the checksum +sha256sum --check chainspec-checksum