Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions scripts/localnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,30 @@ fi

if [[ $BUILD_BINARY == "1" ]]; then
echo "*** Building substrate binary..."
cargo build --workspace --profile=release --features "$FEATURES" --manifest-path "$BASE_DIR/Cargo.toml"
cargo build --workspace --profile="${CARGO_PROFILE:-release}" --features "$FEATURES" --manifest-path "$BASE_DIR/Cargo.toml"
echo "*** Binary compiled"
fi

echo "*** Building chainspec..."
"$BASE_DIR/target/release/node-subtensor" build-spec --disable-default-bootnode --raw --chain $CHAIN >$FULL_PATH
"$BASE_DIR/target/${CARGO_PROFILE:-release}/node-subtensor" build-spec --disable-default-bootnode --raw --chain $CHAIN >$FULL_PATH
echo "*** Chainspec built and output to file"

# generate node keys
$BASE_DIR/target/release/node-subtensor key generate-node-key --chain="$FULL_PATH" --base-path /tmp/alice
$BASE_DIR/target/release/node-subtensor key generate-node-key --chain="$FULL_PATH" --base-path /tmp/bob
"$BASE_DIR/target/${CARGO_PROFILE:-release}/node-subtensor" key generate-node-key --chain="$FULL_PATH" --base-path /tmp/alice
"$BASE_DIR/target/${CARGO_PROFILE:-release}/node-subtensor" key generate-node-key --chain="$FULL_PATH" --base-path /tmp/bob

if [ $NO_PURGE -eq 1 ]; then
echo "*** Purging previous state skipped..."
else
echo "*** Purging previous state..."
"$BASE_DIR/target/release/node-subtensor" purge-chain -y --base-path /tmp/bob --chain="$FULL_PATH" >/dev/null 2>&1
"$BASE_DIR/target/release/node-subtensor" purge-chain -y --base-path /tmp/alice --chain="$FULL_PATH" >/dev/null 2>&1
"$BASE_DIR/target/${CARGO_PROFILE:-release}/node-subtensor" purge-chain -y --base-path /tmp/bob --chain="$FULL_PATH" >/dev/null 2>&1
"$BASE_DIR/target/${CARGO_PROFILE:-release}/node-subtensor" purge-chain -y --base-path /tmp/alice --chain="$FULL_PATH" >/dev/null 2>&1
echo "*** Previous chainstate purged"
fi

echo "*** Starting localnet nodes..."
alice_start=(
"$BASE_DIR/target/release/node-subtensor"
"$BASE_DIR/target/${CARGO_PROFILE:-release}/node-subtensor"
--base-path /tmp/alice
--chain="$FULL_PATH"
--alice
Expand All @@ -85,7 +85,7 @@ alice_start=(
)

bob_start=(
"$BASE_DIR"/target/release/node-subtensor
"$BASE_DIR/target/${CARGO_PROFILE:-release}/node-subtensor"
--base-path /tmp/bob
--chain="$FULL_PATH"
--bob
Expand Down