Skip to content

Commit c5865b4

Browse files
committed
update docs to use production profile
remove --execution and --wasm-execution
1 parent c097ff8 commit c5865b4

File tree

9 files changed

+148
-157
lines changed

9 files changed

+148
-157
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ RUN /subtensor/scripts/init.sh
5252

5353
# Cargo build
5454
WORKDIR /subtensor
55-
RUN cargo build --release --features runtime-benchmarks --locked
55+
RUN cargo build --profile production --features runtime-benchmarks --locked
5656
EXPOSE 30333 9933 9944
5757

5858

@@ -61,4 +61,4 @@ FROM $BASE_IMAGE AS subtensor
6161
COPY --from=builder /subtensor/snapshot.json /
6262
COPY --from=builder /subtensor/raw_spec.json /
6363
COPY --from=builder /subtensor/raw_testspec.json /
64-
COPY --from=builder /subtensor/target/release/node-subtensor /usr/local/bin
64+
COPY --from=builder /subtensor/target/production/node-subtensor /usr/local/bin

docs/running-subtensor-locally.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ rm -rf /tmp/blockchain
162162
Install subtensor by compiling with `cargo`:
163163

164164
```bash
165-
cargo build --release --features=runtime-benchmarks
165+
cargo build --profile production --features=runtime-benchmarks
166166
```
167167

168168
## Run the subtensor node
@@ -174,32 +174,33 @@ You can now run the public subtensor node either as a lite node or as an archive
174174
To run a lite node connected to the mainchain, execute the below command (note the `--sync=warp` flag which runs the subtensor node in lite mode):
175175

176176
```bash title="With --sync=warp setting, for lite node"
177-
./target/release/node-subtensor --chain raw_spec.json --base-path /tmp/blockchain --sync=warp --execution wasm --wasm-execution compiled --port 30333 --max-runtime-instances 32 --rpc-max-response-size 2048 --rpc-cors all --rpc-port 9944 --bootnodes /ip4/13.58.175.193/tcp/30333/p2p/12D3KooWDe7g2JbNETiKypcKT1KsCEZJbTzEHCn8hpd4PHZ6pdz5 --no-mdns --in-peers 8000 --out-peers 8000 --prometheus-external --rpc-external
177+
./target/production/node-subtensor --chain raw_spec.json --base-path /tmp/blockchain --sync=warp --port 30333 --max-runtime-instances 32 --rpc-max-response-size 2048 --rpc-cors all --rpc-port 9944 --bootnodes /ip4/13.58.175.193/tcp/30333/p2p/12D3KooWDe7g2JbNETiKypcKT1KsCEZJbTzEHCn8hpd4PHZ6pdz5 --no-mdns --in-peers 8000 --out-peers 8000 --prometheus-external --rpc-external
178178
```
179179

180180
### Archive node on mainchain
181181

