Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions scripts/analyse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ WASM_FULLPATH=/build/$WASM

SZ=`du -sb $WASM_FULLPATH | awk '{print $1}'`
PROP=`subwasm -j info $WASM_FULLPATH | jq -r .proposal_hash`
AUTHORIZE_UPGRADE_PROP=`subwasm -j info $WASM_FULLPATH | jq -r .parachain_authorize_upgrade_hash`
MULTIHASH=`subwasm -j info $WASM_FULLPATH | jq -r .ipfs_hash`
SHA256=0x`shasum -a 256 $WASM_FULLPATH | awk '{print $1}'`
TMSP=$(date --utc +%FT%TZ -d @$(stat -c "%Y" $WASM_FULLPATH))
Expand All @@ -15,6 +16,7 @@ JSON=$( jq -n \
--arg tmsp "$TMSP" \
--arg size "$SZ" \
--arg prop "$PROP" \
--arg authorize_upgrade_prop "$AUTHORIZE_UPGRADE_PROP" \
--arg blake2_256 "$BLAKE2_256" \
--arg ipfs "$MULTIHASH" \
--arg sha256 "$SHA256" \
Expand All @@ -24,6 +26,7 @@ JSON=$( jq -n \
tmsp: $tmsp,
size: $size,
prop: $prop,
authorize_upgrade_prop: $authorize_upgrade_prop,
blake2_256: $blake2_256,
ipfs: $ipfs,
sha256: $sha256,
Expand Down
3 changes: 3 additions & 0 deletions scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ KB=$(expr $SZ / 1024)
TMSP=`date --utc +%FT%TZ`
SHA256=0x`shasum -a 256 $Z_WASM | awk '{print $1}'`
PROP=`subwasm -j info $Z_WASM | jq -r .proposal_hash`
AUTHORIZE_UPGRADE_PROP=`subwasm -j info $Z_WASM | jq -r .parachain_authorize_upgrade_hash`
MULTIHASH=`subwasm -j info $Z_WASM | jq -r .ipfs_hash`

# If we work on a snapshot, we will NOT get a .git folder to work on
Expand Down Expand Up @@ -179,6 +180,7 @@ JSON=$( jq -n \
--arg wasm "$WASM" \
--arg z_wasm "$Z_WASM" \
--arg prop "$PROP" \
--arg authorize_upgrade_prop "$AUTHORIZE_UPGRADE_PROP" \
--arg sha256 "$SHA256" \
--arg tmsp "$TMSP" \
--arg git_tag "$GIT_TAG" \
Expand All @@ -202,6 +204,7 @@ JSON=$( jq -n \
tmsp: $tmsp,
size: $bytes,
prop: $prop,
authorize_upgrade_prop: $authorize_upgrade_prop,
ipfs: $ipfs,
sha256: $sha256,
wasm: $z_wasm,
Expand Down
32 changes: 17 additions & 15 deletions templates/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,27 @@ Summary generated with {{ gen }} using the docker image {{ context.docker.image
Time : {{ tmsp }}

== Compact
Version : {{ runtimes.compact.subwasm.core_version }}
Metadata : V{{ runtimes.compact.subwasm.metadata_version }}
Size : {{ runtimes.compact.size | int | filesizeformat }} ({{ runtimes.compact.size }} bytes)
Proposal : {{ runtimes.compact.prop }}
IPFS : {{ runtimes.compact.ipfs }}
BLAKE2_256 : {{ runtimes.compact.blake2_256 }}
Wasm : {{ runtimes.compact.wasm }}
Version : {{ runtimes.compact.subwasm.core_version }}
Metadata : V{{ runtimes.compact.subwasm.metadata_version }}
Size : {{ runtimes.compact.size | int | filesizeformat }} ({{ runtimes.compact.size }} bytes)
setCode : {{ runtimes.compact.set_code_prop }}
authorizeUpgrade : {{ runtimes.compact.authorize_upgrade_prop }}
IPFS : {{ runtimes.compact.ipfs }}
BLAKE2_256 : {{ runtimes.compact.blake2_256 }}
Wasm : {{ runtimes.compact.wasm }}

== Compressed
{%- if runtimes.compressed %}
{%- set ratio = 100 - (( runtimes.compressed.subwasm.compression.size_compressed / runtimes.compressed.subwasm.compression.size_decompressed) ) * 100 %}
Version : {{ runtimes.compressed.subwasm.core_version }}
Metadata : V{{ runtimes.compressed.subwasm.metadata_version }}
Size : {{ runtimes.compressed.size | int | filesizeformat }} ({{ runtimes.compressed.size }} bytes)
Compression : {{ ratio | round(method="ceil", precision=2) }}%
Proposal : {{ runtimes.compressed.prop }}
IPFS : {{ runtimes.compressed.ipfs }}
BLAKE2_256 : {{ runtimes.compressed.blake2_256 }}
Wasm : {{ runtimes.compressed.wasm }}
Version : {{ runtimes.compressed.subwasm.core_version }}
Metadata : V{{ runtimes.compressed.subwasm.metadata_version }}
Size : {{ runtimes.compressed.size | int | filesizeformat }} ({{ runtimes.compressed.size }} bytes)
Compression : {{ ratio | round(method="ceil", precision=2) }}%
setCode : {{ runtimes.compressed.set_code_prop }}
authorizeUpgrade : {{ runtimes.compressed.authorize_upgrade_prop }}
IPFS : {{ runtimes.compressed.ipfs }}
BLAKE2_256 : {{ runtimes.compressed.blake2_256 }}
Wasm : {{ runtimes.compressed.wasm }}
{% else %}
No compressed runtime found
{% endif %}