Skip to content

Commit

Permalink
feat: build_all_chainspecs.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
orriin committed May 31, 2024
1 parent cdf96f4 commit 1fdeb7f
Show file tree
Hide file tree
Showing 6 changed files with 50,764 additions and 50,743 deletions.
16 changes: 8 additions & 8 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,19 +71,17 @@ 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
diff __CI_TESTING__raw_spec_finney.json raw_spec_finney.json || true
echo "raw_spec_finney.json needs to be updated."
exit 1
else
Expand All @@ -94,7 +91,8 @@ jobs:
- 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."
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."
Expand All @@ -103,7 +101,8 @@ jobs:
- 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."
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."
Expand All @@ -112,7 +111,8 @@ jobs:
- 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."
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."
Expand Down
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 1fdeb7f

Please sign in to comment.