Add stop-services-on-localnet.sh teardown script#109
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a teardown script to stop the localnet stack started by services/run-services-on-localnet.sh, covering both Docker Compose services and the backgrounded Solana test validator.
Changes:
- Add
services/stop-services-on-localnet.shtodocker compose downthe faucet/maker-bot/taker-bot services. - Add logic to detect and stop a running
solana-test-validatorprocess.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a teardown helper script to stop the Dockerized localnet services and terminate the locally running Solana test validator that may have been started by run-services-on-localnet.sh.
Changes:
- Add
services/stop-services-on-localnet.shtodocker compose downthe faucet/maker-bot/taker-bot stacks. - Add logic to detect and terminate
solana-test-validatorwhen running.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| if pgrep -x solana-test-validator >/dev/null; then | ||
| echo "Stopping solana-test-validator..." | ||
| pkill -x solana-test-validator |
| if pgrep -x solana-test-validator >/dev/null; then | ||
| echo "Stopping solana-test-validator..." | ||
| pkill -x solana-test-validator | ||
| else | ||
| echo "No solana-test-validator process running." | ||
| fi |
| for svc in faucet maker-bot taker-bot; do | ||
| compose_file="services/$svc/compose.yaml" | ||
| if [ -f "$compose_file" ]; then | ||
| echo "Stopping $svc..." | ||
| docker compose -f "$compose_file" down --remove-orphans | ||
| fi | ||
| done | ||
|
|
||
| if pgrep -x solana-test-validator >/dev/null; then | ||
| echo "Stopping solana-test-validator..." | ||
| pkill -x solana-test-validator | ||
| else | ||
| echo "No solana-test-validator process running." | ||
| fi | ||
|
|
|
@finnfujimura I notice that this isn't referenced in a package.json script or similar, so how about adding it to an applicable README? Once you add this in and after you've addressed reviews from Copilot and @val-levy, then I'm guessing it'll be good to merge since it's pretty straightforward |
Tears down everything started by
run-services-on-localnet.sh: