forked from opentensor/subtensor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09e0270
commit 3cb512e
Showing
9 changed files
with
147 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
use crate::Vec; | ||
pub type Certificate = Vec<u8>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!/bin/bash | ||
|
||
: "${CHAIN:=local}" | ||
: "${BUILD_BINARY:=1}" | ||
: "${SPEC_PATH:=specs/}" | ||
: "${FEATURES:=pow-faucet}" | ||
|
||
FULL_PATH="$SPEC_PATH$CHAIN.json" | ||
|
||
if [ ! -d "$SPEC_PATH" ]; then | ||
echo "*** Creating directory ${SPEC_PATH}..." | ||
mkdir $SPEC_PATH | ||
fi | ||
|
||
if [[ $BUILD_BINARY == "1" ]]; then | ||
echo "*** Building substrate binary..." | ||
cargo build --release --features "$FEATURES" | ||
echo "*** Binary compiled" | ||
fi | ||
|
||
echo $CHAIN | ||
echo $FULL_PATH | ||
|
||
echo "*** Building chainspec..." | ||
./target/release/node-subtensor build-spec --disable-default-bootnode --raw --chain $CHAIN > $FULL_PATH | ||
echo "*** Chainspec built and output to file" | ||
|
||
echo "*** Purging previous state..." | ||
./target/release/node-subtensor purge-chain -y --base-path /tmp/update/bob --chain="$FULL_PATH" >/dev/null 2>&1 | ||
./target/release/node-subtensor purge-chain -y --base-path /tmp/update/alice --chain="$FULL_PATH" >/dev/null 2>&1 | ||
echo "*** Previous chainstate purged" | ||
|
||
echo "*** Starting localnet nodes..." | ||
alice_start=( | ||
./target/release/node-subtensor | ||
--base-path /tmp/update/alice | ||
--chain="$FULL_PATH" | ||
--alice | ||
--port 30334 | ||
--ws-port 9946 | ||
--rpc-port 9934 | ||
--validator | ||
--rpc-cors=all | ||
--allow-private-ipv4 | ||
--discover-local | ||
) | ||
|
||
bob_start=( | ||
./target/release/node-subtensor | ||
--base-path /tmp/update/bob | ||
--chain="$FULL_PATH" | ||
--bob | ||
--port 30335 | ||
--ws-port 9947 | ||
--rpc-port 9935 | ||
--validator | ||
--allow-private-ipv4 | ||
--discover-local | ||
) | ||
|
||
(trap 'kill 0' SIGINT; ("${alice_start[@]}" 2>&1) & ("${bob_start[@]}" 2>&1)) |