@@ -230,39 +230,27 @@ teardown-services:
230230
231231 echo " ✅ Docker services stopped"
232232
233- # Run RPC node example with Docker IPFS
234- run-authorize-and-store : build npm-install
233+ # Run authorize and store example with Docker IPFS
234+ # Parameters:
235+ # mode - Connection mode: "ws" (WebSocket RPC node) or "smoldot" (light client)
236+ run-authorize-and-store mode = " ws": build npm-install
235237 #!/usr/bin/env bash
236238 set -e
237239
238- echo " 🚀 Starting RPC node workflow test with Docker..."
239- echo " "
240-
241- just setup-services
242- node authorize_and_store_papi.js
243- EXAMPLE_EXIT=$?
244-
245- echo " "
246- echo " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
247- if [ $EXAMPLE_EXIT -eq 0 ]; then
248- echo " ✅ Example completed successfully!"
240+ if [ " {{ mode }} " = " smoldot" ]; then
241+ echo " 🚀 Starting authorize and store workflow test (mode: smoldot)..."
242+ SCRIPT_NAME=" authorize_and_store_papi_smoldot.js"
243+ elif [ " {{ mode }} " = " ws" ]; then
244+ echo " 🚀 Starting authorize and store workflow test (mode: ws)..."
245+ SCRIPT_NAME=" authorize_and_store_papi.js"
249246 else
250- echo " ❌ Example failed with exit code $EXAMPLE_EXIT"
247+ echo " ❌ Error: Invalid mode '{{ mode }} '. Must be 'ws' or 'smoldot'"
248+ exit 1
251249 fi
252-
253- just teardown-services
254- exit $EXAMPLE_EXIT
255-
256- # Run smoldot example with Docker IPFS
257- run-authorize-and-store-smoldot : build npm-install
258- #!/usr/bin/env bash
259- set -e
260-
261- echo " 🚀 Starting smoldot workflow test with Docker..."
262250 echo " "
263251
264252 just setup-services
265- node authorize_and_store_papi_smoldot.js
253+ node $SCRIPT_NAME
266254 EXAMPLE_EXIT=$?
267255
268256 echo " "
@@ -275,3 +263,9 @@ run-authorize-and-store-smoldot: build npm-install
275263
276264 just teardown-services
277265 exit $EXAMPLE_EXIT
266+
267+ # Alias: Run with WebSocket RPC node
268+ run-authorize-and-store-ws : (run-authorize-and-store " ws" )
269+
270+ # Alias: Run with smoldot light client
271+ run-authorize-and-store-smoldot : (run-authorize-and-store " smoldot" )
0 commit comments