Skip to content

Commit 346986b

Browse files
authored
Merge pull request #2132 from opentensor/feat/add-srtool-scripts
add srtool scripts
2 parents 3e478e8 + fd23a59 commit 346986b

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
docker build --build-arg RUSTC_VERSION="1.85.0" -t srtool https://github.com/paritytech/srtool.git#refs/tags/v0.17.0

scripts/srtool/run-srtool.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
if [ -z "$CARGO_HOME" ]; then
3+
echo "CARGO_HOME is not set"
4+
exit 1
5+
fi
6+
7+
cd runtime # check for symlink
8+
if [ ! -L node-subtensor ]; then
9+
ln -s . node-subtensor
10+
fi
11+
cd ..
12+
13+
docker run --rm --user root --platform=linux/amd64 \
14+
-e PACKAGE=node-subtensor-runtime \
15+
-e BUILD_OPTS="--features=metadata-hash" \
16+
-e PROFILE=production \
17+
-v $HOME/.cargo:/cargo-home \
18+
-v $(pwd):/build \
19+
-it srtool bash -c "git config --global --add safe.directory /build && \
20+
/srtool/build --app > /build/runtime/node-subtensor/srtool-output.log; \
21+
BUILD_EXIT_CODE=\$?; \
22+
if [ \"\$BUILD_EXIT_CODE\" -ne 0 ]; then \
23+
cat /build/runtime/node-subtensor/srtool-output.log; \
24+
exit \$BUILD_EXIT_CODE; \
25+
fi && \
26+
tail -n 1 /build/runtime/node-subtensor/srtool-output.log > /build/runtime/node-subtensor/subtensor-digest.json"

0 commit comments

Comments
 (0)