File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed
Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ substrate-wasm-builder = { workspace = true, optional = true }
9494[features ]
9595default = [" std" ]
9696pow-faucet = [" pallet-subtensor/pow-faucet" ]
97+ fast-blocks = []
9798std = [
9899 " frame-try-runtime?/std" ,
99100 " frame-system-benchmarking?/std" ,
Original file line number Diff line number Diff line change @@ -148,8 +148,13 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
148148/// up by `pallet_aura` to implement `fn slot_duration()`.
149149///
150150/// Change this to adjust the block time.
151+ #[ cfg( not( feature = "fast-blocks" ) ) ]
151152pub const MILLISECS_PER_BLOCK : u64 = 12000 ;
152153
154+ /// Fast blocks for development
155+ #[ cfg( feature = "fast-blocks" ) ]
156+ pub const MILLISECS_PER_BLOCK : u64 = 250 ;
157+
153158// NOTE: Currently it is not possible to change the slot duration after the chain has started.
154159// Attempting to do so will brick block production.
155160pub const SLOT_DURATION : u64 = MILLISECS_PER_BLOCK ;
Original file line number Diff line number Diff line change @@ -8,11 +8,15 @@ BASE_DIR="$SCRIPT_DIR/.."
88
99: " ${CHAIN:= local} "
1010: " ${BUILD_BINARY:= 1} "
11- : " ${FEATURES:= pow-faucet} "
11+ : " ${FEATURES:= " pow-faucet fast-blocks " } "
1212
1313SPEC_PATH=" ${SCRIPT_DIR} /specs/"
1414FULL_PATH=" $SPEC_PATH$CHAIN .json"
1515
16+ # Kill any existing nodes which may have not exited correctly after a previous
17+ # run.
18+ pkill -9 ' node-subtensor'
19+
1620if [ ! -d " $SPEC_PATH " ]; then
1721 echo " *** Creating directory ${SPEC_PATH} ..."
1822 mkdir $SPEC_PATH
@@ -59,8 +63,10 @@ bob_start=(
5963 --discover-local
6064)
6165
66+ trap ' pkill -P $$' EXIT SIGINT SIGTERM
67+
6268(
63- trap ' kill 0' SIGINT
6469 (" ${alice_start[@]} " 2>&1 ) &
6570 (" ${bob_start[@]} " 2>&1 )
71+ wait
6672)
You can’t perform that action at this time.
0 commit comments