44
55# PID file locations
66PID_DIR := " /tmp/bulletin-pids"
7+ ZOMBIENET_DIR := " /tmp/bulletin-tests-run"
78
89# Default recipe - run the complete PAPI workflow test
910default : (run-authorize-and-store " ws" " bulletin-westend-runtime" )
@@ -58,9 +59,7 @@ setup-westend-prerequisites:
5859 cp target/ release/ polkadot $BIN_DIR/
5960 cp target/ release/ polkadot-prepare-worker $BIN_DIR/
6061 cp target/ release/ polkadot-execute-worker $BIN_DIR/
61-
62- # Verify polkadot version
63- $BIN_DIR/ polkadot --version
62+ echo " ✓ Polkadot binaries copied"
6463
6564 # Build polkadot-parachain binary
6665 echo " Building polkadot-parachain binary (this may take a while)..."
@@ -70,9 +69,7 @@ setup-westend-prerequisites:
7069 echo " Copying polkadot-parachain binary..."
7170 ls -la target/ release/ polkadot-parachain
7271 cp target/ release/ polkadot-parachain $BIN_DIR/
73-
74- # Verify polkadot-parachain version
75- $BIN_DIR/ polkadot-parachain --version
72+ echo " ✓ Polkadot-parachain binary copied"
7673
7774 # Build and install chain-spec-builder
7875 echo " Building chain-spec-builder..."
@@ -82,9 +79,7 @@ setup-westend-prerequisites:
8279 echo " Copying chain-spec-builder binary..."
8380 ls -la target/ release/ chain-spec-builder
8481 cp target/ release/ chain-spec-builder $BIN_DIR/
85-
86- # Verify chain-spec-builder
87- $BIN_DIR/ chain-spec-builder --version
82+ echo " ✓ Chain-spec-builder binary copied"
8883
8984 # Add BIN_DIR to PATH for subsequent scripts
9085 export PATH=" $BIN_DIR:$PATH"
@@ -117,6 +112,23 @@ bulletin-solo-zombienet-start runtime="bulletin-polkadot-runtime":
117112
118113 mkdir -p {{ PID_DIR }}
119114
115+ # Kill any existing zombienet processes to prevent conflicts
116+ echo " 🔍 Checking for existing zombienet processes..."
117+ ZOMBIE_PIDS=$(pgrep -f " zombienet.*spawn" || true )
118+ if [ -n " $ZOMBIE_PIDS" ]; then
119+ echo " Found existing zombienet processes: $ZOMBIE_PIDS"
120+ echo " Killing existing zombienet processes..."
121+ pkill -9 -f " zombienet.*spawn" || true
122+ # Also kill any polkadot/polkadot-parachain processes from previous runs
123+ pkill -9 -f " polkadot.*--chain.*bulletin" || true
124+ pkill -9 -f " polkadot-parachain.*--chain.*bulletin" || true
125+ pkill -9 -f " polkadot-bulletin-chain" || true
126+ echo " ✓ Cleaned up existing processes"
127+ fi
128+
129+ # Clean up stale PID file
130+ [ -f " {{ PID_DIR }} /zombienet.pid" ] && rm " {{ PID_DIR }} /zombienet.pid"
131+
120132 echo " ⚡ Starting Bulletin chain with zombienet (runtime: {{ runtime }} )..."
121133
122134 # Find zombienet binary (use env var if set, otherwise search)
@@ -168,7 +180,7 @@ bulletin-solo-zombienet-start runtime="bulletin-polkadot-runtime":
168180 cd ..
169181 POLKADOT_BINARY_PATH=$POLKADOT_BINARY_PATH \
170182 POLKADOT_PARACHAIN_BINARY_PATH=$POLKADOT_PARACHAIN_BINARY_PATH \
171- $ZOMBIENET_BIN -p native spawn $ZOMBIENET_CONFIG > / tmp/ zombienet.log 2 >&1 &
183+ $ZOMBIENET_BIN -p native spawn --dir {{ ZOMBIENET_DIR }} $ZOMBIENET_CONFIG > / tmp/ zombienet.log 2 >&1 &
172184 cd examples
173185 else # bulletin-polkadot-runtime
174186 echo " Setting up Polkadot runtime..."
@@ -177,7 +189,7 @@ bulletin-solo-zombienet-start runtime="bulletin-polkadot-runtime":
177189 BULLETIN_BINARY=$(cd .. && pwd)/ target/ release/ polkadot-bulletin-chain
178190 ZOMBIENET_CONFIG=$(cd .. && pwd)/ zombienet/ bulletin-polkadot-local.toml
179191 cd ..
180- POLKADOT_BULLETIN_BINARY_PATH=$BULLETIN_BINARY $ZOMBIENET_BIN -p native spawn $ZOMBIENET_CONFIG > / tmp/ zombienet.log 2 >&1 &
192+ POLKADOT_BULLETIN_BINARY_PATH=$BULLETIN_BINARY $ZOMBIENET_BIN -p native spawn --dir {{ ZOMBIENET_DIR }} $ZOMBIENET_CONFIG > / tmp/ zombienet.log 2 >&1 &
181193 cd examples
182194 fi
183195
@@ -387,7 +399,19 @@ run-authorize-and-store mode="ws" runtime="bulletin-polkadot-runtime": npm-insta
387399 fi
388400
389401 just setup-services {{ runtime }}
390- node $SCRIPT_NAME
402+
403+ # Run the script with chainspec_path parameter only for smoldot mode
404+ if [ " {{ mode }} " = " smoldot" ]; then
405+ # Set chainspec path based on runtime
406+ if [ " {{ runtime }} " = " bulletin-westend-runtime" ]; then
407+ CHAINSPEC_PATH=" {{ ZOMBIENET_DIR }} /bob/cfg/westend-local.json"
408+ else # bulletin-polkadot-runtime
409+ CHAINSPEC_PATH=" {{ ZOMBIENET_DIR }} /bob/cfg/bulletin-polkadot-local.json"
410+ fi
411+ node $SCRIPT_NAME " $CHAINSPEC_PATH"
412+ else
413+ node $SCRIPT_NAME
414+ fi
391415 EXAMPLE_EXIT=$?
392416
393417 echo " "
0 commit comments