182182
To run an archive node connected to the mainchain, execute the below command (note the `--sync=full` which syncs the node to the full chain and `--pruning archive` flags, which disables the node's automatic pruning of older historical data):
183183

184184
```bash title="With --sync=full and --pruning archive setting, for archive node"
185-
./target/release/node-subtensor --chain raw_spec.json --base-path /tmp/blockchain --sync=full --pruning archive --execution wasm --wasm-execution compiled --port 30333 --max-runtime-instances 32 --rpc-max-response-size 2048 --rpc-cors all --rpc-port 9944 --bootnodes /ip4/13.58.175.193/tcp/30333/p2p/12D3KooWDe7g2JbNETiKypcKT1KsCEZJbTzEHCn8hpd4PHZ6pdz5 --no-mdns --in-peers 8000 --out-peers 8000 --prometheus-external --rpc-external
185+
./target/production/node-subtensor --chain raw_spec.json --base-path /tmp/blockchain --sync=full --pruning archive --port 30333 --max-runtime-instances 32 --rpc-max-response-size 2048 --rpc-cors all --rpc-port 9944 --bootnodes /ip4/13.58.175.193/tcp/30333/p2p/12D3KooWDe7g2JbNETiKypcKT1KsCEZJbTzEHCn8hpd4PHZ6pdz5 --no-mdns --in-peers 8000 --out-peers 8000 --prometheus-external --rpc-external
186186
```
187187

188188
### Lite node on testchain
189189

190190
To run a lite node connected to the testchain, execute the below command:
191191

192192
```bash title="With bootnodes set to testnet and --sync=warp setting, for lite node."
193-
./target/release/node-subtensor --chain raw_testspec.json --base-path /tmp/blockchain --sync=warp --execution wasm --wasm-execution compiled --port 30333 --max-runtime-instances 32 --rpc-max-response-size 2048 --rpc-cors all --rpc-port 9944 --bootnodes /dns/bootnode.test.finney.opentensor.ai/tcp/30333/p2p/12D3KooWPM4mLcKJGtyVtkggqdG84zWrd7Rij6PGQDoijh1X86Vr --no-mdns --in-peers 8000 --out-peers 8000 --prometheus-external --rpc-external
193+
./target/production/node-subtensor --chain raw_testspec.json --base-path /tmp/blockchain --sync=warp --port 30333 --max-runtime-instances 32 --rpc-max-response-size 2048 --rpc-cors all --rpc-port 9944 --bootnodes /dns/bootnode.test.finney.opentensor.ai/tcp/30333/p2p/12D3KooWPM4mLcKJGtyVtkggqdG84zWrd7Rij6PGQDoijh1X86Vr --no-mdns --in-peers 8000 --out-peers 8000 --prometheus-external --rpc-external
194194
```
195195

196196
### Archive node on testchain
197197

198198
To run an archive node connected to the testchain, execute the below command:
199199

200200
```bash title="With bootnodes set to testnet and --sync=full and --pruning archive setting, for archive node"
201-
./target/release/node-subtensor --chain raw_testspec.json --base-path /tmp/blockchain --sync=full --pruning archive --execution wasm --wasm-execution compiled --port 30333 --max-runtime-instances 32 --rpc-max-response-size 2048 --rpc-cors all --rpc-port 9944 --bootnodes /dns/bootnode.test.finney.opentensor.ai/tcp/30333/p2p/12D3KooWPM4mLcKJGtyVtkggqdG84zWrd7Rij6PGQDoijh1X86Vr --no-mdns --in-peers 8000 --out-peers 8000 --prometheus-external --rpc-external
201+
./target/production/node-subtensor --chain raw_testspec.json --base-path /tmp/blockchain --sync=full --pruning archive --port 30333 --max-runtime-instances 32 --rpc-max-response-size 2048 --rpc-cors all --rpc-port 9944 --bootnodes /dns/bootnode.test.finney.opentensor.ai/tcp/30333/p2p/12D3KooWPM4mLcKJGtyVtkggqdG84zWrd7Rij6PGQDoijh1X86Vr --no-mdns --in-peers 8000 --out-peers 8000 --prometheus-external --rpc-external
202202
```
203203

204204
## Running on cloud
205+
205206
We have not tested these installation scripts on any cloud service. In addition, if you are using Runpod cloud service, then note that this service is already [containerized](https://docs.runpod.io/pods/overview). Hence, the only option available to you is to compile from the source, as described in the above [Method 2: Using Source Code](#method-2-using-source-code) section. Note that these scripts have not been tested on Runpod.

docs/rust-setup.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
---
22
title: Installation
33
---
4-
5-
This guide is for reference only, please check the latest information on getting starting with Substrate
4+
This guide is for reference only, please check the latest information on getting starting with Substrate
65
[here](https://docs.substrate.io/main-docs/install/).
76

87
This page will guide you through the **2 steps** needed to prepare a computer for **Substrate** development.
@@ -207,7 +206,7 @@ Use the `WASM_BUILD_TOOLCHAIN` environment variable to specify the Rust nightly
207206
project should use for Wasm compilation:
208207

209208
```bash
210-
WASM_BUILD_TOOLCHAIN=nightly-<yyyy-MM-dd> cargo build --release
209+
WASM_BUILD_TOOLCHAIN=nightly-<yyyy-MM-dd> cargo build --profile production
211210
```
212211

213212
> Note that this only builds _the runtime_ with the specified nightly. The rest of project will be
@@ -223,3 +222,4 @@ rustup uninstall nightly
223222
rustup install nightly-<yyyy-MM-dd>
224223
rustup target add wasm32-unknown-unknown --toolchain nightly-<yyyy-MM-dd>
225224
```
225+
Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
cargo build --release --features runtime-benchmarks
2-
./target/release/node-subtensor benchmark pallet \
3-
--chain=local \
4-
--execution=wasm \
5-
--wasm-execution=compiled \
6-
--pallet=pallet_admin_utils \
7-
--extrinsic="*" \
8-
--steps 50 \
9-
--repeat 20 \
10-
--output=pallets/admin-utils/src/weights.rs \
11-
--template=./.maintain/frame-weight-template.hbs
1+
cargo build --profile production --features runtime-benchmarks
2+
./target/production/node-subtensor benchmark pallet \
3+
--chain=local \
4+
--pallet=pallet_admin_utils \
5+
--extrinsic="*" \
6+
--steps 50 \
7+
--repeat 20 \
8+
--output=pallets/admin-utils/src/weights.rs \
9+
--template=./.maintain/frame-weight-template.hbs
Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
cargo build --release --features runtime-benchmarks
2-
./target/release/node-subtensor benchmark pallet \
3-
--chain=local \
4-
--execution=wasm \
5-
--wasm-execution=compiled \
6-
--pallet=pallet_commitments \
7-
--extrinsic="*" \
8-
--output=pallets/commitments/src/weights.rs \
9-
--template=./.maintain/frame-weight-template.hbs
1+
cargo build --profile production --features runtime-benchmarks
2+
./target/production/node-subtensor benchmark pallet \
3+
--chain=local \
4+
--pallet=pallet_commitments \
5+
--extrinsic="*" \
6+
--output=pallets/commitments/src/weights.rs \
7+
--template=./.maintain/frame-weight-template.hbs
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
cargo build --release --features runtime-benchmarks
2-
./target/release/node-subtensor benchmark pallet \
3-
--chain=local \
4-
--execution=wasm \
5-
--wasm-execution=compiled \
6-
--pallet=pallet_registry \
7-
--extrinsic="*" \
8-
--output=pallets/registry/src/weights.rs \
9-
--template=./.maintain/frame-weight-template.hbs
2+
./target/production/node-subtensor benchmark pallet \
3+
--chain=local \
4+
--pallet=pallet_registry \
5+
--extrinsic="*" \
6+
--output=pallets/registry/src/weights.rs \
7+
--template=./.maintain/frame-weight-template.hbs

scripts/benchmark.sh

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,46 @@
11
#!/usr/bin/env bash
22

3-
4-
DEFAULT_BIN_PATH='./target/release/node-subtensor'
3+
DEFAULT_BIN_PATH='./target/production/node-subtensor'
54
BIN_PATH=$DEFAULT_BIN_PATH
65
TMP_SPEC='temp.json'
76
OUTPUT_FILE='benchmarking.txt'
87

9-
108
# Getting arguments from user
119
while [[ $# -gt 0 ]]; do
1210
case $1 in
13-
-p|--bin-path)
14-
BIN_PATH="$2"
15-
shift
16-
shift
17-
;;
18-
-*|--*)
19-
echo "Unknown option $1"
20-
exit 1
21-
;;
22-
*)
23-
POSITIONAL_ARGS+=("$1")
24-
shift
25-
;;
11+
-p | --bin-path)
12+
BIN_PATH="$2"
13+
shift
14+
shift
15+
;;
16+
-* | --*)
17+
echo "Unknown option $1"
18+
exit 1
19+
;;
20+
*)
21+
POSITIONAL_ARGS+=("$1")
22+
shift
23+
;;
2624
esac
2725
done
2826

2927
# Ensure binary exists before node-subtensor executions
3028
if [ ! -f $BIN_PATH ]; then
31-
if [[ "$DEFAULT_BIN_PATH" == "$BIN_PATH" ]]; then
32-
cargo build --release --features runtime-benchmarks
33-
else
34-
echo "Binary '$BIN_PATH' does not exist. You can use -p or --bin-path to specify a different location."
35-
exit 1
36-
fi
29+
if [[ "$DEFAULT_BIN_PATH" == "$BIN_PATH" ]]; then
30+
cargo build --profile production --features runtime-benchmarks
31+
else
32+
echo "Binary '$BIN_PATH' does not exist. You can use -p or --bin-path to specify a different location."
33+
exit 1
34+
fi
3735
fi
3836

3937
# Build Temporary Spec
40-
$BIN_PATH build-spec --disable-default-bootnode --raw --chain local > $TMP_SPEC
38+
$BIN_PATH build-spec --disable-default-bootnode --raw --chain local >$TMP_SPEC
4139

4240
# Run benchmark
4341
$BIN_PATH benchmark pallet \
44-
--chain=$TMP_SPEC \
45-
--execution=native --wasm-execution=compiled \
46-
--pallet pallet-subtensor --extrinsic 'benchmark_dissolve_network' \
47-
--output $OUTPUT_FILE
42+
--chain=$TMP_SPEC \
43+
--pallet pallet-subtensor --extrinsic 'benchmark_dissolve_network' \
44+
--output $OUTPUT_FILE
4845

49-
rm $TMP_SPEC
46+
rm $TMP_SPEC

scripts/build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
cargo build --release --features runtime-benchmarks
1+
cargo build --profile production --features runtime-benchmarks
2+

0 commit comments

Comments
 (0)