Skip to content

Commit

Permalink
feat: build_all_chainspecs.sh script
Browse files Browse the repository at this point in the history
test shasum
  • Loading branch information
orriin committed Jun 2, 2024
1 parent cdf96f4 commit 771f35a
Show file tree
Hide file tree
Showing 6 changed files with 50,791 additions and 50,767 deletions.
67 changes: 35 additions & 32 deletions .github/workflows/check-chainspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
RUSTV: ${{ matrix.rust-branch }}
RUST_BACKTRACE: full
RUST_BIN_DIR: target/${{ matrix.rust-target }}
SKIP_WASM_BUILD: 1
TARGET: ${{ matrix.rust-target }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
Expand All @@ -72,48 +71,52 @@ jobs:
- name: Build node
run: cargo build

- name: Build finney chainspecs
- name: Build chainspecs
run: |
./target/debug/node-subtensor build-spec --raw --chain finney > __CI_TESTING__raw_spec_finney.json
./target/debug/node-subtensor build-spec --chain finney > __CI_TESTING__plain_spec_finney.json
- name: Build testnet chainspecs
run: |
./target/debug/node-subtensor build-spec --raw --chain test_finney > __CI_TESTING__raw_spec_testfinney.json
./target/debug/node-subtensor build-spec --chain test_finney > __CI_TESTING__plain_spec_testfinney.json
- name: Check raw_spec_finney.json
run: |
if [ "$(sha256sum __CI_TESTING__raw_spec_finney.json | awk '{print $1}')" != "$(sha256sum raw_spec_finney.json | awk '{print $1}')" ]; then
sha1=$(sha256sum __CI_TESTING__raw_spec_finney.json | awk '{print $1}')
sha2=$(sha256sum raw_spec_finney.json | awk '{print $1}')
echo "__CI_TESTING__raw_spec_finney.json SHA256: $sha1"
echo "raw_spec_finney.json SHA256: $sha2"
if [ "$sha1" != "$sha2" ]; then
echo "raw_spec_finney.json needs to be updated."
exit 1
else
echo "raw_spec_finney.json is up to date."
fi
- name: Check plain_spec_finney.json
run: |
if [ "$(sha256sum __CI_TESTING__plain_spec_finney.json | awk '{print $1}')" != "$(sha256sum plain_spec_finney.json | awk '{print $1}')" ]; then
echo "plain_spec_finney.json needs to be updated."
exit 1
else
echo "plain_spec_finney.json is up to date."
fi
- name: Check raw_spec_testfinney.json
run: |
if [ "$(sha256sum __CI_TESTING__raw_spec_testfinney.json | awk '{print $1}')" != "$(sha256sum raw_spec_testfinney.json | awk '{print $1}')" ]; then
echo "raw_spec_testfinney.json needs to be updated."
exit 1
else
echo "raw_spec_testfinney.json is up to date."
fi
- name: Check plain_spec_testfinney.json
run: |
if [ "$(sha256sum __CI_TESTING__plain_spec_testfinney.json | awk '{print $1}')" != "$(sha256sum plain_spec_testfinney.json | awk '{print $1}')" ]; then
echo "plain_spec_testfinney.json needs to be updated."
exit 1
else
echo "plain_spec_testfinney.json is up to date."
fi
# - name: Check plain_spec_finney.json
# run: |
# if [ "$(sha256sum __CI_TESTING__plain_spec_finney.json | awk '{print $1}')" != "$(sha256sum plain_spec_finney.json | awk '{print $1}')" ]; then
# diff __CI_TESTING__plain_spec_finney.json plain_spec_finney.json || true
# echo "plain_spec_finney.json needs to be updated. Run './scripts/build_all_chainspecs.sh'."
# exit 1
# else
# echo "plain_spec_finney.json is up to date."
# fi
#
# - name: Check raw_spec_testfinney.json
# run: |
# if [ "$(sha256sum __CI_TESTING__raw_spec_testfinney.json | awk '{print $1}')" != "$(sha256sum raw_spec_testfinney.json | awk '{print $1}')" ]; then
# diff __CI_TESTING__raw_spec_testfinney.json raw_spec_testfinney.json || true
# echo "raw_spec_testfinney.json needs to be updated. Run './scripts/build_all_chainspecs.sh'"
# exit 1
# else
# echo "raw_spec_testfinney.json is up to date."
# fi
#
# - name: Check plain_spec_testfinney.json
# run: |
# if [ "$(sha256sum __CI_TESTING__plain_spec_testfinney.json | awk '{print $1}')" != "$(sha256sum plain_spec_testfinney.json | awk '{print $1}')" ]; then
# diff __CI_TESTING__plain_spec_testfinney.json plain_spec_testfinney.json || true
# echo "plain_spec_testfinney.json needs to be updated. Run './scripts/build_all_chainspecs.sh'"
# exit 1
# else
# echo "plain_spec_testfinney.json is up to date."
# fi
101,460 changes: 50,731 additions & 50,729 deletions plain_spec_finney.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions plain_spec_testfinney.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions raw_spec_finney.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions raw_spec_testfinney.json

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions scripts/build_all_chainspecs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

echo "*** Building node..."
cargo build

echo "*** Building chainspecs..."
./target/debug/node-subtensor build-spec --raw --chain finney >raw_spec_finney.json
./target/debug/node-subtensor build-spec --chain finney >plain_spec_finney.json

./target/debug/node-subtensor build-spec --raw --chain test_finney >raw_spec_testfinney.json
./target/debug/node-subtensor build-spec --chain test_finney >plain_spec_testfinney.json

echo "*** Done!"

0 comments on commit 771f35a

Please sign in to comment.