66PID_DIR := " /tmp/bulletin-pids"
77
88# Default recipe - run the complete PAPI workflow test
9- default : run-authorize-and-store
9+ default : ( run-authorize-and-store " smoldot" " bulletin-polkadot" )
1010
1111# Build the bulletin chain node in release mode
12- build :
13- cargo build --release -p polkadot-bulletin-chain
12+ # Parameters:
13+ # runtime - Runtime name (e.g., "bulletin-polkadot"), taken from ../scripts/runtimes-matrix.json
14+ build runtime = " bulletin-polkadot":
15+ cargo build --release -p {{ runtime }}
1416
1517# Install JavaScript dependencies
1618npm-install :
@@ -28,14 +30,35 @@ _ipfs-cmd:
2830 exit 1
2931 fi
3032
33+ # Helper function to map runtime package name to zombienet config filename (internal use)
34+ _ zombienet-config-name runtime :
35+ #!/usr/bin/env bash
36+ case " {{ runtime }} " in
37+ " bulletin-polkadot-runtime" )
38+ echo " bulletin-polkadot-local.toml"
39+ ;;
40+ " bulletin-westend-runtime" )
41+ echo " bulletin-westend-local.toml"
42+ ;;
43+ " polkadot-bulletin-chain-runtime" )
44+ echo " bulletin-polkadot.toml"
45+ ;;
46+ *)
47+ echo " β Error: Unknown runtime '{{ runtime }} '" >&2
48+ exit 1
49+ ;;
50+ esac
51+
3152# Start start solo chain with zombienet in background
32- bulletin-solo-zombienet-start :
53+ # Parameters:
54+ # runtime - Runtime name (e.g., "bulletin-polkadot"), taken from ../scripts/runtimes-matrix.json
55+ bulletin-solo-zombienet-start runtime = " bulletin-polkadot":
3356 #!/usr/bin/env bash
3457 set -e
3558
3659 mkdir -p {{ PID_DIR }}
3760
38- echo " β‘ Starting Bulletin chain with zombienet..."
61+ echo " β‘ Starting Bulletin chain with zombienet (runtime: {{ runtime }} ) ..."
3962
4063 # Find zombienet binary (use env var if set, otherwise search)
4164 if [ -n " $ZOMBIENET_BINARY" ]; then
@@ -54,8 +77,11 @@ bulletin-solo-zombienet-start:
5477 echo " Using zombienet: $ZOMBIENET_BIN"
5578
5679 # Get absolute paths for bulletin binary and config
57- BULLETIN_BINARY=$(cd .. && pwd)/ target/ release/ polkadot-bulletin-chain
58- ZOMBIENET_CONFIG=$(cd .. && pwd)/ zombienet/ bulletin-polkadot-local.toml
80+ BULLETIN_BINARY=$(cd .. && pwd)/ target/ release/ {{ runtime }}
81+ ZOMBIENET_TOML=$(just _zombienet-config-name {{ runtime }})
82+ ZOMBIENET_CONFIG=$(cd .. && pwd)/ zombienet/ $ZOMBIENET_TOML
83+
84+ echo " Using config: $ZOMBIENET_CONFIG"
5985
6086 POLKADOT_BULLETIN_BINARY_PATH=$BULLETIN_BINARY $ZOMBIENET_BIN -p native spawn $ZOMBIENET_CONFIG > / tmp/ zombienet.log 2 >&1 &
6187 ZOMBIENET_PID=$!
@@ -167,18 +193,20 @@ papi-generate:
167193 npm run papi:generate
168194
169195# Setup all services using Docker for IPFS
170- setup-services :
196+ # Parameters:
197+ # runtime - Runtime to build and run (e.g., "bulletin-polkadot-runtime", "bulletin-westend-runtime", "polkadot-bulletin-chain-runtime")
198+ setup-services runtime = " bulletin-polkadot":
171199 #!/usr/bin/env bash
172200 set -e
173201
174202 echo " π§ Tearing down Docker services if they are running..."
175203 just ipfs-shutdown
176204
177- echo " π³ Setting up services with Docker IPFS..."
205+ echo " π³ Setting up services with Docker IPFS (runtime: {{ runtime }} ) ..."
178206
179207 # Start services with Docker
180208 just ipfs-start
181- just bulletin-solo-zombienet-start
209+ just bulletin-solo-zombienet-start " {{ runtime }} "
182210
183211 # Wait a bit longer and verify zombienet is running
184212 echo " π Verifying zombienet is ready..."
@@ -229,23 +257,24 @@ teardown-services:
229257# Run authorize and store example with Docker IPFS
230258# Parameters:
231259# mode - Connection mode: "ws" (WebSocket RPC node) or "smoldot" (light client)
232- run-authorize-and-store mode = " ws": build npm-install
260+ # runtime - Runtime name (e.g., "bulletin-polkadot", "bulletin-westend", "bulletin-rococo")
261+ run-authorize-and-store mode = " ws" runtime = " bulletin-polkadot": (build runtime) npm-install
233262 #!/usr/bin/env bash
234263 set -e
235264
236265 if [ " {{ mode }} " = " smoldot" ]; then
237- echo " π Starting authorize and store workflow test (mode: smoldot)..."
266+ echo " π Starting authorize and store workflow test (mode: smoldot, runtime: {{ runtime }} )..."
238267 SCRIPT_NAME=" authorize_and_store_papi_smoldot.js"
239268 elif [ " {{ mode }} " = " ws" ]; then
240- echo " π Starting authorize and store workflow test (mode: ws)..."
269+ echo " π Starting authorize and store workflow test (mode: ws, runtime: {{ runtime }} )..."
241270 SCRIPT_NAME=" authorize_and_store_papi.js"
242271 else
243272 echo " β Error: Invalid mode '{{ mode }} '. Must be 'ws' or 'smoldot'"
244273 exit 1
245274 fi
246275 echo " "
247276
248- just setup-services
277+ just setup-services " {{ runtime }} "
249278 node $SCRIPT_NAME
250279 EXAMPLE_EXIT=$?
251280
0 commit comments