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 3557edc
Show file tree
Hide file tree
Showing 6 changed files with 50,793 additions and 50,774 deletions.
76 changes: 37 additions & 39 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 @@ -69,51 +68,50 @@ jobs:
with:
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}

- name: Build node
run: cargo build

- name: Build finney 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
- name: Build 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
rustup target add wasm32-unknown-unknown --toolchain nightly-2024-03-05-x86_64-unknown-linux-gnu
./scripts/build_all_chainspecs.sh
- 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 +nightly-2024-03-05 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 3557edc

Please sign in to comment.